Skip to main content
PA

PagBrasil

v0.1.0API Key

Cross-border acquirer for international merchants selling into Brazil: Pix, Automatic Pix (PagStream) and boleto without a local entity.

3 tools3 env vars๐Ÿ‡ง๐Ÿ‡ท Brazilstable on npm

What your agent can do

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.
Example call
// 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", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-pagbrasil

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "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.

Environment variables ยท 3

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

PAGBRASIL_PBTOKEN
requiredsecret

Merchant token (pbtoken) from the PagBrasil Dashboard

PAGBRASIL_SECRET
requiredsecret

Secret phrase from the PagBrasil Dashboard

PAGBRASIL_BASE_URL
optional

API base URL. Defaults to https://sandbox.pagbrasil.com/api; production hosts are issued per-merchant.

Available tools ยท 3

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

WRITEcreate_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.
READget_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.
DELETErefund_order
Request a refund for a settled order (POST /order/refund). Pass amount_brl for a partial refund; omit for a full refund.

Compatible frameworks

MCP is a protocol โ€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-pagbrasil` and add the config block above to your MCP client โ€” Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
PagBrasil โ€” MCP server ยท 3 tools | CodeSpar