BCB BR MCP

MCP server for Brazilian Central Bank (BCB) economic data — Selic, IPCA, exchange rates, GDP, and 150+ time series for AI agents

BCB BR MCP Server

npm version npm downloads Smithery MCP Registry LobeHub License: MIT

Leia em Português

MCP (Model Context Protocol) server for accessing the Brazilian Central Bank's time series data (SGS/BCB).

Query economic and financial indicators such as Selic (interest rate), IPCA (inflation), exchange rates, GDP, and more, directly from AI assistants like Claude.

If you find this project useful, please consider giving it a star on GitHub. It helps others discover the project!

Features

  • Historical data - Query time series values by code with date filters
  • Latest values - Get the most recent N values of any series
  • Metadata - Detailed information about series (frequency, source, etc.)
  • Popular series catalog - 150+ economic indicators organized in 12 categories
  • Smart search - Find series by keyword (accent-insensitive)
  • Current indicators - Latest values for key economic indicators
  • Variation calculation - Percentage change between periods with statistics
  • Series comparison - Compare multiple series over the same period

Available Tools

ToolDescription
bcb_serie_valoresQuery series values by code and date range
bcb_serie_ultimosGet the last N values of a series
bcb_serie_metadadosGet series metadata (name, frequency, source)
bcb_series_popularesList popular series grouped by category
bcb_buscar_serieSearch series by name or description (accent-insensitive)
bcb_indicadores_atuaisLatest values: Selic, IPCA, USD/BRL, IBC-Br
bcb_variacaoCalculate percentage variation between dates or last N periods
bcb_compararCompare 2 to 5 series over the same period with ranking

Installation

Via Smithery (recommended)

Visit bcb-br-mcp on Smithery and follow the installation instructions for your MCP client.

Via URL (Claude.ai, Claude Desktop, any MCP client)

Use the HTTP endpoint directly, no installation required:

https://bcb.sidneybissoli.workers.dev

Via npx (Claude Desktop)

Add to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "bcb-br": {
      "command": "npx",
      "args": ["-y", "bcb-br-mcp"]
    }
  }
}

Via global install

npm install -g bcb-br-mcp
{
  "mcpServers": {
    "bcb-br": {
      "command": "bcb-br-mcp"
    }
  }
}

Usage Examples

Get the current Selic rate

What is the current Selic interest rate?
→ Uses bcb_indicadores_atuais

IPCA history for 2024

Show me the monthly IPCA for 2024
→ Uses bcb_serie_valores with code 433, dataInicial 2024-01-01, dataFinal 2024-12-31

List inflation indicators

What inflation series are available?
→ Uses bcb_series_populares with category "Inflação"

Search for USD exchange rate series

Search for series related to the dollar
→ Uses bcb_buscar_serie with term "dolar" (works without accents)

Calculate USD/BRL variation

What was the USD/BRL variation over the last 12 months?
→ Uses bcb_variacao with code 1 and periodos 12

Compare IPCA, IGP-M, and INPC

Compare IPCA, IGP-M, and INPC in 2024
→ Uses bcb_comparar with codes [433, 189, 188], dataInicial 2024-01-01, dataFinal 2024-12-31

Series Catalog (150+)

The server includes a catalog of 150+ series organized in 12 categories.

Interest Rates

CodeDescription
11Selic rate - monthly accumulated
432Selic rate - annualized (base 252)
1178Selic target rate (Copom)
12CDI daily rate
4389CDI annualized (base 252)
226Reference Rate (TR) - daily
256Long-Term Interest Rate (TJLP)

Inflation (30+ series)

CodeDescription
433IPCA - Monthly change
13522IPCA - 12-month accumulated
7478IPCA-15 - Monthly change
188INPC - Monthly change
189IGP-M - Monthly change
190IGP-DI - Monthly change
7447IGP-10 - Monthly change
10841-10850IPCA by group (Food, Housing, Transportation, etc.)
4449IPCA - Administered prices
11428IPCA - Market prices
16121-16122IPCA - Core measures

Exchange Rates (15+ series)

CodeDescription
1USD/BRL - US Dollar (sell)
10813USD/BRL - US Dollar (buy)
3698/3697USD/BRL PTAX (sell/buy)
21619/21620EUR/BRL - Euro (sell/buy)
21623/21624GBP/BRL - British Pound (sell/buy)
21621/21622JPY/BRL - Japanese Yen (sell/buy)
21637/21638ARS/BRL - Argentine Peso (sell/buy)
21639/21640CNY/BRL - Chinese Yuan (sell/buy)

Economic Activity (25+ series)

CodeDescription
4380Monthly GDP (R$ millions)
4382GDP - 12-month accumulated (R$ millions)
4385Monthly GDP in USD
7324Annual GDP in USD
24363/24364IBC-Br Economic Activity Index (unadjusted/seasonally adjusted)
29601-29606IBC-Br by sector (Agriculture, Industry, Services)
22099Quarterly GDP - Rate of change
21859Industrial production - Monthly change
21862Installed capacity utilization

Employment (10+ series)

CodeDescription
24369Unemployment rate - PNAD
24370Labor force participation rate
24380Average real income
24381Real income mass
28561CAGED - Formal job creation

Fiscal (10+ series)

CodeDescription
4503Net public sector debt (% GDP)
4513General government gross debt (% GDP)
4537Primary balance (% GDP)
4539Nominal balance (% GDP)
5364Central government total revenue

External Sector (15+ series)

CodeDescription
3546International reserves - daily
22707Trade balance - Monthly
22708Exports - Monthly
22709Imports - Monthly
22701Current account - Balance
22846Foreign direct investment
13690Total external debt

Credit (30+ series)

CodeDescription
20539Total credit balance
20540/20541Credit balance - Individuals/Corporations
20714Average interest rate - Total
20749Average rate - Vehicle financing
20772Average rate - Mortgage
20783Average spread - Total
21082Default rate - Total
21128/21129Default rate - Credit card

Monetary Aggregates

CodeDescription
1788Monetary base
27788-27791Money supply M1, M2, M3, M4
27815Money multiplier

Savings

CodeDescription
25Savings - Monthly yield
195Savings - Total balance
7165Savings - Net deposits

Market Indices

CodeDescription
12466IMA-B
12467IMA-B5
12468IMA-B5+
7832Ibovespa - Monthly

Expectations (Focus Survey)

CodeDescription
29033/29034IPCA expectation (current/next year)
29035/29036Selic expectation (current/next year)
29037/29038GDP expectation (current/next year)
29039/29040Exchange rate expectation (current/next year)

Finding Other Series

The SGS database contains over 18,000 time series. To find codes for other series:

  1. Visit the BCB SGS Portal
  2. Search for the desired series
  3. Note the series code
  4. Use that code with this server's tools

Technical Details

Robustness

  • Timeout: 30 seconds per request (prevents hanging)
  • Auto-retry: 3 attempts with exponential backoff (1s, 2s, 4s)
  • Error handling: Clear error messages

Smart Search

The bcb_buscar_serie tool normalizes search terms, allowing you to find series even without Portuguese accents:

  • "inflacao" → finds "Inflação"
  • "cambio" → finds "Câmbio"
  • "credito" → finds "Crédito"

Development

Requirements

  • Node.js >= 18.0.0

Setup

git clone https://github.com/SidneyBissoli/bcb-br-mcp.git
cd bcb-br-mcp
npm install

Build

npm run build

Local testing (stdio)

npm run dev

Local testing (HTTP worker)

npm run dev:worker

Or use the MCP Inspector:

npx @modelcontextprotocol/inspector npm run dev

BCB API

This server uses the Brazilian Central Bank's public API:

  • Base endpoint: https://api.bcb.gov.br/dados/serie/bcdata.sgs.{code}/dados
  • Format: JSON
  • Authentication: None (public API)
  • Documentation: BCB Open Data

Changelog

v1.2.0

  • HTTP endpoint via Cloudflare Workers (https://bcb.sidneybissoli.workers.dev)
  • Published on Smithery.ai
  • Refactored: tool logic extracted to src/tools.ts (shared between stdio and HTTP)

v1.1.0

  • New tool bcb_variacao for percentage variation calculation
  • New tool bcb_comparar for comparing multiple series
  • 30-second timeout on requests
  • Auto-retry with exponential backoff (3 attempts)
  • Normalized search (accent-insensitive)
  • Additional statistics (max, min, average, range)

v1.0.0

  • Initial release
  • 6 basic tools
  • Catalog with 150+ series

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

License

MIT - see LICENSE for details.

Author

Sidney da Silva Pereira Bissoli

Useful Links

संबंधित सर्वर