Skip to main content
PA

PagBrasil

v0.1.0API Key

Adquirente cross-border para lojistas internacionais vendendo no Brasil: Pix, Pix Automático (PagStream) e boleto sem entidade local.

3 ferramentas3 env vars🇧🇷 Brasilestável no npm

O que seu agente faz

O PagBrasil dá ao seu agente 3 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer cliente MCP.

  • create_orderCreate 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_orderRequest 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_orderRequest a refund for a settled order (POST /order/refund). Pass amount_brl for a partial refund; omit for a full refund.
Exemplo de chamada
// 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", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-pagbrasil

Quickstart

Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "pagbrasil": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-pagbrasil"
      ],
      "env": {
        "PAGBRASIL_PBTOKEN": "<your_pagbrasil_pbtoken>",
        "PAGBRASIL_SECRET": "<your_pagbrasil_secret>"
      }
    }
  }
}

Depois de reiniciar, seu agente pode chamar qualquer uma das 3 ferramentas abaixo — teste create_order primeiro.

Variáveis de ambiente · 3

Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.

PAGBRASIL_PBTOKEN
obrigatóriosecret

Merchant token (pbtoken) from the PagBrasil Dashboard

PAGBRASIL_SECRET
obrigatóriosecret

Secret phrase from the PagBrasil Dashboard

PAGBRASIL_BASE_URL
opcional

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

Ferramentas disponíveis · 3

Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.

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.

Frameworks compatíveis

MCP é um protocolo — qualquer framework que o fale pode montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Qualquer cliente MCPProtocolo

Perguntas frequentes

Rode `npx -y @codespar/mcp-pagbrasil` e adicione o bloco de config acima ao seu cliente MCP — Claude, Cursor, VS Code ou qualquer cliente compatível com MCP. Sem build, sem SDK. Prefere hospedado? O tier gerenciado da CodeSpar roda pra você, com a auth resolvida.
PagBrasil — MCP server · 3 tools | CodeSpar