Skip to main content
OP

Openpay

v0.2.1API Key

Gateway mexicano do BBVA — a alternativa MX à Conekta. Cartões, OXXO, SPEI, assinaturas (nativas), payouts de marketplace. Fecha a história das trilhas BBVA pro México.

23 ferramentas3 env vars🇲🇽 Méxicoestável no npm

O que seu agente faz

O Openpay dá ao seu agente 23 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer cliente MCP.

  • create_chargeCreate 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_chargeRetrieve a charge. Pass customer_id to fetch at customer scope (GET /customers/{customer_id}/charges/{id}); omit for merchant scope (GET /charges/{id}).
  • capture_chargeCapture 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.
Exemplo de chamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_charge", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-openpay

Quickstart

Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "openpay": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-openpay"
      ],
      "env": {
        "OPENPAY_MERCHANT_ID": "<your_openpay_merchant_id>",
        "OPENPAY_PRIVATE_KEY": "<your_openpay_private_key>"
      }
    }
  }
}

Depois de reiniciar, seu agente pode chamar qualquer uma das 23 ferramentas abaixo — teste create_charge primeiro.

Variáveis de ambiente · 3

Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.

OPENPAY_MERCHANT_ID
obrigatório

Openpay merchant id (forms part of the API URL path)

OPENPAY_PRIVATE_KEY
obrigatóriosecret

Openpay private API key (used as HTTP Basic auth username with empty password)

OPENPAY_ENV
opcional

Environment: 'sandbox' (default) or 'production'. Selects between https://sandbox-api.openpay.mx and https://api.openpay.mx.

Ferramentas disponíveis · 23

Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.

WRITEcreate_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).
WRITEget_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}).
WRITEcapture_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.
DELETErefund_charge
Refund a captured charge. Supports partial refunds via amount; omit amount for a full refund.
WRITEcreate_customer
Create a customer record. Set requires_account=true to create an associated Openpay wallet for the customer; false for a payment-only record.
READget_customer
Retrieve a customer by Openpay customer id.
READlist_customers
List customers with optional filters. All parameters are passed as query params.
WRITEcreate_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.

Frameworks compatíveis

MCP é um protocolo — qualquer framework que o fale pode montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Qualquer cliente MCPProtocolo

Perguntas frequentes

Rode `npx -y @codespar/mcp-openpay` e adicione o bloco de config acima ao seu cliente MCP — Claude, Cursor, VS Code ou qualquer cliente compatível com MCP. Sem build, sem SDK. Prefere hospedado? O tier gerenciado da CodeSpar roda pra você, com a auth resolvida.
Openpay — MCP server · 23 tools | CodeSpar