Skip to main content
BT

BTG Pactual

v0.1.0-alpha.2OAuth2alpha

Banco de inversión de BR con banca digital de retail (BTG+). Sabor de banco de inversión: Pix + boleto + cuentas MÁS posiciones de inversión, resumen de portafolio, suscripción/rescate de fondos. OAuth2 + mTLS. Alpha — devportal cerrado por contrato.

12 herramientas5 env vars🇧🇷 Brasilalpha — validación pendiente

Qué puede hacer tu agente

BTG Pactual le da a tu agente 12 tools que llama directo — elegí las que necesite, en Claude, Cursor o cualquier 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.
Ejemplo de llamada
// 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

Agregá esta entrada a tu claude_desktop_config.json (o a la config de cualquier cliente compatible con 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>"
      }
    }
  }
}

Después de reiniciar, tu agente puede llamar cualquiera de las 12 herramientas de abajo — probá get_oauth_token primero.

Variables de entorno · 5

Necesarias para autenticar el server. Almacenadas cifradas al usar el hosting gestionado de CodeSpar.

BTG_CLIENT_ID
obligatorio

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

BTG_CLIENT_SECRET
obligatoriosecret

BTG OAuth client_secret.

BTG_CERT_PATH
obligatorio

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
obligatoriosecret

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

BTG_ENV
opcional

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

Herramientas disponibles · 12

Cada herramienta es independiente — tu agente carga solo lo que necesita para reducir contexto y tiempo de respuesta.

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 compatibles

MCP es un protocolo — cualquier framework que lo hable puede montar este server.

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

Preguntas frecuentes

Corré `npx -y @codespar/mcp-btg` y agregá el bloque de config de arriba a tu cliente MCP — Claude, Cursor, VS Code o cualquier cliente compatible con MCP. Sin build, sin SDK. ¿Preferís hosted? El tier gestionado de CodeSpar lo corre por vos, con la auth resuelta.
BTG Pactual — MCP server · 12 tools | CodeSpar