Skip to main content
BT

BTG Pactual

v0.1.0-alpha.2OAuth2alpha

Banco de investimento do BR com banking digital de varejo (BTG+). Sabor de banco de investimento: Pix + boleto + contas MAIS posições de investimento, resumo de portfólio, subscrição/resgate de fundos. OAuth2 + mTLS. Alpha — devportal fechado por contrato.

12 ferramentas5 env vars🇧🇷 Brasilalpha — validação pendente

O que seu agente faz

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

  • get_oauth_tokenMint or return a cached OAuth2 client_credentials bearer token for the BTG Developer Portal. Exposed so agents can inspect token freshness; normal tool calls obtain tokens implicitly.
  • create_pix_cobCreate an immediate Pix charge (cob) with QR code. Returns the txid, copy-paste EMV payload, and location URL. BACEN Pix v2 standard surface.
  • get_pix_cobRetrieve an immediate Pix charge (cob) by its txid.
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("get_oauth_token", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-btg@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": {
    "btg": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-btg@alpha"
      ],
      "env": {
        "BTG_CLIENT_ID": "<your_btg_client_id>",
        "BTG_CLIENT_SECRET": "<your_btg_client_secret>",
        "BTG_CERT_PATH": "<your_btg_cert_path>",
        "BTG_KEY_PATH": "<your_btg_key_path>"
      }
    }
  }
}

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

Variáveis de ambiente · 5

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

BTG_CLIENT_ID
obrigatório

BTG OAuth client_id issued via the Developer Portal after contract onboarding.

BTG_CLIENT_SECRET
obrigatóriosecret

BTG OAuth client_secret.

BTG_CERT_PATH
obrigatório

Absolute path to the mTLS client certificate (.crt or .pem). BACEN mandates mTLS for Pix v2; BTG enforces it across product families.

BTG_KEY_PATH
obrigatóriosecret

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

BTG_ENV
opcional

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

Ferramentas disponíveis · 12

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

READget_oauth_token
Mint or return a cached OAuth2 client_credentials bearer token for the BTG Developer Portal. Exposed so agents can inspect token freshness; normal tool calls obtain tokens implicitly.
WRITEcreate_pix_cob
Create an immediate Pix charge (cob) with QR code. Returns the txid, copy-paste EMV payload, and location URL. BACEN Pix v2 standard surface.
READget_pix_cob
Retrieve an immediate Pix charge (cob) by its txid.
WRITEcreate_boleto
Issue a boleto via BTG Cobrança. Returns nosso_numero, linha_digitável, barcode, and PDF URL.
READget_boleto
Retrieve a boleto by its BTG identifier (id or nosso_numero).
READget_account_balance
Retrieve the available balance for a BTG+ checking account (conta corrente). Returns available, blocked, and total balances in BRL.
READget_account_statement
Retrieve account statement transactions for a given period. Paginated.
READlist_investment_positions
List the counterparty's investment positions held at BTG, scoped to fixed-income asset classes (CDB, LCI, LCA, LF, LFSN, debêntures, CRI, CRA). Each position includes issuer, indexer (CDI/IPCA/Prefixado), gross value, net value (after IR/IOF), and maturity.

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-btg` 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.
BTG Pactual — MCP server · 12 tools | CodeSpar