Openpay

Finance and commerce

MCP server for Openpay, BBVA-owned Mexican gateway (cards, SPEI, OXXO, subscriptions, payouts).

Your AI app calls the Openpay MCP server, which does the finance and commerce work and sends the result back to the chat.

About Openpay

Openpay is a community MCP server from codespar, filed in our directory under finance and commerce. MCP server for Openpay, BBVA-owned Mexican gateway (cards, SPEI, OXXO, subscriptions, payouts).

Openpay runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-openpay@0.2.2 and talks to it over standard input and output. It needs OPENPAY_MERCHANT_ID and OPENPAY_PRIVATE_KEY set before Openpay starts.

Openpay is listed in the official MCP registry as io.github.codespar/mcp-openpay, version 0.2.2.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-openpay
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-openpay

How to set up Openpay

  1. Install Node.js on the machine that runs your AI app, because Openpay starts with npx and downloads its package on first run.
  2. Create OPENPAY_MERCHANT_ID and OPENPAY_PRIVATE_KEY for Openpay in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Openpay to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Openpay tools to confirm the connection.
  5. Run one read-only task with Openpay first, and keep your app asking before each tool call until the results look right.

Openpay compared with similar servers

  • Pagar Me by codespar has fewer GitHub stars than Openpay (278 against 278); both are community servers, and both run locally.
  • Open Finance by codespar has fewer GitHub stars than Openpay (278 against 278); both are community servers, and both run locally.
  • Pagbrasil by codespar has fewer GitHub stars than Openpay (278 against 278); both are community servers, and both run locally.

Before you connect Openpay

  • Give Openpay its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Openpay tool call until you trust what it does with them.
  • Treat text that Openpay fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Openpay on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Openpay

How marketing and sales teams put Openpay to work, by company size. Pick the size closest to yours and start Openpay on one use case.

Small business

  • A small business can ask Openpay which products and customers drive margin, then plan promotions around them.
  • Owners can use Openpay to check refunds, failed payments and churn reasons without opening three dashboards.
  • Openpay runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Openpay to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Openpay to check spend against budget each week and move money to what's working.
  • Start Openpay on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Openpay read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Openpay to answer revenue questions by channel and region with figures finance signs off on.
  • Openpay is a community server, so have security review the code and pin a version before Openpay touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Openpay README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@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)

Tool Purpose
create_charge Create a charge.
get_charge Retrieve a charge.
capture_charge Capture a previously authorized charge (when the original charge used capture=false).
refund_charge Refund a captured charge.
create_customer Create a customer record.
get_customer Retrieve a customer by Openpay customer id.
list_customers List customers with optional filters.
create_card Tokenize a card.
delete_card Delete a tokenized card.
create_plan Create a subscription plan.
create_subscription Subscribe a customer to a plan.
create_payout Pay out MXN to a bank account.
update_customer Update a stored customer (PUT /customers/{id}).
delete_customer Delete a customer (DELETE /customers/{id}).
get_card Retrieve a tokenized card.
list_cards List tokenized cards.
create_bank_account Store a customer bank account (POST /customers/{customer_id}/bankaccounts).
delete_bank_account Delete a stored customer bank account (DELETE /customers/{customer_id}/bankaccounts/{id}).
cancel_subscription Cancel a customer's subscription (DELETE /customers/{customer_id}/subscriptions/{id}).
list_payouts List payouts.
create_webhook Register a webhook endpoint (POST /webhooks).
list_webhooks List configured webhook subscriptions (GET /webhooks).
delete_webhook Delete 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

Env Host
sandbox (default) https://sandbox-api.openpay.mx/v1/{merchant_id}
production https://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

Questions about Openpay

What is the Openpay MCP server?

MCP server for Openpay, BBVA-owned Mexican gateway (cards, SPEI, OXXO, subscriptions, payouts). Openpay is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Openpay MCP server?

Add Openpay to your AI app's MCP config with the command npx -y @codespar/mcp-openpay@0.2.2. In Claude Code, run claude mcp add --transport stdio codespar-openpay -- npx -y @codespar/mcp-openpay@0.2.2. To run Openpay this way you need Node.js installed.

Does Openpay need an API key?

Yes. Openpay expects OPENPAY_MERCHANT_ID and OPENPAY_PRIVATE_KEY to be set. Create the key for Openpay in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Openpay an official MCP server?

No. Openpay is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Openpay access to company data.

What license is Openpay under?

Openpay is released under the MIT license, according to its GitHub repository. The license covers the code of Openpay; the service it connects to has its own terms.