mcp-braspag — Claude Code MCP server: payments and setup
This MCP server lets an agent work with Braspag payments, recurring billing, card tokens, and marketplace splits.
claude mcp add --env BRASPAG_MERCHANT_ID=<BRASPAG_MERCHANT_ID> --env BRASPAG_MERCHANT_KEY=<BRASPAG_MERCHANT_KEY> --env BRASPAG_ENV=<BRASPAG_ENV> --transport stdio braspag -- npx -y @codespar/mcp-braspagWhat mcp-braspag does
mcp-braspag exposes Braspag Transaction API and Query API operations to the agent. It can create, capture, void, and look up sales, start Pix or Boleto payments, submit 3DS credit transactions, and send standalone antifraud analyses.
The server includes tools for recurring payment schedules, Cartão Protegido vault tokens, marketplace split rules, and zero-dollar card validation. Agents can change recurring amounts and dates, deactivate or reactivate schedules, and remove stored card tokens.
Set BRASPAG_MERCHANT_ID and BRASPAG_MERCHANT_KEY before running it; Braspag checks these values in API headers. Your merchant contract must have Braspag Pagador enabled through Cielo or Braspag, or the server cannot use valid credentials.
What it helps with
- create a Braspag sale
- manage a recurring payment schedule
- store a card in Cartão Protegido
- split marketplace funds across sub-merchants
- look up a sale by
MerchantOrderId
Example prompts for the agent
- Use Braspag to create a sale from
order.jsonand return thePaymentId. - Look up the payment by
MerchantOrderIdand explain any decline returned by the API. - Create a recurring payment with its amount and next payment date.
How to install mcp-braspag
Platform CLI
claude mcp add --env BRASPAG_MERCHANT_ID=<BRASPAG_MERCHANT_ID> --env BRASPAG_MERCHANT_KEY=<BRASPAG_MERCHANT_KEY> --env BRASPAG_ENV=<BRASPAG_ENV> --transport stdio braspag -- npx -y @codespar/mcp-braspagReplace <…> with your own values
Platform CLI
codex mcp add braspag --env BRASPAG_MERCHANT_ID=<BRASPAG_MERCHANT_ID> --env BRASPAG_MERCHANT_KEY=<BRASPAG_MERCHANT_KEY> --env BRASPAG_ENV=<BRASPAG_ENV> -- npx -y @codespar/mcp-braspagReplace <…> with your own values
Config file
{
"mcpServers": {
"braspag": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-braspag"
],
"env": {
"BRASPAG_MERCHANT_ID": "<BRASPAG_MERCHANT_ID>",
"BRASPAG_MERCHANT_KEY": "<BRASPAG_MERCHANT_KEY>",
"BRASPAG_ENV": "<BRASPAG_ENV>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"braspag": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-braspag"
],
"env": {
"BRASPAG_MERCHANT_ID": "<BRASPAG_MERCHANT_ID>",
"BRASPAG_MERCHANT_KEY": "<BRASPAG_MERCHANT_KEY>",
"BRASPAG_ENV": "<BRASPAG_ENV>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e BRASPAG_MERCHANT_ID=<BRASPAG_MERCHANT_ID> -e BRASPAG_MERCHANT_KEY=<BRASPAG_MERCHANT_KEY> -e BRASPAG_ENV=<BRASPAG_ENV> braspag npx -y @codespar/mcp-braspagReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-braspag
How do I install mcp-braspag in Claude Code?
Set BRASPAG_MERCHANT_ID and BRASPAG_MERCHANT_KEY, then run `claude mcp add mcp-braspag -e BRASPAG_MERCHANT_ID=<BRASPAG_MERCHANT_ID> -e BRASPAG_MERCHANT_KEY=<BRASPAG_MERCHANT_KEY> -- npx -y @codespar/mcp-braspag`.
What does mcp-braspag do?
It connects an agent to Braspag for sales, recurring billing, card vault tokens, marketplace splits, Pix, Boleto, and antifraud analysis.
How is mcp-braspag different from the Cielo server?
mcp-braspag orchestrates payments across acquirers with routing, card vaulting, failover, and marketplace splitting. The Cielo server handles direct acquiring.