Pagbrasil

Finance and commerce

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

Your AI app calls the Pagbrasil MCP server, which does the finance and commerce work and sends the result back to the chat.

About Pagbrasil

Pagbrasil is a community MCP server from codespar, filed in our directory under finance and commerce. PagBrasil, cross-border acquiring into Brazil: Pix, Boleto Flash, refunds.

Pagbrasil runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-pagbrasil@0.1.0 and talks to it over standard input and output. It needs PAGBRASIL_PBTOKEN and PAGBRASIL_SECRET set before Pagbrasil starts.

Pagbrasil is listed in the official MCP registry as io.github.codespar/mcp-pagbrasil, version 0.1.0.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-pagbrasil
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-pagbrasil

How to set up Pagbrasil

  1. Install Node.js on the machine that runs your AI app, because Pagbrasil starts with npx and downloads its package on first run.
  2. Create PAGBRASIL_PBTOKEN and PAGBRASIL_SECRET for Pagbrasil in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Pagbrasil to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Pagbrasil tools to confirm the connection.
  5. Run one read-only task with Pagbrasil first, and keep your app asking before each tool call until the results look right.

Pagbrasil compared with similar servers

  • Pagseguro by codespar has fewer GitHub stars than Pagbrasil (278 against 278); both are community servers, and both run locally.
  • Pagar Me by codespar has fewer GitHub stars than Pagbrasil (278 against 278); both are community servers, and both run locally.
  • Paypal by codespar has fewer GitHub stars than Pagbrasil (278 against 278); both are community servers, and both run locally.

Before you connect Pagbrasil

  • Give Pagbrasil its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Pagbrasil tool call until you trust what it does with them.
  • Treat text that Pagbrasil fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Pagbrasil on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Pagbrasil

How marketing and sales teams put Pagbrasil to work, by company size. Pick the size closest to yours and start Pagbrasil on one use case.

Small business

  • A small business can ask Pagbrasil which products and customers drive margin, then plan promotions around them.
  • Owners can use Pagbrasil to check refunds, failed payments and churn reasons without opening three dashboards.
  • Pagbrasil runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Pagbrasil to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Pagbrasil to check spend against budget each week and move money to what's working.
  • Start Pagbrasil on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Pagbrasil read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Pagbrasil to answer revenue questions by channel and region with figures finance signs off on.
  • Pagbrasil is a community server, so have security review the code and pin a version before Pagbrasil touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Pagbrasil README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

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

Quick Start

Claude Desktop

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

{
  "mcpServers": {
    "pagbrasil": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-pagbrasil"],
      "env": {
        "PAGBRASIL_PBTOKEN": "your-merchant-token",
        "PAGBRASIL_SECRET": "your-secret-phrase"
      }
    }
  }
}
Claude Code
claude mcp add pagbrasil -- npx @codespar/mcp-pagbrasil
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.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)

Tool Endpoint What it does
create_order POST /order/add Create an order / request a payment (pix, boleto, creditcard). Pix responses carry pix_code + pix_image; boleto responses carry the bar code + PDF URL
get_order POST /order/get Fetch an order's current status, poll to detect settlement
refund_order POST /order/refund Refund a settled order (amount_brl for partial, omit for full)

Environment

Variable Required Description
PAGBRASIL_PBTOKEN yes Merchant token from the PagBrasil Dashboard
PAGBRASIL_SECRET yes Secret phrase from the Dashboard
PAGBRASIL_BASE_URL no Defaults 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

Questions about Pagbrasil

What is the Pagbrasil MCP server?

PagBrasil, cross-border acquiring into Brazil: Pix, Boleto Flash, refunds. Pagbrasil is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Pagbrasil MCP server?

Add Pagbrasil to your AI app's MCP config with the command npx -y @codespar/mcp-pagbrasil@0.1.0. In Claude Code, run claude mcp add --transport stdio codespar-pagbrasil -- npx -y @codespar/mcp-pagbrasil@0.1.0. To run Pagbrasil this way you need Node.js installed.

Does Pagbrasil need an API key?

Yes. Pagbrasil expects PAGBRASIL_PBTOKEN and PAGBRASIL_SECRET to be set. Create the key for Pagbrasil in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Pagbrasil an official MCP server?

No. Pagbrasil is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Pagbrasil access to company data.

What license is Pagbrasil under?

Pagbrasil is released under the MIT license, according to its GitHub repository. The license covers the code of Pagbrasil; the service it connects to has its own terms.