mcpField
M
mcp-openpay

mcp-openpay

Local
github.com/codesparFinance275Updated 4w ago

About mcp-openpay

mcp-openpay is an MCP server for Openpay, the Mexican payment gateway owned by BBVA. It targets Mexican online merchants and agents, covering cards, SPEI and OXXO payment rails.

Key features

  1. 0123 tools for charges, customers, cards and refunds
  2. 02Native subscriptions with plans and recurring billing
  3. 03Payouts of MXN to bank accounts
  4. 04Webhook registration, listing and deletion
  5. 05Sandbox and production environment switching

Use cases

  1. 01Creating charges and refunds for a Mexican e-commerce agent
  2. 02Managing customer subscriptions and recurring billing
  3. 03Sending MXN payouts to bank accounts

MCP support

As an MCP server, it exposes Openpay charge, customer, subscription, payout and webhook operations as tools to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-openpay": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-openpay"
],
"env": {
"OPENPAY_MERCHANT_ID": "<OPENPAY_MERCHANT_ID>",
"OPENPAY_PRIVATE_KEY": "<OPENPAY_PRIVATE_KEY>",
"OPENPAY_ENV": "<OPENPAY_ENV>"
}
}
}
}
Run commandnpx -y @codespar/mcp-openpay
Environment variables to set
OPENPAY_MERCHANT_IDOpenpay merchant id (forms part of the API URL path)
OPENPAY_PRIVATE_KEYSecretOpenpay private API key (used as HTTP Basic auth username with empty password)
OPENPAY_ENVEnvironment: 'sandbox' (default) or 'production'. Selects between https://sandbox-api.openpay.mx and https://api.openpay.mx.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-openpay0.2.2

Tools

23

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
cardobjectNoInline card object for method='card' when not using source_id. Alternatively pass source_id from a tokenized card.
amountnumberYesAmount in major units (MXN).
methodenumYesPayment method: card, bank_account (SPEI), or store (OXXO).card | bank_account | store
capturebooleanNoIf false, only authorizes — use capture_charge later. Defaults to true.
currencystringNoISO-4217 currency code. Defaults to MXN.
customerobjectNoCustomer identity for one-off (merchant-scope) charges. Not required when customer_id is set.
customer.namestringNo
customer.emailstringNo
customer.last_namestringNo
customer.phone_numberstringNo
customer.requires_accountbooleanNoIf true, Openpay creates a wallet account for the customer.
due_datestringNoFor store (OXXO) / bank_account (SPEI) charges, ISO-8601 expiration.
order_idstringNoMerchant-side unique order reference.
source_idstringNoCard or token id when method='card'. Required for card charges unless 'card' inline object is provided.
send_emailbooleanNoFor store (OXXO) charges, email the voucher to the customer.
customer_idstringNoOptional. Openpay customer id to scope the charge to a stored customer.
descriptionstringNoCharge description shown on receipts.
redirect_urlstringNoFor 3DS / redirect flows, where to return the buyer after auth.
use_3d_securebooleanNoForce 3DS for card charges.
device_session_idstringNoDevice session id from Openpay antifraud JS (required for card charges in production).

Details

From the project README

@codespar/mcp-openpay

MCP server for Openpay — the BBVA-owned Mexican payment gateway.

Openpay is the main BBVA-backed alternative to Conekta for Mexican online merchants. Adding it to the catalog alongside @codespar/mcp-conekta closes the "big two" MX gateway story and opens the BBVA rails (SPEI, OXXO, domestic cards) to agents. Differentiators in this catalog: native subscriptions (plans + per-customer recurring billing) and marketplace payouts.

Tools (23)

ToolPurpose
create_chargeCreate a charge.
get_chargeRetrieve a charge.
capture_chargeCapture a previously authorized charge (when the original charge used capture=false).
refund_chargeRefund a captured charge.
create_customerCreate a customer record.
get_customerRetrieve a customer by Openpay customer id.
list_customersList customers with optional filters.
create_cardTokenize a card.
delete_cardDelete a tokenized card.
create_planCreate a subscription plan.
create_subscriptionSubscribe a customer to a plan.
create_payoutPay out MXN to a bank account.
update_customerUpdate a stored customer (PUT /customers/{id}).
delete_customerDelete a customer (DELETE /customers/{id}).
get_cardRetrieve a tokenized card.
list_cardsList tokenized cards.
create_bank_accountStore a customer bank account (POST /customers/{customer_id}/bankaccounts).
delete_bank_accountDelete a stored customer bank account (DELETE /customers/{customer_id}/bankaccounts/{id}).
cancel_subscriptionCancel a customer's subscription (DELETE /customers/{customer_id}/subscriptions/{id}).
list_payoutsList payouts.
create_webhookRegister a webhook endpoint (POST /webhooks).
list_webhooksList configured webhook subscriptions (GET /webhooks).
delete_webhookDelete a webhook subscription (DELETE /webhooks/{id}).

Install

npm install @codespar/mcp-openpay

Environment

OPENPAY_MERCHANT_ID="..."  # merchant id (part of the API URL path)
OPENPAY_PRIVATE_KEY="..."  # private API key — secret
OPENPAY_ENV="sandbox"      # 'sandbox' (default) | 'production'

Authentication

HTTP Basic. The private key is the username, and the password is empty:

Authorization: Basic base64(OPENPAY_PRIVATE_KEY + ":")
Content-Type: application/json

The server handles the Base64 encoding automatically — you only configure the three env vars.

Base URLs

EnvHost
sandbox (default)https://sandbox-api.openpay.mx/v1/{merchant_id}
productionhttps://api.openpay.mx/v1/{merchant_id}

Run

# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-openpay

# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-openpay

Scoping notes

Several Openpay resources can be addressed at either merchant scope or customer scope. The tools expose this via an optional customer_id parameter:

  • create_charge, get_charge, capture_charge, refund_charge — routed to /customers/{customer_id}/... when customer_id is set, else /....
  • create_card, delete_card — same pattern.
  • create_payout — customer-scoped payout requires the customer to have requires_account=true.
  • create_subscription — customer scope is required by the API (plans are merchant-scoped; subscriptions are always per-customer).

PCI scope

Prefer client-side tokenization with Openpay.js and pass the resulting token_id / source_id to the server. Only send raw PANs/CVVs server-side if you are PCI-DSS compliant.

Docs

https://documents.openpay.mx/en/api

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.