Cross-border acquirer for international merchants selling into Brazil: Pix, Automatic Pix (PagStream) and boleto without a local entity.
PagBrasil gives your agent 3 tools it calls directly โ pick the ones it needs, in Claude, Cursor, or any MCP client.
create_order โ Create an order / request a payment (POST /order/add, form-urlencoded). payment_type selects the method (pix | boleto | creditcard). Returns XML: for Pix it carries pix_code (copy-paste) and pix_image; for boleto, the bar code and PDF URL. order_number must be unique per customer_taxid.get_order โ Request information about an order (POST /order/get). Returns the same XML order shape as create_order, including current payment status โ poll this to detect Pix/boleto settlement.refund_order โ Request a refund for a settled order (POST /order/refund). Pass amount_brl for a partial refund; omit for a full refund.// 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_order", { /* ... */ });$ npm install @codespar/mcp-pagbrasilAdd this entry to your claude_desktop_config.json (or any MCP-compatible client config).
{
"mcpServers": {
"pagbrasil": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-pagbrasil"
],
"env": {
"PAGBRASIL_PBTOKEN": "<your_pagbrasil_pbtoken>",
"PAGBRASIL_SECRET": "<your_pagbrasil_secret>"
}
}
}
}After restart, your agent can call any of the 3 tools below โ try create_order first.
Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.
PAGBRASIL_PBTOKENMerchant token (pbtoken) from the PagBrasil Dashboard
PAGBRASIL_SECRETSecret phrase from the PagBrasil Dashboard
PAGBRASIL_BASE_URLAPI base URL. Defaults to https://sandbox.pagbrasil.com/api; production hosts are issued per-merchant.
Each tool is independent โ your agent loads only what it needs to reduce context and response time.
create_orderget_orderrefund_orderMCP is a protocol โ any framework that speaks it can mount this server.