Mcp Btg

io.github.codespar由 GitHub 账号 codespar 发布v0.1.0-alpha.3更新于 Oct 24, 2026

MCP server for BTG Pactual — Pix, Boleto, Account, Investments (CDB/LCI/LCA/funds), OAuth2 + mTLS

已验证STDIO仅桌面金融商业与电商

概览

AI 生成的概览

面向 BTG Pactual 银行与投资业务的 alpha 版 MCP 服务器,让助手获取 OAuth 令牌、创建 Pix 收费与 boleto、查询余额与流水、查看投资持仓并申购或赎回基金。

可以做什么
获取或复用缓存的 OAuth2 client_credentials 访问令牌,用于 BTG 开发者门户。
适用场景
仅适合已与 BTG Pactual 完成签约接入、希望在沙箱中试验由助手执行 Pix、boleto、账户与投资操作的团队。由于端点路径与沙箱主机均为未经验证的推测,目前不适合生产使用。
运行要求
本地 Node.js 进程,通过 npm 包安装。需要 BTG_CLIENT_ID、BTG_CLIENT_SECRET、BTG_CERT_PATH 和 BTG_KEY_PATH,均须在合同接入后从 BTG 开发者门户获取;BTG_ENV 选择 sandbox(默认)或 production。需要访问 BTG 端点的网络。
安装前请注意
涉及真实金融凭据:OAuth 客户端密钥与 mTLS 私钥路径。工具可创建 Pix 收费与 boleto、申购与赎回基金、读取余额与流水;在 production 下会动用真实资金。端点路径与沙箱主机为未经验证的推测,调用可能失败或指向意外路由。属 alpha 软件,请锁定精确版本。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Btg,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@codespar/mcp-btg

MCP server for BTG Pactual — Brazil's (and LatAm's) largest investment bank.

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

Status: alpha (0.1.0-alpha.1)

BTG'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.

Pin to exact versions during 0.1.x; paths will be corrected to match the portal spec once an onboarded counterparty can validate.

Tools (12)

ToolPurpose
get_oauth_tokenMint or return a cached OAuth2 client_credentials bearer token for the BTG Developer Portal.
create_pix_cobCreate an immediate Pix charge (cob) with QR code.
get_pix_cobRetrieve an immediate Pix charge (cob) by its txid.
create_boletoIssue a boleto via BTG Cobrança.
get_boletoRetrieve a boleto by its BTG identifier (id or nosso_numero).
get_account_balanceRetrieve the available balance for a BTG+ checking account (conta corrente).
get_account_statementRetrieve account statement transactions for a given period.
list_investment_positionsList the counterparty's investment positions held at BTG, scoped to fixed-income asset classes (CDB, LCI, L...
get_portfolio_summaryConsolidated portfolio summary across all asset classes held at BTG (fixed income, funds, equities, treasur...
list_funds_availableList funds available for distribution on BTG's platform.
subscribe_to_fundSubscribe (aplicar) to a fund on BTG's distribution platform.
redeem_from_fundRedeem (resgatar) from a fund.

Install

bash
npm install @codespar/[email protected]

Environment

bash
BTG_CLIENT_ID="..."       # OAuth client_id from BTG's Developer PortalBTG_CLIENT_SECRET="..."   # OAuth client_secretBTG_CERT_PATH="/abs/path/to/client.crt"   # mTLS client certificateBTG_KEY_PATH="/abs/path/to/client.key"    # mTLS private keyBTG_ENV="sandbox"                          # or "production" (default: sandbox)

Authentication

Two factors are both required on every call:

  1. OAuth2 client_credentials — the server calls the token endpoint, caches the bearer until ~60s before expiry, and attaches Authorization: Bearer <token> to downstream calls.
  2. 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.

You obtain the cert + key bundle from the BTG Developer Portal after contract onboarding. They are distinct from the OAuth credentials.

Run

bash
# stdio (default)npx @codespar/mcp-btg
# HTTP transportMCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-btg

Caveats

  • 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.
  • Sandbox host is a guess. BTG issues a sandbox subdomain per counterparty; override by editing BASE_URL if your provisioned sandbox URL differs.
  • 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.

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

来源:packages/banking/btg/README.md,提交 d0a519a

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0-alpha.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分