Skip to main content
S

Safrapay

@codespar/mcp-safrapay Β· v0.2.0-alpha.3

πŸ‡§πŸ‡· BrazilPaymentsAuth Β· API Keybeta22 tools4 env varsprerelease

Banco Safra's acquirer β€” premium/enterprise private-banking segment. Operated on Aditum's payment platform. Authorize/capture/cancel, Pix, boleto, tokenization, split, digital statements. Alpha on npm β€” BCRYPT auth recipe and body casing pending sandbox validation.

Get started Β· freeView docs

MIT Β· runs locally with your own credentials

Limitations

  • v0.2.0-alpha.3 is a prerelease; npm has no stable release of this package.
Package
@codespar/mcp-safrapay
Version
0.2.0-alpha.3 Β· prerelease
npm dist-tag
latest
Category
Payments
Auth
API Key
Country
πŸ‡§πŸ‡· Brazil
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 variables4 variables read by this server's code, listed below.
Restart and make the first callThe agent can call any of the 22 tools. Try authorize_payment first.
terminal
# Claude Code claude mcp add safrapay -e SAFRAPAY_CLIENT_ID=… -e SAFRAPAY_CLIENT_SECRET=… -e SAFRAPAY_ENV=… -e SAFRAPAY_MERCHANT_ID=… -- npx -y @codespar/mcp-safrapay@0.2.0-alpha.3 # then: /mcp to confirm the server is connected
Environment variables4 variables
SAFRAPAY_CLIENT_IDSafrapay merchant CNPJ (sent as merchantCredential header on auth)required
SAFRAPAY_CLIENT_SECRETSafrapay MerchantToken used to compute the BCRYPT Authorization header on authrequiredsecret
SAFRAPAY_ENVEnvironment: 'sandbox' or 'production'. Defaults to sandbox.optional
SAFRAPAY_MERCHANT_IDSafrapay merchant id (used in request bodies where applicable)required

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

First call demoauthorize_payment

"Authorize a credit-card payment on Safrapay. Set preauth=true to authorize only"

tools/callauthorize_paymentresult returned

Tools

What your agent can call.

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

authorize_payment

Authorize a credit-card payment on Safrapay. Set preauth=true to authorize only (use capture_payment later); false to authorize+capture atomically.

capture_payment

Capture a previously authorized (pre-auth) payment.

cancel_payment

Cancel (void) an authorized-but-uncaptured payment. Also used for full refund of a captured payment in Safrapay.

refund_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.

create_pix

Create a Pix charge. Returns qr_code (EMV copy-paste payload), qr_code_image, and chargeId.

create_boleto

Create a boleto charge. Returns boleto PDF URL, barcode, digitable line, and expiration date.

get_payment

Retrieve a charge by Safrapay chargeId. Works for credit, Pix, and boleto.

tokenize_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).

create_split_rule

Configure split distribution for an existing charge. Each rule routes a portion of the charge to a receiver (onboard receivers via the Portal first).

get_statement

Retrieve the digital statement (extrato). A Safrapay differentiator, reflecting the Banco Safra bank-account integration.

list_transactions

List charges with optional filters.

delete_card_token

Revoke a stored card token. For persistent card-on-file tokens created via tokenize_card (temporary=false). DELETE /v2/card/{cardId}.

Names and descriptions come from the package's tools/list (@codespar/mcp-safrapay@0.2.0-alpha.3). 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 Safrapay MCP server?

Run npx -y @codespar/mcp-safrapay@0.2.0-alpha.3 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 Safrapay?

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

How does Safrapay authenticate, and how are credentials stored?

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

How does Safrapay handle upstream API changes?

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

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

Yes. Safrapay is MIT-licensed and published on npm as @codespar/mcp-safrapay, 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.
Safrapay β€” MCP server Β· 22 tools | CodeSpar