openfinance-br-mcp
Allows interaction with Nubank accounts via Open Finance Brasil, providing tools to list accounts, get balances, transactions, credit cards, bills, PIX keys, initiate PIX, and list investments.
Provides tools to list PIX keys and initiate PIX payments with idempotency through the Open Finance Brasil APIs.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openfinance-br-mcpwhat's my Nubank account balance?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
English · Português
openfinance-br-mcp
Experimental MCP server for Open Finance Brasil, with a complete mock environment and an evolving implementation toward FAPI-BR integration. Not certified, and not yet validated against real institutions - see VALIDATION.md and the implementation plan in
IMPLEMENTATION_PLAN.mdbefore relying on this outsideenvironment=mock.
What it is
An MCP Server that abstracts away the complexity of Open Finance Brasil (FAPI 1.0 Advanced, OAuth2, consent, mTLS) and exposes simple tools to Claude:
Claude → "how much did I spend on food in March?"
Claude uses list_transactions(bank=nubank, categorize=true, date_from=2024-03-01)
Claude → "You spent R$ 847.30 on food in March..."Related MCP server: MCP Conta Azul
Supported banks
Mock adapters are implemented for the ten institutions below - each returns realistic, in-memory sample data with zero credentials or network access, and is the primary way to explore this project today. Real (non-mock) support is experimental: it has not been exercised against any bank's actual sandbox or production environment, is not FAPI-BR certified, and several endpoints/paths are still being brought in line with the official OpenAPI specs (tracked in IMPLEMENTATION_PLAN.md).
Bank | ISPB | Mock adapter | Real integration |
Nubank | 18236120 | ✅ | experimental, unvalidated |
Sicoob | 04891850 | ✅ | experimental, unvalidated |
Caixa Econômica | 00360305 | ✅ | experimental, unvalidated |
Banco do Brasil | 00000000 | ✅ | experimental, unvalidated |
Bradesco | 60746948 | ✅ | experimental, unvalidated |
Itaú Unibanco | 60701190 | ✅ | experimental, unvalidated |
Santander | 90400888 | ✅ | experimental, unvalidated |
XP | 33264668 | ✅ | experimental, unvalidated |
PicPay | 22896431 | ✅ | experimental, unvalidated |
BTG Pactual | 30306294 | ✅ | experimental, unvalidated |
PIX payment initiation (initiate_pix) and list_pix_keys are currently restricted to environment=mock, the real Open Finance Brasil Payments API journey (dedicated payment consent, signed JWS requests/responses, persistent idempotency) is not yet implemented; see IMPLEMENTATION_PLAN.md, phase P2.
New banks: implement
BankAdapter(or subclassDefaultOpenFinanceAdapter) and register it - see "Adding a new bank" below.
Available MCP tools
Tool | Description | Fase |
| Lists checking, savings, and prepaid accounts | 2 |
| Available, blocked, and invested balance | 2 |
| Statement with filters and DSPy categorization | 2 |
| Credit cards and limits | 2 |
| Open and past bills | 2 |
| Registered PIX keys (mock-only, see below) | 2 |
| Idempotent PIX payment (mock-only, see below) | 3 |
| Fixed income (CDB, LCI, LCA) | 4 |
| Starts the FAPI-BR consent/authorization flow | - |
| Completes consent after the user authorizes at the bank | - |
| Checks the status of an existing consent | - |
| Revokes an existing consent | - |
Quick start
Prerequisites
Python 3.12+
uv installed
# Clone the repository
git clone https://github.com/brunovicco/openfinance-br-mcp.git
cd openfinance-br-mcp
# Configure the environment
cp .env.example .env
# Edit .env with your CLIENT_ID, CLIENT_SECRET, etc.
# Install dependencies
uv sync
# Run the server
uv run openfinance-mcpClaude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"openfinance-br": {
"command": "uv",
"args": ["run", "--directory", "/path/to/openfinance-br-mcp", "openfinance-mcp"],
"env": {
"CLIENT_ID": "your_client_id",
"CLIENT_SECRET": "your_client_secret",
"MTLS_ENABLED": "false"
}
}
}
}Development
# Install with dev-dependencies
uv sync
# Run the tests
uv run pytest tests/ -v
# Lint and formatting
uv run ruff check src/ tests/
uv run black src/ tests/
# Type check
uv run mypy src/Docker
# Build
docker build -t openfinance-br-mcp .
# Run the tests
docker compose --profile test up
# Run the server
docker compose up openfinance-mcpKubernetes
# Create the namespace
kubectl create namespace fintech
# Apply the configuration (edit the secrets first!)
kubectl apply -f k8s/config-and-secrets.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yamlRuns streamable-http behind 2 replicas, with CLIENT_ID/CLIENT_SECRET/
ANTHROPIC_API_KEY mounted as secret files rather than env vars, and a
shared Redis backend (REDIS_URL) so token/consent state is visible
across replicas.
Architecture
Claude (MCP Client)
│ stdio or streamable-http
▼
openfinance-br-mcp (MCP Server)
├── Auth + Consent (FAPI-BR 2.2.0: private_key_jwt, PAR/JAR, PKCE, mTLS)
├── MCP Tools (12 tools, input validated with Pydantic v2)
│ └── Categorizer (DSPy + Claude for transaction classification)
├── Bank Adapters (10 banks - extensible)
└── Directory Client (resolves real bank endpoints from the BCB
Directory of Participants)
│ HTTPS/mTLS
▼
Open Finance BR (BCB) - Directory of Participants
│
▼
Nubank · Sicoob · Caixa · + 100 participating institutionsDesign principles
SOLID: BankAdapter ABC (O/C, LSP), single-responsibility tools, constructor-based DI
12-Factor: config via env, stateless, logs to stdout
Security: mTLS, SecretStr, in-memory tokens, mandatory PKCE
Idempotency: asyncio.Lock on token refresh, X-Idempotency-Key on PIX
DSPy: transaction categorization framed as an LLM classification problem
Environment variables
Variable | Required | Description |
| ❌ |
|
| ⚠️ non-mock | Client ID registered with the institution |
| ⚠️ non-mock | Client secret |
| ⚠️ non-mock | RSA private key for |
| ⚠️ prod | Path to the mTLS certificate |
| ⚠️ prod | mTLS private key |
| ⚠️ DSPy | Required for |
| ❌ | Shares TokenStore/ConsentManager state across replicas |
| ❌ |
|
| ❌ | Enables tracing to Langfuse (with |
| ❌ | INFO, DEBUG, WARNING (default: INFO) |
| ❌ | json or console (default: json) |
See .env.example for the full list.
Adding a new bank
Create
src/openfinance_br_mcp/adapters/my_bank.pyInherit from
DefaultOpenFinanceAdapter(orBankAdapterdirectly for a fully custom implementation)Override
bank_id, and passbase_url/token_endpointdefaultsAdd its ISPB to
directory/client.py's_ISPB_BY_BANKand register the adapter class incontext.py
Documentation
docs/en/authorization.md - the two token universes (MCP client auth vs. FAPI-BR bank auth), and why they can never cross
CONTRIBUTING.md - dev setup, CI checks, adding a bank adapter
SECURITY.md - scope, disclaimer, and how to report a vulnerability
SOURCES.md - specs and RFCs this implementation follows
VALIDATION.md - what's actually been validated, and what hasn't (no real BCB sandbox run)
CHANGELOG.md - release history
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/brunovicco/openfinance-br-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server