Skip to main content
O

Openpay

@codespar/mcp-openpay Β· v0.2.2

πŸ‡²πŸ‡½ MexicoPaymentsAuth Β· API Keybeta23 tools3 env vars

BBVA-owned Mexican gateway β€” the MX alternative to Conekta. Cards, OXXO, SPEI, subscriptions (native), marketplace payouts. Closes the BBVA-rail story for Mexico.

Get started Β· freeView docs

MIT Β· runs locally with your own credentials

Package
@codespar/mcp-openpay
Version
0.2.2
npm dist-tag
latest
Category
Payments
Auth
API Key
Country
πŸ‡²πŸ‡½ Mexico
License
MIT
Transport
stdio Β· streamable-http

Quickstart

Install, set the credentials, make the first call.

Pick your client. The server runs locally over stdio, with your own credentials.

Add the server to your clientOne config entry. No build step, no SDK required.
Set the environment variables3 variables read by this server's code, listed below.
Restart and make the first callThe agent can call any of the 23 tools. Try create_charge first.
terminal
# Claude Code claude mcp add openpay -e OPENPAY_ENV=… -e OPENPAY_MERCHANT_ID=… -e OPENPAY_PRIVATE_KEY=… -- npx -y @codespar/mcp-openpay@0.2.2 # then: /mcp to confirm the server is connected
Environment variables3 variables
OPENPAY_ENVEnvironment: 'sandbox' (default) or 'production'. Selects between https://sandbox-api.openpay.mx and https://api.openpay.mx.optional
OPENPAY_MERCHANT_IDOpenpay merchant id (forms part of the API URL path)required
OPENPAY_PRIVATE_KEYOpenpay private API key (used as HTTP Basic auth username with empty password)requiredsecret

Names read from the package code (@codespar/mcp-openpay@0.2.2). Descriptions and flags come from its manifest. Self-hosted, you hold the credentials.

First call democreate_charge

"Create a charge. Pass customer_id to charge at a customer scope"

tools/callcreate_chargeresult returned

Tools

What your agent can call.

23 tools, as the package's tools/list returns them.

create_charge

Create a charge. Pass customer_id to charge at a customer scope (POST /customers/{customer_id}/charges); omit to charge at merchant scope (POST /charges). Methods: 'card' (requires source_id token), 'bank_account' (SPEI β€” returns CLABE reference), 'store' (OXXO β€” returns barcode/reference). Amounts are in major units (e.g. 100 = 100 MXN).

get_charge

Retrieve a charge. Pass customer_id to fetch at customer scope (GET /customers/{customer_id}/charges/{id}); omit for merchant scope (GET /charges/{id}).

capture_charge

Capture a previously authorized charge (when the original charge used capture=false). Pass amount to capture less than the authorized total; omit to capture the full authorized amount.

refund_charge

Refund a captured charge. Supports partial refunds via amount; omit amount for a full refund.

create_customer

Create a customer record. Set requires_account=true to create an associated Openpay wallet for the customer; false for a payment-only record.

get_customer

Retrieve a customer by Openpay customer id.

list_customers

List customers with optional filters. All parameters are passed as query params.

create_card

Tokenize a card. Pass customer_id to attach to a stored customer (POST /customers/{customer_id}/cards); omit for a merchant-level token (POST /cards). Prefer tokenizing client-side with Openpay.js to avoid PCI scope.

delete_card

Delete a tokenized card. Pass customer_id to delete at customer scope (DELETE /customers/{customer_id}/cards/{id}); omit for merchant scope (DELETE /cards/{id}).

create_plan

Create a subscription plan. Plans are templates β€” use create_subscription to subscribe a customer.

create_subscription

Subscribe a customer to a plan. Requires a stored card (source_id) to charge on each cycle.

create_payout

Pay out MXN to a bank account. Used for marketplace seller payouts and cross-border settlement. Scope to a customer with customer_id (POST /customers/{customer_id}/payouts) or run at merchant scope (POST /payouts).

Names and descriptions come from the package's tools/list (@codespar/mcp-openpay@0.2.2). A kind (read, write, delete) is shown only when the package annotates its tools or each tool was verified one by one; neither exists for this server yet.

Compatibility

MCP is a protocol. Any client that speaks it can mount this server.

The CodeSpar runtime does not route this server. Mount it in your client over stdio Β· streamable-http.

Protocol

Any MCP client

stdio Β· streamable-http

Questions

Before you install.

How do I install the Openpay MCP server?

Run npx -y @codespar/mcp-openpay@0.2.2 and add the config block above to your MCP client: Claude Code, Cursor, Claude Desktop, VS Code, or any MCP-compatible client. No build step, no SDK required.

What can my agent do with Openpay?

Openpay exposes 23 tools for payments. Your agent calls them directly; the full list is above.

How does Openpay authenticate, and how are credentials stored?

Openpay uses API Key. Self-hosted, you hold the credentials: the server reads them from its environment variables.

How does Openpay handle upstream API changes?

Every server is versioned independently on npm. The command on this page pins 0.2.2, the version whose tools are listed here; your agent keeps running it until you change the version.

Is Openpay open source? How do I report a bug?

Yes. Openpay is MIT-licensed and published on npm as @codespar/mcp-openpay, source on GitHub (link in the Details panel). Report issues on the package repository; security issues go to security@codespar.dev, and we respond within 24 hours.

Start in seconds.

Add the config above, set the variables, and your agent calls the tools.

Start in seconds demo
Add the server to your client with the config above.
Set the environment variables listed above.
Ask your agent for the first call.
Openpay β€” MCP server Β· 23 tools | CodeSpar