PluginBench
MCP Server
Active
MIT

io.github.codespar/mcp-x402 MCP Server

io.github.codespar/mcp-x402

HTTP-native micropayments protocol by Coinbase — agents pay USDC on Base/Solana via 402 responses.

What is the io.github.codespar/mcp-x402 MCP server?

The x402 MCP server is Coinbase's HTTP-native micropayments protocol that enables AI agents to handle payment-gated APIs. When an agent receives an HTTP 402 Payment Required response, it can automatically pay small amounts of USDC on Base or Solana and retry the request without user intervention.

x402 bridges the gap between APIs that require micropayments and autonomous agents. Instead of traditional checkout flows, it uses HTTP status codes and headers to signal payment requirements, allowing agents to pay fractions of a cent for data or services on-chain. This is part of the emerging agentic payment stack alongside Stripe ACP, Google UCP, and AP2.

How to install io.github.codespar/mcp-x402

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • X402_API_KEY
    required
    secret

    API key for x402

Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mcp-x402": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-x402"
      ],
      "env": {
        "X402_API_KEY": "<YOUR_X402_API_KEY>"
      }
    }
  }
}
Cursor
~/.cursor/mcp.json
{
  "mcpServers": {
    "mcp-x402": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-x402"
      ],
      "env": {
        "X402_API_KEY": "<YOUR_X402_API_KEY>"
      }
    }
  }
}
Windsurf
~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mcp-x402": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-x402"
      ],
      "env": {
        "X402_API_KEY": "<YOUR_X402_API_KEY>"
      }
    }
  }
}
VS Code
.vscode/mcp.json
{
  "servers": {
    "mcp-x402": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-x402"
      ],
      "env": {
        "X402_API_KEY": "<YOUR_X402_API_KEY>"
      }
    }
  }
}
Claude Code
claude mcp add mcp-x402 --env X402_API_KEY=<YOUR_X402_API_KEY> -- npx -y @codespar/mcp-x402

Tools & capabilities

Tools this server exposes to the agent.

  • pay_requestInitiate a payment request for a micropayment
  • retry_with_paymentRetry a failed request after paying the required amount
  • check_payment_statusVerify the status of a micropayment
  • get_payment_detailsRetrieve details about a specific payment
  • list_paymentsList all micropayments made by the agent
  • set_payment_limitConfigure spending limits for autonomous payments
  • get_balanceCheck USDC balance on Base or Solana
  • transfer_usdcTransfer USDC between wallets
  • get_supported_chainsList supported blockchains (Base, Solana)
  • decode_402_responseParse HTTP 402 headers to extract payment requirements

Use cases

  • Enable agents to access premium APIs that require micropayments without human approval
  • Automate payment for small data queries or API calls (e.g., $0.001 per lookup)
  • Create machine-to-machine payment flows where agents pay each other for services
  • Build autonomous systems that can purchase compute or data on-demand
  • Implement pay-per-use models for agent-accessible APIs

io.github.codespar/mcp-x402 MCP server FAQ

What is x402?

x402 is Coinbase's HTTP-native micropayments protocol. When an API returns HTTP 402 (Payment Required), agents can automatically pay USDC on Base or Solana and retry. No checkout UI, no human confirmation — pure HTTP.

Is x402 free to use?

The protocol itself is free. You pay only for the USDC micropayments you send (typically fractions of a cent). You'll need USDC on Base or Solana to fund agent payments.

How do I install this in Claude or Cursor?

Install via npm: `npx @codespar/mcp-x402`. Add to your MCP config with any required environment variables (wallet keys, RPC endpoints). See the repository for detailed setup instructions.

What blockchains does x402 support?

x402 supports USDC on Base (Coinbase's L2) and Solana. Both offer low transaction costs ideal for micropayments.

Do I need authentication?

You need a funded wallet with USDC on Base or Solana. Authentication depends on your wallet setup (private keys, wallet provider, etc.).

How does x402 fit with other agentic payment protocols?

x402 is fully autonomous (no user confirmation). Stripe ACP and Google UCP require user approval in chat. AP2 adds authorization layers and spend limits. x402 is best for API-level micropayments; the others for commerce workflows.

README (reference)

Source of truth, from the repository.

<p align="center"> <h1 align="center">MCP Dev LATAM 🌎</h1> <p align="center"> <strong>Every commerce API your AI agent needs to run a business in Latin America.</strong><br> <em>Brazil 🇧🇷 · Mexico 🇲🇽 · Argentina 🇦🇷 · Colombia 🇨🇴 · Chile 🇨🇱 · Peru 🇵🇪 · plus 4 agentic payment protocols.</em> </p> <p align="center"> 110 MCP servers · 2,300 tools · 6 countries · MIT License </p> <p align="center"> <a href="https://codespar.dev/servers">Catalog</a> · <a href="#quick-start">Quick Start</a> · <a href="#agentic-payment-protocols">Agentic Protocols</a> · <a href="#all-servers">All Servers</a> · <a href="docs/CONTRIBUTING.md">Contribute</a> </p> <p align="center"> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a> <img src="https://img.shields.io/badge/servers-110-green" alt="110 servers"> <img src="https://img.shields.io/badge/tools-2,300-orange" alt="2300 tools"> <img src="https://img.shields.io/badge/countries-6-blue" alt="6 countries"> <img src="https://img.shields.io/badge/MCP-compatible-purple" alt="MCP compatible"> </p> </p>

The Problem

AI agents can write code, analyze data, and chat. But they can't operate a business — collect payments, issue invoices, ship products, or notify customers. Especially not in Latin America, where every service has its own API, auth pattern, and quirks (mTLS for BACEN Pix v2, JWT-RSA for STP-SPEI, AFIP web services, contract-gated developer portals, and on).

Meanwhile, four agentic payment protocols are shipping in parallel — checkout protocols (Stripe ACP, Google UCP), authorization layers (AP2), and micropayment rails (x402) — and none of them compose cleanly with each other or with the regional rails businesses actually run on.

MCP Dev LATAM bridges both gaps. Traditional LATAM services + the new agentic payment protocols, all accessible through a single MCP interface.

The Solution

Each MCP server in this repo wraps a real provider — payments, fiscal, logistics, messaging, banking, ERP, identity, fraud, crypto, and the agentic protocols — so your agent can operate a complete business workflow.

🛒 Customer places order
  → 💳 Agent charges via Pix (Asaas / Mercado Pago / Zoop)
  → 📄 Agent issues NFe (Nuvem Fiscal / Focus NFe / NFe.io)
  → 📦 Agent generates shipping label (Melhor Envio / Skydropx)
  → 📱 Agent sends tracking via WhatsApp (Z-API / WhatsApp Cloud)
  → 📊 Agent records in ERP (Omie / Bling / Tiny)
  → 🏦 Agent reconciles balance (Stark Bank / Itaú / BTG)

Six systems. Zero human intervention. One agent.


Agentic Payment Protocols

Four servers that bridge the emerging agentic payment stack:

ProtocolServerToolsWhat it does
Google UCP@codespar/mcp-ucp20Universal Commerce Protocol — agentic shopping, cart, checkout, orders, delivery, identity. Google's full commerce stack for AI agents.
Stripe ACP@codespar/mcp-stripe-acp24Agentic Commerce Protocol — AI agent checkout, payment delegation, products, invoices. Live in ChatGPT with 1M+ Shopify merchants.
x402@codespar/mcp-x40210HTTP-native micropayments by Coinbase — when an agent hits a 402, it pays USDC on Base/Solana and retries. Pure HTTP, no checkout UI.
AP2@codespar/mcp-ap2 <sub>alpha</sub>22Google's Agent-to-Agent Payment Protocol — authorization, audit trails, scoped spend limits. 60+ partners including Visa, Mastercard, Stripe, PayPal.

The Autonomy Spectrum

Each protocol sits at a different level of agent autonomy:

 Human-in-loop ◄──────────────────────────────► Fully autonomous

  ┌─────────┐   ┌─────────┐   ┌─────────┐   ┌─────────┐
  │   ACP   │   │   UCP   │   │   AP2   │   │   x402  │
  │ Stripe  │   │ Google  │   │ Google  │   │Coinbase │
  └─────────┘   └─────────┘   └─────────┘   └─────────┘
  User confirms   Commerce     User sets      No user.
  every purchase  lifecycle    rules, agent   Machine-to-
  in-chat         managed      acts within    machine at
                  by agent     budget/scope   HTTP layer

The Convergence Stack

┌─────────────────────────────────────────────┐
│  Application Layer        ACP / UCP         │  Chat UX, product discovery
├─────────────────────────────────────────────┤
│  Authorization Layer      AP2 / Mandates    │  Spend limits, audit trails
├─────────────────────────────────────────────┤
│  Tool Layer               MCP  ◄── WE ARE  │  Standardized agent tools
├─────────────────────────────────────────────┤
│  Settlement Layer         x402 / Pix / Card │  On-chain or traditional rails
└─────────────────────────────────────────────┘

MCP Dev LATAM sits at the Tool Layer — the middleware that connects every application, authorization, and settlement protocol through one interface.

Why this matters

Agent needs to buy something
  ├── Full commerce?       → Google UCP (search → cart → checkout → delivery)
  ├── Retail checkout?     → Stripe ACP (create_checkout → complete_checkout)
  ├── API micropayment?    → x402 (pay_request → USDC $0.001 → data returned)
  ├── Agent-to-agent?      → AP2 (authorize_payment → execute_payment)
  └── LATAM merchant?      → Asaas / Mercado Pago / Conekta / Wompi / etc.

All via MCP. Same interface. One agent.

Quick Start

With Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "stripe-acp": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-stripe-acp"],
      "env": {
        "STRIPE_API_KEY": "sk_test_..."
      }
    },
    "asaas": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-asaas"],
      "env": {
        "ASAAS_API_KEY": "your-api-key",
        "ASAAS_SANDBOX": "true"
      }
    }
  }
}

For alpha packages (contract-gated providers like Itaú, Bradesco, Santander, Caixa, BB, BTG, C6, Sicoob, Bradesco, Matera), add @alpha to the install:

npx -y @codespar/mcp-itau@alpha

With any MCP client

npx @codespar/mcp-stripe-acp        # Agentic Commerce Protocol
npx @codespar/mcp-ucp                # Google Universal Commerce Protocol
npx @codespar/mcp-x402               # HTTP micropayments (Coinbase)
npx @codespar/mcp-ap2@alpha          # Agent-to-Agent payment authorization

npx @codespar/mcp-asaas              # BR billing + Pix
npx @codespar/mcp-mercado-pago       # LATAM payments
npx @codespar/mcp-nuvem-fiscal       # NFe / NFSe
npx @codespar/mcp-melhor-envio       # Multi-carrier shipping
npx @codespar/mcp-z-api              # WhatsApp messaging
npx @codespar/mcp-omie               # ERP
npx @codespar/mcp-stark-bank         # Banking
npx @codespar/mcp-brasil-api         # CEP, CNPJ (no key needed!)

Try it now (no API key)

BrasilAPI and BCRA are public — no key required. Try it in your terminal:

npx @codespar/mcp-brasil-api

Then ask your agent: "What is the address for CEP 01001-000?" or "Look up CNPJ 00.000.000/0001-91".


The Complete Loop

This is what makes the LATAM catalog different — not individual connectors, but a complete business workflow across verticals:

StepVerticalExample providersWhat the agent does
1💳 PaymentAsaas / Mercado Pago / ZoopCreates Pix charge, splits to sellers
2📄 FiscalNuvem Fiscal / NFe.io / Focus NFeIssues NFe/NFSe when payment confirmed
3📦 LogisticsMelhor Envio / Correios / SkydropxQuotes shipping, generates label
4📱 MessagingZ-API / WhatsApp Cloud / TwilioSends tracking via customer's preferred channel
5📊 ERPOmie / Bling / Tiny / Conta AzulRecords order, updates inventory
6🏦 BankingStark Bank / Itaú / BTGReconciles balance, creates reports

To orchestrate all six steps with governance, approval workflows, and audit trails — use CodeSpar.


All Servers

Browse the full catalog at codespar.dev/servers. Each server has its own README, env-var requirements, and tool reference under packages/<category>/<slug>/.

💳 Payments (40 servers)

ServerToolsnpmAuth
Mercado Pago30@codespar/mcp-mercado-pagoAPI Key
Stripe30@codespar/mcp-stripeAPI Key
Zoop28@codespar/mcp-zoopAPI Key
Adyen25@codespar/mcp-adyenAPI Key
Asaas24@codespar/mcp-asaasAPI Key
Pagseguro24@codespar/mcp-pagseguroAPI Key
Stripe ACP24@codespar/mcp-stripe-acpAPI Key
Iugu23@codespar/mcp-iuguAPI Key
Openpay23@codespar/mcp-openpayAPI Key
AP2 <sub>alpha</sub>22@codespar/mcp-ap2API Key
Braintree22@codespar/mcp-braintreeAPI Key
Braspag22@codespar/mcp-braspagAPI Key
Cielo22@codespar/mcp-cieloAPI Key
Inter Bank22@codespar/mcp-inter-bankOAuth2
Mercado Libre22@codespar/mcp-mercado-libreAPI Key
Nubank <sub>alpha</sub>22@codespar/mcp-nubankOAuth2
Nupay22@codespar/mcp-nupayOAuth2
Pagar Me22@codespar/mcp-pagar-meAPI Key
Rapyd22@codespar/mcp-rapydAPI Key
Rede <sub>alpha</sub>22@codespar/mcp-redeAPI Key
Safrapay <sub>alpha</sub>22@codespar/mcp-safrapayOAuth2
Worldpay <sub>alpha</sub>22@codespar/mcp-worldpayAPI Key
Khipu <sub>alpha</sub>21@codespar/mcp-khipuAPI Key
Stone21@codespar/mcp-stoneAPI Key
Wise21@codespar/mcp-wiseAPI Key
Airwallex20@codespar/mcp-airwallexOAuth2
Culqi20@codespar/mcp-culqiAPI Key
Getnet20@codespar/mcp-getnetOAuth2
Izipay <sub>alpha</sub>20@codespar/mcp-izipayAPI Key
Picpay <sub>alpha</sub>20@codespar/mcp-picpayAPI Key
UCP20@codespar/mcp-ucpAPI Key
Vindi20@codespar/mcp-vindiAPI Key
Paypal19@codespar/mcp-paypalOAuth2
Transbank <sub>alpha</sub>19@codespar/mcp-transbankAPI Key
Celcoin18@codespar/mcp-celcoinAPI Key
dLocal18@codespar/mcp-dlocalAPI Key
Ebanx18@codespar/mcp-ebanxAPI Key
Efi18@codespar/mcp-efiAPI Key
Pix BCB18@codespar/mcp-pix-bcbAPI Key
Chargebee15@codespar/mcp-chargebeeAPI Key

🏦 Banking (12 servers)

ServerToolsnpmAuth
Stark Bank27@codespar/mcp-stark-bankAPI Key
Caixa <sub>alpha</sub>23@codespar/mcp-caixaOAuth2
Santander <sub>alpha</sub>23@codespar/mcp-santanderOAuth2
Bradesco <sub>alpha</sub>22@codespar/mcp-bradescoOAuth2
Itau <sub>alpha</sub>22@codespar/mcp-itauOAuth2
Matera <sub>alpha</sub>22@codespar/mcp-materaOAuth2
Dock <sub>alpha</sub>20@codespar/mcp-dockOAuth2
Open Finance18@codespar/mcp-open-financeAPI Key
C6 <sub>alpha</sub>14@codespar/mcp-c6OAuth2
Banco Do Brasil <sub>alpha</sub>13@codespar/mcp-banco-do-brasilOAuth2
Sicoob <sub>alpha</sub>13@codespar/mcp-sicoobOAuth2
BTG <sub>alpha</sub>12@codespar/mcp-btgOAuth2

📄 Fiscal (Brasil) (4 servers)

ServerToolsnpmAuth
Nuvem Fiscal24@codespar/mcp-nuvem-fiscalAPI Key
Nfe Io22@codespar/mcp-nfe-ioAPI Key
Conta Azul20@codespar/mcp-conta-azulAPI Key
Focus Nfe19@codespar/mcp-focus-nfeAPI Key

📱 Communication (8 servers)

ServerToolsnpmAuth
Z API27@codespar/mcp-z-apiAPI Key
Evolution API25@codespar/mcp-evolution-apiAPI Key
Twilio22@codespar/mcp-twilioAPI Key
Whatsapp Cloud22@codespar/mcp-whatsapp-cloudAPI Key
Sendgrid20@codespar/mcp-sendgridAPI Key
Rd Station18@codespar/mcp-rd-stationAPI Key
Take Blip18@codespar/mcp-take-blipAPI Key
Zenvia18@codespar/mcp-zenviaAPI Key

📦 E-commerce / Logistics (7 servers)

ServerToolsnpmAuth
Vtex33@codespar/mcp-vtexAPI Key
Shopify28@codespar/mcp-shopifyAPI Key
Amazon <sub>alpha</sub>24@codespar/mcp-amazonOAuth2
Shopee <sub>alpha</sub>22@codespar/mcp-shopeeAPI Key
Correios <sub>alpha</sub>21@codespar/mcp-correiosAPI Key
Melhor Envio18@codespar/mcp-melhor-envioAPI Key
SuperFrete11@codespar/mcp-superfreteAPI Key

📊 ERP / Accounting (5 servers)

ServerToolsnpmAuth
Omie30@codespar/mcp-omieAPI Key
Bling28@codespar/mcp-blingAPI Key
Xero24@codespar/mcp-xeroAPI Key
Quickbooks22@codespar/mcp-quickbooksAPI Key
Tiny21@codespar/mcp-tinyAPI Key

🪪 Identity & KYC (5 servers)

ServerToolsnpmAuth
Brasil API24@codespar/mcp-brasil-apiNo auth
Jumio20@codespar/mcp-jumioAPI Key
Onfido20@codespar/mcp-onfidoAPI Key
Persona20@codespar/mcp-personaAPI Key
Unico <sub>alpha</sub>18@codespar/mcp-unicoOAuth2

🛡️ Fraud & Risk (4 servers)

ServerToolsnpmAuth
Sift <sub>alpha</sub>20@codespar/mcp-siftAPI Key
Clearsale <sub>alpha</sub>18@codespar/mcp-clearsaleAPI Key
Konduto <sub>alpha</sub>18@codespar/mcp-kondutoAPI Key
Legiti <sub>alpha</sub>18@codespar/mcp-legitiAPI Key

🪙 Crypto / Stablecoins (9 servers)

ServerToolsnpmAuth
Circle23@codespar/mcp-circleAPI Key
Foxbit21@codespar/mcp-foxbitAPI Key
Bitso20@codespar/mcp-bitsoAPI Key
Mercado Bitcoin20@codespar/mcp-mercado-bitcoinAPI Key
Moonpay20@codespar/mcp-moonpayAPI Key
Unblockpay13@codespar/mcp-unblockpayAPI Key
Coinbase Commerce18@codespar/mcp-coinbase-commerceAPI Key
Transak <sub>alpha</sub>18@codespar/mcp-transakAPI Key
x40210@codespar/mcp-x402API Key

🇦🇷 Argentina (5 servers)

ServerToolsnpmAuth
Tienda Nube24@codespar/mcp-tienda-nubeAPI Key
Colppy <sub>alpha</sub>22@codespar/mcp-colppyAPI Key
AFIP <sub>alpha</sub>20@codespar/mcp-afipAPI Key
Andreani <sub>alpha</sub>18@codespar/mcp-andreaniAPI Key
BCRA16@codespar/mcp-bcraNo auth

🇨🇴 Colombia (5 servers)

ServerToolsnpmAuth
Siigo22@codespar/mcp-siigoAPI Key
Wompi22@codespar/mcp-wompiAPI Key
Alegra20@codespar/mcp-alegraAPI Key
Coordinadora <sub>alpha</sub>19@codespar/mcp-coordinadoraAPI Key
Nequi <sub>alpha</sub>16@codespar/mcp-nequiOAuth2

🇲🇽 Mexico (6 servers)

ServerToolsnpmAuth
Belvo24@codespar/mcp-belvoAPI Key
Skydropx23@codespar/mcp-skydropxAPI Key
Conekta21@codespar/mcp-conektaAPI Key
Bind ERP20@codespar/mcp-bind-erpAPI Key
Facturapi20@codespar/mcp-facturapiAPI Key
STP/SPEI <sub>alpha</sub>18@codespar/mcp-stp-speiAPI Key

Why MCP?

Model Context Protocol is the open standard for connecting AI agents to external tools. Instead of each agent building its own integrations, MCP provides a typed, discoverable interface that works with Claude, ChatGPT, Cursor, VS Code, and more.

AI Agent (Claude, ChatGPT, Cursor)
    ↕
MCP Server (this repo)
    ↕
LATAM API / Agentic Protocol (Stripe ACP, x402, Asaas, Mercado Pago, NFe.io, etc.)

Each MCP server in this repo:

  • Exposes typed tools with input/output schemas
  • Handles authentication (OAuth, mTLS, API keys, Basic Auth, JWT-RSA, signed requests)
  • Supports dual transport — stdio (default) and Streamable HTTP (--http flag)
  • Compatible with Claude Managed Agents via MCP Connector
  • Supports sandbox mode for safe testing
  • Returns structured JSON responses

Running in HTTP mode

Any server can run as an HTTP server for remote/cloud use:

# stdio (default — local, Claude Desktop, Cursor, Claude Code)
npx @codespar/mcp-asaas

# HTTP (remote — Managed Agents, cloud deployments)
npx @codespar/mcp-asaas --http
# or
MCP_HTTP=true npx @codespar/mcp-asaas

HTTP mode exposes /mcp (Streamable HTTP) and /health (status check).


Alpha vs stable

About a third of the catalog ships under the alpha npm dist-tag. These packages have correct tool schemas and auth flow, but the endpoint paths are best-guesses — typically because the provider's developer portal is contract-gated (BR public banks, AR central authority APIs, MX bank-transfer providers). They're flagged with TODO(verify) in source.

npm install @codespar/mcp-itau@alpha

Stable packages (the majority) install with the default tag:

npm install @codespar/mcp-stripe

Status is shown on every package page at codespar.dev/servers and in each package README.


About CodeSpar

CodeSpar builds commerce infrastructure for AI agents in Latin America — an MCP catalog (this repo), a runtime + SDK (@codespar/sdk on npm, codespar on PyPI), and a managed-tier governance product (AgentGate: programmable wallet, policy engine, CFO-grade audit, fiscal-compliance certifications).

Individual MCP servers are useful. Orchestrating many with governance is powerful. That's what CodeSpar does.


Contributing

We welcome contributions. See CONTRIBUTING.md.

Want a server for a service not listed? Open a server-request issue — there's a structured form with name, npm package, docs link, auth flow.

License

MIT — use freely in commercial and open source projects.

Related MCP servers

Give AI agents access to Adyen's Checkout API v71 for enterprise payment processing in LatAm.

257
JavaScript
MIT
View repository →

AI agent access to AFIP's Argentine electronic invoicing (Factura Electrónica) system.

257
JavaScript
MIT
View repository →

MCP server for Airwallex — cross-border collection, payouts, global accounts, FX, and transfers.

257
JavaScript
MIT
View repository →

Give AI agents access to Alegra's cloud accounting platform for LATAM invoicing and bookkeeping.

257
JavaScript
MIT
View repository →

Give your AI agent tools to manage Amazon orders, listings, catalog, inventory, and finances via SP-API.

257
JavaScript
MIT
View repository →

Connect AI agents to Andreani, Argentina's courier and logistics network.

257
JavaScript
MIT
View repository →