Skip to main content
SA

Safrapay

v0.2.0-alpha.2API Keyalpha

Adquirente del Banco Safra — segmento premium/enterprise de private banking. Opera sobre la plataforma de pagos de Aditum. Autorizar/capturar/cancelar, Pix, boleto, tokenización, split, estados de cuenta digitales. Alpha en npm — recipe de auth BCRYPT y casing del body pendientes de validación en sandbox.

22 herramientas4 env vars🇧🇷 Brasilalpha — validación pendiente

Qué puede hacer tu agente

Safrapay le da a tu agente 22 tools que llama directo — elegí las que necesite, en Claude, Cursor o cualquier cliente MCP.

  • authorize_paymentAuthorize a credit-card payment on Safrapay. Set preauth=true to authorize only (use capture_payment later); false to authorize+capture atomically.
  • capture_paymentCapture a previously authorized (pre-auth) payment.
  • cancel_paymentCancel (void) an authorized-but-uncaptured payment. Also used for full refund of a captured payment in Safrapay.
Ejemplo de llamada
// 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("authorize_payment", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-safrapay@alpha

Quickstart

Agregá esta entrada a tu claude_desktop_config.json (o a la config de cualquier cliente compatible con MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "safrapay": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-safrapay@alpha"
      ],
      "env": {
        "SAFRAPAY_CLIENT_ID": "<your_safrapay_client_id>",
        "SAFRAPAY_CLIENT_SECRET": "<your_safrapay_client_secret>",
        "SAFRAPAY_MERCHANT_ID": "<your_safrapay_merchant_id>"
      }
    }
  }
}

Después de reiniciar, tu agente puede llamar cualquiera de las 22 herramientas de abajo — probá authorize_payment primero.

Variables de entorno · 4

Necesarias para autenticar el server. Almacenadas cifradas al usar el hosting gestionado de CodeSpar.

SAFRAPAY_CLIENT_ID
obligatorio

Safrapay merchant CNPJ (sent as merchantCredential header on auth)

SAFRAPAY_CLIENT_SECRET
obligatoriosecret

Safrapay MerchantToken used to compute the BCRYPT Authorization header on auth

SAFRAPAY_MERCHANT_ID
obligatorio

Safrapay merchant id (used in request bodies where applicable)

SAFRAPAY_ENV
opcional

Environment: 'sandbox' or 'production'. Defaults to sandbox.

Herramientas disponibles · 22

Cada herramienta es independiente — tu agente carga solo lo que necesita para reducir contexto y tiempo de respuesta.

WRITEauthorize_payment
Authorize a credit-card payment on Safrapay. Set preauth=true to authorize only (use capture_payment later); false to authorize+capture atomically.
WRITEcapture_payment
Capture a previously authorized (pre-auth) payment.
DELETEcancel_payment
Cancel (void) an authorized-but-uncaptured payment. Also used for full refund of a captured payment in Safrapay.
DELETErefund_payment
Refund a captured payment. Pass amount for a partial refund; omit for full. Safrapay routes both through /v2/charge/cancelation with an amount field.
WRITEcreate_pix
Create a Pix charge. Returns qr_code (EMV copy-paste payload), qr_code_image, and chargeId.
WRITEcreate_boleto
Create a boleto charge. Returns boleto PDF URL, barcode, digitable line, and expiration date.
WRITEget_payment
Retrieve a charge by Safrapay chargeId. Works for credit, Pix, and boleto.
WRITEtokenize_card
Tokenize a card for PCI-safe reuse. Set temporary=true for a single-use token (POST /v2/temporary/card); false for a persistent card-on-file (POST /v2/card).

Frameworks compatibles

MCP es un protocolo — cualquier framework que lo hable puede montar este server.

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

Preguntas frecuentes

Corré `npx -y @codespar/mcp-safrapay` y agregá el bloque de config de arriba a tu cliente MCP — Claude, Cursor, VS Code o cualquier cliente compatible con MCP. Sin build, sin SDK. ¿Preferís hosted? El tier gestionado de CodeSpar lo corre por vos, con la auth resuelta.
Safrapay — MCP server · 22 tools | CodeSpar