Mcp Pagbrasil

io.github.codesparPublished by GitHub account codesparv0.1.0Updated Oct 24, 2026

PagBrasil — cross-border acquiring into Brazil: Pix, Boleto Flash, refunds

VerifiedSTDIODesktop onlyFinanceBusiness & Commerce

Overview

AI-generated overview

Local MCP server for PagBrasil, the cross-border acquirer for Brazil, letting an assistant create Pix, boleto and card orders, check status and issue refunds.

What you can do
Create orders and request payments by Pix, boleto or credit card, returning Pix codes and images or boleto bar codes and PDF links. Fetch an order's current status, for example by polling to detect settlement. Refund a settled order in full or partially with an amount in Brazilian reais. Raw XML responses are passed through so no fields are lost.
When to use it
Use it when an assistant should help an international merchant selling into Brazil take or manage payments: opening Pix or boleto charges, checking whether an order settled, or refunding a customer, including against the sandbox for testing.
Requirements
Runs locally via npx from the npm package, so Node.js is needed. Requires a PagBrasil merchant token in PAGBRASIL_PBTOKEN and a secret phrase in PAGBRASIL_SECRET from the PagBrasil Dashboard. PAGBRASIL_BASE_URL is optional and defaults to the sandbox; production hosts are issued per merchant after the Payment Service Agreement. Network access to PagBrasil is required.
Before you install
The server handles live payment credentials: PAGBRASIL_PBTOKEN and PAGBRASIL_SECRET are sent as body fields on every request, so keep them out of shared configs. It can create real charges and issue refunds that move money; test against the sandbox first. Order numbers must be unique per customer tax ID, and tax IDs must be real CPF or CNPJ values supplied by the user, never invented.

Installation

In SourceWeft

  1. Open Mcp Pagbrasil in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@codespar/mcp-pagbrasil

MCP server for PagBrasil — the cross-border acquirer for international merchants selling into Brazil: Pix, Automatic Pix (PagStream), Boleto Flash, PEC Flash and local credit cards with installments. Distinct from PagBank/PagSeguro.

[npm] [License: MIT]

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

json
{  "mcpServers": {    "pagbrasil": {      "command": "npx",      "args": ["-y", "@codespar/mcp-pagbrasil"],      "env": {        "PAGBRASIL_PBTOKEN": "your-merchant-token",        "PAGBRASIL_SECRET": "your-secret-phrase"      }    }  }}

Claude Code

bash
claude mcp add pagbrasil -- npx @codespar/mcp-pagbrasil

Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

json
{  "servers": {    "pagbrasil": {      "command": "npx",      "args": ["-y", "@codespar/mcp-pagbrasil"],      "env": {        "PAGBRASIL_PBTOKEN": "your-merchant-token",        "PAGBRASIL_SECRET": "your-secret-phrase"      }    }  }}

Authentication

Every request carries the merchant token (pbtoken) and the secret phrase as body fields — there is no auth header. This server injects both from PAGBRASIL_PBTOKEN and PAGBRASIL_SECRET.

API shape (worth knowing)

PagBrasil's API is form-urlencoded (not JSON) and answers XML. The merchant token (pbtoken) and secret phrase travel as body fields on every request — this server injects both from the environment. Tool responses hand the raw XML to the agent under xml so no fields are lost.

Tools (3)

ToolEndpointWhat it does
create_orderPOST /order/addCreate an order / request a payment (pix, boleto, creditcard). Pix responses carry pix_code + pix_image; boleto responses carry the bar code + PDF URL
get_orderPOST /order/getFetch an order's current status — poll to detect settlement
refund_orderPOST /order/refundRefund a settled order (amount_brl for partial, omit for full)

Environment

VariableRequiredDescription
PAGBRASIL_PBTOKENyesMerchant token from the PagBrasil Dashboard
PAGBRASIL_SECRETyesSecret phrase from the Dashboard
PAGBRASIL_BASE_URLnoDefaults to https://sandbox.pagbrasil.com/api. Production hosts are issued per-merchant after the Payment Service Agreement — set the URL your dashboard provides

Notes

  • amount_brl is in major units as a string: '125.00' = R$ 125,00.
  • order_number must be unique per customer_taxid. Same number + same taxid = idempotent no-op; same number + different taxid = rejected (Duplicated order).
  • customer_taxid must be a valid CPF or CNPJ — agents should ask the user, never invent one.

Enterprise

Need governance, budget limits, and audit trails for agent-driven payments on PagBrasil? CodeSpar Enterprise adds a policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT © CodeSpar

Source: packages/payments/pagbrasil/README.md at commit d0a519a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts