mcpField
M
mcp-bradesco

mcp-bradesco

Local
github.com/codesparFinance275Updated 4w ago

About mcp-bradesco

mcp-bradesco is an MCP server for the Bradesco bank API, covering Pix, boleto (Cobrança), utility and tax payments, and account statements. It targets Brazilian merchants with significant Pix, boleto, and cash-management volume who connect to the bank directly rather than through a PSP. The project is in alpha and its endpoint paths are pending verification against the official spec.

Key features

  1. 01Pix sending, QR charges, and DICT key lookup
  2. 02Boleto creation, lookup, cancellation, and PDF download
  3. 03Arrecadação bill payments and DARF or GRU tax payments
  4. 04Account balance and statement retrieval
  5. 05OAuth2 and mTLS dual authentication

Use cases

  1. 01Issuing and refunding Pix payments from an agent workflow
  2. 02Automating boleto issuance, tracking, and cancellation
  3. 03Paying utility bills or federal taxes in batch

MCP support

The project is an MCP server that exposes 22 tools to MCP clients for calling Bradesco payment and account endpoints.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-bradesco": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-bradesco"
],
"env": {
"BRADESCO_CLIENT_ID": "<BRADESCO_CLIENT_ID>",
"BRADESCO_CLIENT_SECRET": "<BRADESCO_CLIENT_SECRET>",
"BRADESCO_CERT_PATH": "<BRADESCO_CERT_PATH>",
"BRADESCO_KEY_PATH": "<BRADESCO_KEY_PATH>",
"BRADESCO_ENV": "<BRADESCO_ENV>"
}
}
}
}
Run commandnpx -y @codespar/mcp-bradesco
Environment variables to set
BRADESCO_CLIENT_IDBradesco OAuth client_id issued via the Developer Portal after contract onboarding.
BRADESCO_CLIENT_SECRETSecretBradesco OAuth client_secret.
BRADESCO_CERT_PATHAbsolute path to the mTLS client certificate (.crt or .pem). BACEN mandates mTLS for Pix v2.
BRADESCO_KEY_PATHSecretAbsolute path to the mTLS private key (.key or .pem).
BRADESCO_ENVEnvironment: 'sandbox' or 'production'. Defaults to 'sandbox'.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-bradesco0.2.0-alpha.3

Tools

22

Saved tool list · updated 2w ago

This tool takes no parameters.

Details

From the project README

@codespar/mcp-bradesco

MCP server for Bradesco — Brazil's 2nd largest private bank (after Itaú).

Together with @codespar/mcp-itau, @codespar/mcp-banco-inter, and @codespar/mcp-stark-bank, this covers the major BR private-bank API landscape. Merchants with meaningful Pix, boleto, and cash-management volume integrate directly with Bradesco instead of going through a PSP.

Status: alpha (0.1.0-alpha.1)

Bradesco's Developer Portal is contract-gated — the full OpenAPI specs for Pix, Cobrança, Arrecadação, and Extrato are only visible to onboarded merchants. The endpoint paths in this server are best-guesses based on (a) BACEN Pix v2 standard paths, (b) Bradesco's public integration guides, and (c) conventions shared across Itaú / Santander / BB. 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 merchant can validate.

Tools (22)

ToolPurpose
get_oauth_tokenMint or return a cached OAuth2 client_credentials bearer token for the Bradesco Developer Portal.
send_pixInitiate an outbound Pix payment from the merchant's Bradesco account.
create_pix_qrCreate a dynamic Pix charge with QR code (cob).
get_pixRetrieve a Pix transaction by its BCB endToEndId (E).
resolve_dict_keyResolve a DICT key (CPF, CNPJ, email, phone, EVP) to the owner's account data before sending a Pix.
refund_pixRefund (devolução) a previously received Pix.
create_boletoIssue a boleto via Bradesco Cobrança.
get_boletoRetrieve a boleto by its Bradesco identifier (id or nosso_numero).
cancel_boletoCancel (baixa) an outstanding boleto before payment.
get_statementRetrieve account statement transactions for a given period.
arrecadacao_payPay a utility, tax, or concessionária bill via Bradesco Arrecadação.
list_pix_receivedList Pix transactions received by the merchant during a period.
create_pix_due_chargeCreate a Pix charge with a due date (cobv) — commonly used for installments and scheduled invoices.
get_pix_due_chargeRetrieve a Pix due charge (cobv) by txid.
update_pix_due_chargePatch a Pix due charge (cobv) — revise amount, due date, discount, or debtor before payment.
register_dict_keyRegister a DICT key (CPF, CNPJ, email, phone, or EVP) pointing to a merchant account at Bradesco.
delete_dict_keyDelete (unlink) a DICT key that points to a merchant account at Bradesco.
list_boletosList boletos issued by the merchant filtered by status and issue/due period.
get_boleto_pdfDownload the boleto PDF as base64.
get_account_balanceRetrieve the current available balance (saldo disponível) for a merchant account.
transfer_tedExecute a TED (or TEF when intra-Bradesco) transfer from the merchant's account to a beneficiary bank account.
pay_tax_darfPay a federal tax (DARF) or union fee (GRU) via Bradesco Arrecadação.

Install

npm install @codespar/[email protected]

Environment

BRADESCO_CLIENT_ID="..."       # OAuth client_id from Bradesco's Developer Portal
BRADESCO_CLIENT_SECRET="..."   # OAuth client_secret
BRADESCO_CERT_PATH="/abs/path/to/client.crt"   # mTLS client certificate
BRADESCO_KEY_PATH="/abs/path/to/client.key"    # mTLS private key
BRADESCO_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 Bradesco enforces it across product families. 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 Bradesco Developer Portal after your merchant contract is signed. They are distinct from the OAuth credentials.

Base URLs

  • Production: https://proxy.api.prebanco.com.br (Bradesco's standard external proxy)
  • Sandbox: https://apihom-bradescorip.bradesco.com.br (homologação)

Both hosts are marked TODO(verify) — Bradesco provisions per-merchant subdomains in some product families and the exact homologação host may differ. Fork and override BASE_URL if your portal provisioning differs.

Run

# stdio (default)
npx @codespar/mcp-bradesco

# HTTP transport
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-bradesco

Caveats

  • Paths are unverified. See the TODO(verify) markers in src/index.ts. Onboarded merchants should validate against their portal-issued OpenAPI spec and open a PR.
  • Base URLs are best-guess. See above — override if your provisioning differs.
  • Arrecadação barcode validation is server-side in this alpha — no client-side mod-10 / mod-11 check yet.

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.