Skip to main content
BA

Banco do Brasil

v0.1.0-alpha.2OAuth2alpha

Maior banco público do BR (o maior por ativos). OAuth2 + mTLS + gw-dev-app-key. Pix, DICT, cobranças de boleto, conta-corrente. Alpha no npm — devportal fechado por contrato, paths seguem o padrão BACEN.

13 ferramentas6 env vars🇧🇷 Brasilalpha — validação pendente

O que seu agente faz

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

  • create_pix_cobCreate an immediate Pix charge (cob) with QR code. Returns txid, EMV copy-paste payload, and location URL. BACEN Pix v2 standard.
  • get_pix_cobRetrieve an immediate Pix charge by its txid.
  • list_pix_cobList immediate Pix charges (cob) by date range. Paginated per BACEN Pix v2.
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_pix_cob", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-banco-do-brasil@alpha

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": {
    "banco-do-brasil": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-banco-do-brasil@alpha"
      ],
      "env": {
        "BB_CLIENT_ID": "<your_bb_client_id>",
        "BB_CLIENT_SECRET": "<your_bb_client_secret>",
        "BB_DEVELOPER_APP_KEY": "<your_bb_developer_app_key>"
      }
    }
  }
}

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

Variáveis de ambiente · 6

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

BB_CLIENT_ID
obrigatório

Banco do Brasil OAuth client_id issued via developers.bb.com.br after contract onboarding.

BB_CLIENT_SECRET
obrigatóriosecret

Banco do Brasil OAuth client_secret.

BB_DEVELOPER_APP_KEY
obrigatóriosecret

BB Developer App Key (gw-dev-app-key) — appended as a query param on most BB API calls.

BB_CERT_PATH
opcional

Absolute path to the mTLS client certificate (.crt or .pem). BACEN mandates mTLS for Pix v2 in production.

BB_KEY_PATH
opcionalsecret

Absolute path to the mTLS private key (.key or .pem).

BB_ENV
opcional

Environment: 'sandbox' or 'production'. Defaults to 'sandbox'.

Ferramentas disponíveis · 13

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

WRITEcreate_pix_cob
Create an immediate Pix charge (cob) with QR code. Returns txid, EMV copy-paste payload, and location URL. BACEN Pix v2 standard.
READget_pix_cob
Retrieve an immediate Pix charge by its txid.
READlist_pix_cob
List immediate Pix charges (cob) by date range. Paginated per BACEN Pix v2.
WRITEcreate_pix_devolucao
Refund (devolução) a previously received Pix. Must reference the original endToEndId and a merchant-side refund id.
READget_pix_devolucao
Retrieve a Pix devolução by its endToEndId + refund id.
READresolve_dict_key
Resolve a DICT key (CPF, CNPJ, email, phone, EVP) to the owner's account data before sending a Pix. Subject to BCB rate limits per consenting payer.
WRITEregister_dict_key
Register a DICT key on a BB account owned by the merchant. Some key types (email/phone) require BCB confirmation flows.
DELETEdelete_dict_key
Delete a DICT key owned by the merchant. Irreversible — key becomes available for re-registration after BCB lockout window.

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-banco-do-brasil` 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.
Banco do Brasil — MCP server · 13 tools | CodeSpar