@ar-agents/mercadopago · v0.15.2

Mercado Pago
Agent Toolkit.
Built on Vercel.

Drop Mercado Pago into your AI agent. The whole API, with idempotency, retries, observability, and human-in-the-loop guardrails on irreversible operations.

Deploy on VercelGitHubnpmCookbook
ready
@ar-agents/mercadopago

How it compares

Feature@ar-agents
/mercadopago
mercadopago
(official)
Stripe Agent
Toolkit
Vercel AI SDK 6 tool schemasno✓ (Stripe)
Argentine-specific (cuotas, ARCA, AR phone)partialno
Tool count89thin REST26 (Stripe)
Webhooks: HMAC + dedup + replay windowclient only
Edge Runtime + Vercel KV adaptersNode-onlyoptional
OpenTelemetry instrumentationnono
Deterministic idempotency by defaultnono
Programmatic HITL on irreversible opsnono
MercadoPago coveragefullfulln/a

What's in the box

Payments

create / capture / refund · OAuth marketplace · Checkout Pro · Order Management

Subscriptions

create / get / pause / resume / cancel · plans · saved cards

Cuotas

AR issuer-promo catalog · installments · 3DS challenge resolution

QR + Point

in-store QR · physical Point devices · Stores + POS

Webhooks

HMAC verification · replay window · deduplication · handle_webhook combo

State

InMemory + Vercel KV adapters out of the box · pluggable interface

Observability

OpenTelemetry traces via subpath · audit log adapter · circuit breaker

Safety

deterministic idempotency by default · programmatic HITL on 8 irreversible ops

Quick start

pnpm add @ar-agents/mercadopago ai zod

import { Experimental_Agent as Agent, stepCountIs } from "ai";
import {
  MercadoPagoClient,
  mercadoPagoTools,
  InMemoryStateAdapter,
} from "@ar-agents/mercadopago";

const mp = new MercadoPagoClient({
  accessToken: process.env.MP_ACCESS_TOKEN!, // TEST- for sandbox, APP_USR- for prod
});

const agent = new Agent({
  model: "anthropic/claude-sonnet-4-6",
  tools: mercadoPagoTools(mp, {
    state: new InMemoryStateAdapter(), // swap for VercelKVStateAdapter in prod
    backUrl: "https://yoursite.com/subscription/done",
  }),
  stopWhen: stepCountIs(8),
});

const { text } = await agent.generate({
  prompt: "Creá una subscription mensual de $1000 ARS para customer@example.com.",
});

Other AR primitives in this monorepo

Same approach, applied to the rest of the stack an Argentine business needs. Each ships independently to npm and composes with @ar-agents/mercadopago.

@ar-agents/identity

v0.5.0

CUIT/CUIL validation + AFIP/ARCA padrón lookup (constancia con monotributo + condición IVA). WSAA SOAP via subpath.

@ar-agents/identity-attest

v0.4.1

Verification orchestrator (WhatsApp OTP, email magic-link, Auth0, Magic.link, MP Identity). Returns HMAC-signed attestation with a trust level.

@ar-agents/whatsapp

v0.3.0

WhatsApp Business Cloud API. Webhook + HMAC verify. AR phone normalizer. scopedTo mode binds outbound tools to a single sender.

@ar-agents/facturacion

v0.1.0

AFIP/ARCA factura electrónica (WSFE). Factura A/B/C, NC/ND, FCE MiPyMEs. Local pre-flight validator catches the 10 most common rejection reasons before the round-trip.

@ar-agents/banking

v0.1.0

CBU/CVU validation with bank/PSP identification (Galicia, Nación, Mercado Pago, Ualá, Naranja X…). BCRA Central de Deudores lookup.

@ar-agents/shipping

v0.1.0

Andreani (full REST), OCA, Correo Argentino. cotizar / crear / trackear / cancelar. Provincia + CPA helpers.

@ar-agents/mcp

v0.4.9

MCP server bundling all 7 packages. One install in Claude Desktop / Cursor / any MCP host. Auto-detects which packages to enable from env vars.

Composition example: billing assistant

ar-agents-whatsapp-hello.vercel.app shows MP composing with identity, identity-attest, and whatsapp in a single agent. Validates CUIT against ARCA, gates large charges with verification (WhatsApp OTP), creates the MP subscription, replies on WhatsApp.

< $5kdirect charge, no verification$5k–$50krequires trust ≥ 0.3 (whatsapp_otp)$50k–$500krequires trust ≥ 0.5 (email_magic_link / mp_identity)> $500krequires trust ≥ 0.7 (auth0 with MFA → 0.85)