{"_id":"@codespar/mcp-btg","_rev":"4-567bfdf687ebd1131356a3120ea2fdee","name":"@codespar/mcp-btg","dist-tags":{"latest":"0.1.0-alpha.3","alpha":"0.1.0-alpha.2"},"versions":{"0.1.0-alpha.1":{"name":"@codespar/mcp-btg","version":"0.1.0-alpha.1","keywords":["mcp","btg","btg-pactual","banking","investments","pix","boleto","cdb","lci","lca","debentures","funds","brazil"],"license":"MIT","_id":"@codespar/mcp-btg@0.1.0-alpha.1","maintainers":[{"name":"codespar-npm","email":"contact@codespar.dev"}],"bin":{"mcp-btg":"dist/index.js"},"dist":{"shasum":"721af901d7eb9caf7f48df7b429c17fab28f485b","tarball":"https://registry.npmjs.org/@codespar/mcp-btg/-/mcp-btg-0.1.0-alpha.1.tgz","fileCount":6,"integrity":"sha512-1kHHZOd0u5ia6qIaV1YVCuVIvBK20VgVpW63KABkLRuwDBQ0KhG9J5s437M3LZynfqsogsIcvVoexKOSwviIAw==","signatures":[{"sig":"MEUCIQCGJsuK+eNsDGWWd/TPlzY3w6JGr/NH7mT6cLRjqK/HqQIgCy8BofFxLJWm4HTpgygxFXj2Ral8b78r6weJMvbZPLY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61608},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"abceab06a74a933da6920cfb3b1735adcf271566","mcpName":"io.github.codespar/mcp-btg","scripts":{"build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"codespar-npm","email":"contact@codespar.dev"},"_npmVersion":"11.8.0","description":"MCP server for BTG Pactual — Brazil's largest investment bank. Pix, Boleto, Account, and Investments (CDB, LCI, LCA, debêntures, funds) via BTG's Developer Portal APIs (OAuth2 + mTLS).","directories":{},"_nodeVersion":"25.5.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.0","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-btg_0.1.0-alpha.1_1777119837969_0.005767904026709347","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.2":{"name":"@codespar/mcp-btg","version":"0.1.0-alpha.2","keywords":["mcp","btg","btg-pactual","banking","investments","pix","boleto","cdb","lci","lca","debentures","funds","brazil"],"license":"MIT","_id":"@codespar/mcp-btg@0.1.0-alpha.2","maintainers":[{"name":"codespar-npm","email":"contact@codespar.dev"}],"bin":{"mcp-btg":"dist/index.js"},"dist":{"shasum":"672db42b53c99a3fa8424bc1a4e412742300a7d0","tarball":"https://registry.npmjs.org/@codespar/mcp-btg/-/mcp-btg-0.1.0-alpha.2.tgz","fileCount":6,"integrity":"sha512-grv70WZtEifKvSsVbK7jA7++x/3M5Wx6FdrSnVbZveLP62BjhhI3LJHU6jtNKkZsT0ud1G/UpJagf/C4cAyQGA==","signatures":[{"sig":"MEUCIQCEbdJUKW/GEplf1HsLQf+9ab3W5i/zFmzXTTo7/8eCagIgDptdupVWVfIkXKx3aOBfbYwsYqgAIGxmDpTWIznkPRA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61973},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"b8f7e5b70db9046319ed757225e0eae8f2dc4451","mcpName":"io.github.codespar/mcp-btg","scripts":{"build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"codespar-npm","email":"contact@codespar.dev"},"_npmVersion":"11.8.0","description":"MCP server for BTG Pactual — Brazil's largest investment bank. Pix, Boleto, Account, and Investments (CDB, LCI, LCA, debêntures, funds) via BTG's Developer Portal APIs (OAuth2 + mTLS).","directories":{},"_nodeVersion":"25.5.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.8.0","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-btg_0.1.0-alpha.2_1777122907983_0.813855788439257","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.3":{"name":"@codespar/mcp-btg","version":"0.1.0-alpha.3","description":"MCP server for BTG Pactual — Brazil's largest investment bank. Pix, Boleto, Account, and Investments (CDB, LCI, LCA, debêntures, funds) via BTG's Developer Portal APIs (OAuth2 + mTLS).","type":"module","main":"./dist/index.js","bin":{"mcp-btg":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"devDependencies":{"@types/node":"^25.5.0","typescript":"^5.8.0"},"license":"MIT","keywords":["mcp","btg","btg-pactual","banking","investments","pix","boleto","cdb","lci","lca","debentures","funds","brazil"],"mcpName":"io.github.codespar/mcp-btg","_id":"@codespar/mcp-btg@0.1.0-alpha.3","gitHead":"8e115a5cb8aed75e812af698b03aa996ccd8d7c1","types":"./dist/index.d.ts","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-e6/7BSf56jcvryWZGuL7fn450FFt3jFchywp8TiOorb6u6GN60p1FKNrOhgpOnP2sDTT0+TYd6j85rWlwRGJVA==","shasum":"75440b1c93bb2b8622f3b30b5b2d8aa3929ad3ac","tarball":"https://registry.npmjs.org/@codespar/mcp-btg/-/mcp-btg-0.1.0-alpha.3.tgz","fileCount":6,"unpackedSize":63395,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICIFHKQuPqJY3Ntx33xdx4gmCvj6GKXXhlCs7j2tZe6+AiB3/+iH0YQDb5ro4lT14Ztui2SwQboE1o+3L6trDQaI2A=="}]},"_npmUser":{"name":"codespar-npm","email":"fabiano@codespar.dev"},"directories":{},"maintainers":[{"name":"codespar-npm","email":"fabiano@codespar.dev"},{"name":"dangazineu","email":"daniel.gazineu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-btg_0.1.0-alpha.3_1782158044034_0.7928036078071656"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-25T12:23:57.888Z","modified":"2026-06-22T19:54:04.299Z","0.1.0-alpha.1":"2026-04-25T12:23:58.108Z","0.1.0-alpha.2":"2026-04-25T13:15:08.127Z","0.1.0-alpha.3":"2026-06-22T19:54:04.179Z"},"license":"MIT","keywords":["mcp","btg","btg-pactual","banking","investments","pix","boleto","cdb","lci","lca","debentures","funds","brazil"],"description":"MCP server for BTG Pactual — Brazil's largest investment bank. Pix, Boleto, Account, and Investments (CDB, LCI, LCA, debêntures, funds) via BTG's Developer Portal APIs (OAuth2 + mTLS).","maintainers":[{"name":"codespar-npm","email":"fabiano@codespar.dev"},{"name":"dangazineu","email":"daniel.gazineu@gmail.com"}],"readme":"# @codespar/mcp-btg\n\nMCP server for [BTG Pactual](https://developer.btgpactual.com) — Brazil's (and LatAm's) largest investment bank.\n\nBTG runs a digital banking + investments stack (BTG+) on top of an institutional brokerage backbone. Merchants and fintechs integrate to BTG for the combination of Pix/boleto rails *and* an investment-account API surface (CDB, LCI, LCA, debêntures, funds) that no retail bank exposes at this depth.\n\n## Status: alpha (`0.1.0-alpha.1`)\n\nBTG's Developer Portal is **contract-gated** — the full OpenAPI specs are only visible to onboarded counterparties. The endpoint paths in this server are best-guesses based on (a) BACEN Pix v2 standard paths, (b) BTG's public marketing pages, and (c) conventions shared with other Brazilian banks. Every unverified path is flagged `TODO(verify)` in the source.\n\nPin to exact versions during `0.1.x`; paths will be corrected to match the portal spec once an onboarded counterparty can validate.\n\n## Tools (12)\n\n| Tool | Purpose |\n|---|---|\n| `get_oauth_token` | Mint or return a cached OAuth2 client_credentials bearer token for the BTG Developer Portal. |\n| `create_pix_cob` | Create an immediate Pix charge (cob) with QR code. |\n| `get_pix_cob` | Retrieve an immediate Pix charge (cob) by its txid. |\n| `create_boleto` | Issue a boleto via BTG Cobrança. |\n| `get_boleto` | Retrieve a boleto by its BTG identifier (id or nosso_numero). |\n| `get_account_balance` | Retrieve the available balance for a BTG+ checking account (conta corrente). |\n| `get_account_statement` | Retrieve account statement transactions for a given period. |\n| `list_investment_positions` | List the counterparty's investment positions held at BTG, scoped to fixed-income asset classes (CDB, LCI, L... |\n| `get_portfolio_summary` | Consolidated portfolio summary across all asset classes held at BTG (fixed income, funds, equities, treasur... |\n| `list_funds_available` | List funds available for distribution on BTG's platform. |\n| `subscribe_to_fund` | Subscribe (aplicar) to a fund on BTG's distribution platform. |\n| `redeem_from_fund` | Redeem (resgatar) from a fund. |\n\n## Install\n\n```bash\nnpm install @codespar/mcp-btg@0.1.0-alpha.1\n```\n\n## Environment\n\n```bash\nBTG_CLIENT_ID=\"...\"       # OAuth client_id from BTG's Developer Portal\nBTG_CLIENT_SECRET=\"...\"   # OAuth client_secret\nBTG_CERT_PATH=\"/abs/path/to/client.crt\"   # mTLS client certificate\nBTG_KEY_PATH=\"/abs/path/to/client.key\"    # mTLS private key\nBTG_ENV=\"sandbox\"                          # or \"production\" (default: sandbox)\n```\n\n## Authentication\n\nTwo factors are **both** required on every call:\n\n1. **OAuth2 `client_credentials`** — the server calls the token endpoint, caches the bearer until ~60s before expiry, and attaches `Authorization: Bearer <token>` to downstream calls.\n2. **mTLS** — BACEN mandates mutual TLS for Pix v2, and BTG enforces it across product families (banking + investments). The server loads the client certificate and private key from the paths you set, builds a Node `https.Agent`, and routes every request through it.\n\nYou obtain the cert + key bundle from the BTG Developer Portal after contract onboarding. They are distinct from the OAuth credentials.\n\n## Run\n\n```bash\n# stdio (default)\nnpx @codespar/mcp-btg\n\n# HTTP transport\nMCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-btg\n```\n\n## Caveats\n\n- **Paths are unverified.** See the `TODO(verify)` markers in `src/index.ts`. Onboarded counterparties should validate against their portal-issued OpenAPI spec and open a PR.\n- **Sandbox host is a guess.** BTG issues a sandbox subdomain per counterparty; override by editing `BASE_URL` if your provisioned sandbox URL differs.\n- **Investments surface (CDB/LCI/LCA/debêntures/funds)** is differentiated vs. retail-bank MCPs in this repo, but the field shapes will move once the OpenAPI spec is byte-verified.\n\n## Enterprise\n\nNeed governance, budget limits, and audit trails for agent payments? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds policy engine, payment routing, and compliance templates on top of these MCP servers.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}