# mcp-btg

Connects AI tools to BTG Pactual banking and investment services in Brazil. Handles Pix transfers, boletos, account data, and fund operations under strict mTLS.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/banking/btg
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-btg

## What it does

This server exposes 12 tools for integrating with BTG Pactual systems. It enables models to generate instant Pix charges with QR codes, issue billing boletos, fetch checking account statements, and inspect fixed-income holdings like CDB or debêntures. It also handles fund subscriptions and redemptions.

Security relies on two simultaneous mechanisms: OAuth2 `client_credentials` bearer tokens and mutual TLS. The Brazilian Central Bank mandates mTLS for Pix v2, so BTG enforces it across both banking and brokerage endpoints. You must configure local paths for both a client certificate and a private key before making calls.

The server is currently in alpha (`0.1.0-alpha.1`). Because BTG gates its Developer Portal behind counterparty contracts, endpoint routes are provisional guesses modeled on standard Brazilian banking interfaces.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `BTG_CLIENT_ID`, `BTG_CLIENT_SECRET`, `BTG_CERT_PATH`, `BTG_KEY_PATH`, `BTG_ENV` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env BTG_CLIENT_ID=<BTG_CLIENT_ID> --env BTG_CLIENT_SECRET=<BTG_CLIENT_SECRET> --env BTG_CERT_PATH=<BTG_CERT_PATH> --env BTG_KEY_PATH=<BTG_KEY_PATH> --env BTG_ENV=<BTG_ENV> --transport stdio btg -- npx -y @codespar/mcp-btg
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add btg --env BTG_CLIENT_ID=<BTG_CLIENT_ID> --env BTG_CLIENT_SECRET=<BTG_CLIENT_SECRET> --env BTG_CERT_PATH=<BTG_CERT_PATH> --env BTG_KEY_PATH=<BTG_KEY_PATH> --env BTG_ENV=<BTG_ENV> -- npx -y @codespar/mcp-btg
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "btg": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-btg"
            ],
            "env": {
                "BTG_CLIENT_ID": "<BTG_CLIENT_ID>",
                "BTG_CLIENT_SECRET": "<BTG_CLIENT_SECRET>",
                "BTG_CERT_PATH": "<BTG_CERT_PATH>",
                "BTG_KEY_PATH": "<BTG_KEY_PATH>",
                "BTG_ENV": "<BTG_ENV>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "btg": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-btg"
            ],
            "env": {
                "BTG_CLIENT_ID": "<BTG_CLIENT_ID>",
                "BTG_CLIENT_SECRET": "<BTG_CLIENT_SECRET>",
                "BTG_CERT_PATH": "<BTG_CERT_PATH>",
                "BTG_KEY_PATH": "<BTG_KEY_PATH>",
                "BTG_ENV": "<BTG_ENV>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e BTG_CLIENT_ID=<BTG_CLIENT_ID> -e BTG_CLIENT_SECRET=<BTG_CLIENT_SECRET> -e BTG_CERT_PATH=<BTG_CERT_PATH> -e BTG_KEY_PATH=<BTG_KEY_PATH> -e BTG_ENV=<BTG_ENV> btg npx -y @codespar/mcp-btg
```
Replace <…> with your own values

## When to use it
- generate instant Pix payment QR codes
- issue and track bank boletos
- retrieve checking account balances and statements
- review investment positions across fixed income and funds

## Example prompts
- Generate a Pix charge for 250 BRL with a QR code
- Fetch the account statement for the past 30 days
- List my current fixed-income investments at BTG

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
