Skip to main content
BP

BTG Pactual

@codespar/mcp-btg · v0.1.0-alpha.3

🇧🇷 BrazilBankingAuth · OAuth2beta12 tools5 env varsprerelease

BR investment bank with retail digital banking (BTG+). Investment-bank flavor: Pix + boleto + accounts PLUS investment positions, portfolio summary, fund subscribe/redeem. OAuth2 + mTLS. Alpha — devportal contract-gated.

Get started · freeView docs

MIT · runs locally with your own credentials

Limitations

  • v0.1.0-alpha.3 is a prerelease; npm has no stable release of this package.
  • Hosted calls with a test key are not available: the runtime has not recorded this provider's test behaviour (test venue unclassified).
Package
@codespar/mcp-btg
Version
0.1.0-alpha.3 · prerelease
npm dist-tag
latest
Category
Banking
Auth
OAuth2
Country
🇧🇷 Brazil
License
MIT
Transport
stdio · streamable-http

Quickstart

Install, set the credentials, make the first call.

Pick your client. The server runs locally over stdio, with your own credentials.

Add the server to your clientOne config entry. No build step, no SDK required.
Set the environment variables5 variables read by this server's code, listed below.
Restart and make the first callThe agent can call any of the 12 tools. Try get_oauth_token first.
terminal
# Claude Code claude mcp add btg -e BTG_CERT_PATH=… -e BTG_CLIENT_ID=… -e BTG_CLIENT_SECRET=… -e BTG_ENV=… -e BTG_KEY_PATH=… -- npx -y @codespar/mcp-btg@0.1.0-alpha.3 # then: /mcp to confirm the server is connected
Environment variables5 variables
BTG_CERT_PATHAbsolute path to the mTLS client certificate (.crt or .pem). BACEN mandates mTLS for Pix v2; BTG enforces it across product families.required
BTG_CLIENT_IDBTG OAuth client_id issued via the Developer Portal after contract onboarding.required
BTG_CLIENT_SECRETBTG OAuth client_secret.requiredsecret
BTG_ENVEnvironment: 'sandbox' or 'production'. Defaults to 'sandbox'.optional
BTG_KEY_PATHAbsolute path to the mTLS private key (.key or .pem).requiredsecret

Names read from the package code (@codespar/mcp-btg@0.1.0-alpha.3). Descriptions and flags come from its manifest. Self-hosted, you hold the credentials.

First call demoget_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"

tools/callget_oauth_tokenresult returned

Tools

What your agent can call.

12 tools, as the package's tools/list returns them.

get_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.

create_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.

get_pix_cob

Retrieve an immediate Pix charge (cob) by its txid.

create_boleto

Issue a boleto via BTG Cobrança. Returns nosso_numero, linha_digitável, barcode, and PDF URL.

get_boleto

Retrieve a boleto by its BTG identifier (id or nosso_numero).

get_account_balance

Retrieve the available balance for a BTG+ checking account (conta corrente). Returns available, blocked, and total balances in BRL.

get_account_statement

Retrieve account statement transactions for a given period. Paginated.

list_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.

get_portfolio_summary

Consolidated portfolio summary across all asset classes held at BTG (fixed income, funds, equities, treasury, crypto). Returns gross value, net value, % allocation per class, and total IR/IOF estimate.

list_funds_available

List funds available for distribution on BTG's platform. Returns fund CNPJ, name, manager, class (Renda Fixa | Multimercado | Ações | Cambial | Previdência | FIDC | FII), benchmark, fee schedule, minimum subscription, and liquidity (cotização / liquidação D+n).

subscribe_to_fund

Subscribe (aplicar) to a fund on BTG's distribution platform. Settlement follows the fund's cotização/liquidação rule (typically D+0 cotização, D+1 liquidação for RF; D+30 for some FIDC). Requires a suitability profile on file.

redeem_from_fund

Redeem (resgatar) from a fund. Total or partial. Settlement follows the fund's cotização/liquidação rule. Returns the request id, redemption type (total/parcial), and projected liquidation date.

Names and descriptions come from the package's tools/list (@codespar/mcp-btg@0.1.0-alpha.3). A kind (read, write, delete) is shown only when the package annotates its tools or each tool was verified one by one; neither exists for this server yet.

Compatibility

MCP is a protocol. Any client that speaks it can mount this server.

codespar_discover lists this server's tools, but a project with a test key cannot call them yet: the runtime has not recorded what this provider does in test mode, and refuses rather than guess.

Protocol

Any MCP client

stdio · streamable-http

Questions

Before you install.

How do I install the BTG Pactual MCP server?

Run npx -y @codespar/mcp-btg@0.1.0-alpha.3 and add the config block above to your MCP client: Claude Code, Cursor, Claude Desktop, VS Code, or any MCP-compatible client. No build step, no SDK required.

What can my agent do with BTG Pactual?

BTG Pactual exposes 12 tools for banking. Your agent calls them directly; the full list is above.

How does BTG Pactual authenticate, and how are credentials stored?

BTG Pactual uses OAuth2. Self-hosted, you hold the credentials: the server reads them from its environment variables.

How does BTG Pactual handle upstream API changes?

Every server is versioned independently on npm. The command on this page pins 0.1.0-alpha.3, the version whose tools are listed here; your agent keeps running it until you change the version.

Is BTG Pactual open source? How do I report a bug?

Yes. BTG Pactual is MIT-licensed and published on npm as @codespar/mcp-btg, source on GitHub (link in the Details panel). Report issues on the package repository; security issues go to security@codespar.dev, and we respond within 24 hours.

Start in seconds.

Add the config above, set the variables, and your agent calls the tools.

Start in seconds demo
Add the server to your client with the config above.
Set the environment variables listed above.
Ask your agent for the first call.
BTG Pactual — MCP server · 12 tools | CodeSpar