mcp-brasil
An MCP server that exposes Brazilian public data — IBGE, Banco Central, INMET, Câmara dos Deputados (and Senado per README) — as tools for AI assistants like Claude.
IBGE/SIDRA: population and GDP for a state (UF) or Brazil, municipality search by name, and generic queries to any SIDRA aggregate/variable.
Banco Central: SGS time series (Selic, IPCA, CDI, IGP-M, etc.), PTAX exchange rates for a currency over N days, list of available currencies, and Boletim Focus market expectations (Selic, IPCA, PIB, câmbio).
INMET: list automatic/conventional weather stations (open) and fetch hourly observed data from a station (requires an
INMET_TOKEN).Câmara dos Deputados: list/filter federal deputies (UF, party, name, legislature), deputy details by ID, search legislative propositions (year, keywords, type), and list votes on a proposition.
Senado Federal (mentioned in README, not in the provided schema): senators in office, legislative matters, and nominal votes.
Operational extras: stdio or streamable-HTTP transport, optional bearer-token auth for HTTP, input validation, 10-minute TTL cache, retries on network/429/5xx errors, and structured output for some tools.
Click on "Deploy 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., "@mcp-brasil Qual foi o IPCA dos últimos 6 meses?"
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.
mcp-brasil
MCP (Model Context Protocol) server that exposes Brazilian public data as tools for AI assistants: Claude Desktop, Claude Code, Cursor, and any MCP client.
Available tools
Source | Tools | Description |
IBGE/SIDRA |
| Population, GDP, municipality search, and generic query to any SIDRA aggregate |
Central Bank |
| SGS time series (Selic, IPCA...), PTAX exchange rates, currency list, and Focus Bulletin expectations |
INMET |
| List of weather stations and observed hourly data (observational data requires a token) |
Chamber of Deputies |
| Deputies, legislative bills, and votes |
All sources are official open APIs — no API key required, except for INMET hourly data (see below).
Related MCP server: ibge-data-mcp
Installation
Requirements: uv (or Python 3.12+ with pip).
git clone https://github.com/lucianoon/mcp-brasil
cd mcp-brasil
uv syncConfiguration
Claude Desktop / Cursor
Add to the configuration file (claude_desktop_config.json or mcp.json):
{
"mcpServers": {
"mcp-brasil": {
"command": "uv",
"args": ["run", "--directory", "/caminho/para/mcp-brasil", "mcp-brasil"]
}
}
}Claude Code
claude mcp add mcp-brasil -- uv run --directory /caminho/para/mcp-brasil mcp-brasilOptional INMET token
Station listing (inmet_estacoes) is open. However, observed hourly data
(inmet_dados) requires a token provided by INMET — request it at
portal.inmet.gov.br and set the environment variable in the MCP client:
{
"mcpServers": {
"mcp-brasil": {
"command": "uv",
"args": ["run", "--directory", "/caminho/para/mcp-brasil", "mcp-brasil"],
"env": { "INMET_TOKEN": "seu-token" }
}
}
}Without the token, the other 13 tools work normally.
Usage examples
After configuring, ask the assistant directly:
"What was the IPCA for the last 6 months?"
"What does the market expect for Selic at the next meetings?" (Focus Bulletin)
"Who are the federal deputies from Minas Gerais of party X?"
"What is the population of São Paulo in 2022? And the GDP?"
"How is the PTAX dollar doing in recent days?"
"Search for 2025 bills on mental health"
"Which automatic INMET stations exist in Amazonas?"
Development
uv sync --dev
uv run pytest
uv run ruff check .
uv run mypy srcArchitecture
src/mcp_brasil/
├── server.py # Servidor MCP e registro das tools
├── http.py # Cliente HTTP compartilhado, retry e tratamento de erros
├── cache.py # Cache TTL em memória para as respostas das APIs
└── tools/
├── ibge.py # SIDRA v3 + localidades v1
├── bcb.py # SGS + Olinda (PTAX e Boletim Focus)
├── inmet.py # Estações e dados observacionais
└── camara.py # Dados Abertos da Câmara v2stdio transport (MCP desktop standard)
10-minute TTL cache per identical request
Automatic retry on network failures
Outputs formatted as model-readable text
Roadmap
v0.2 — INMET (stations + observational with token) and Focus Bulletin
DOU: search in the Official Gazette of the Union (waiting for a stable public API)
TSE: election results
Publication on PyPI (
uvx mcp-brasil)Optional streamable-http transport
License
MIT
Available Tools
14 toolsbcb_cambioA
Cotações de câmbio PTAX do Banco Central para uma moeda nos últimos N dias.
Args: moeda: Símbolo da moeda (ex.: "USD", "EUR", "GBP"). Use a tool bcb_moedas para listar as moedas disponíveis. dias: Quantidade de dias úteis de cotação a retornar (padrão 7).
Inputs: dias, moeda. Returns: result
bcb_focusB
Expectativas de mercado do Boletim Focus (Boletim Focus) do Banco Central.
Mostra a projeção média dos analistas de mercado para os próximos períodos.
Args: indicador: Um de: "selic", "ipca", "pib" ou "cambio".
Inputs: indicador. Returns: result
bcb_moedasA
Lista as moedas com cotação PTAX disponíveis no Banco Central.
Inputs: no named parameters. Returns: result
bcb_serieA
Consulta séries temporais do Sistema Gerenciador de Séries (SGS) do Banco Central.
Args: codigo: Código da série SGS. Exemplos: 1178 (Selic meta), 433 (IPCA mensal), 13522 (IPCA acumulado em 12 meses), 4390 (CDI), 36 (salário mínimo), 189 (IGP-M), 206 (INPC). Catálogo: https://www3.bcb.gov.br/sgspub/ data_inicial: Data inicial ISO "AAAA-MM-DD". Padrão: últimos 90 dias. data_final: Data final ISO "AAAA-MM-DD". Padrão: hoje.
Inputs: codigo (required), data_final, data_inicial. Returns: result
camara_deputadosA
Lista deputados federais da Câmara com filtros opcionais.
Args: uf: Sigla da unidade federativa, ex.: "SP", "MG". partido: Sigla do partido, ex.: "PT", "PSDB". nome: Nome (total ou parcial) do parlamentar. legislatura: Número da legislatura (ex.: 57 para a atual). Padrão: atual.
Inputs: uf, nome, partido, legislatura. Returns: result
camara_detalhes_deputadoA
Detalhes de um deputado federal pelo ID: nome civil, partido, UF e gabinete.
Args: id_deputado: ID numérico do deputado (obtido via camara_deputados).
Inputs: id_deputado (required). Returns: result
camara_proposicoesB
Busca proposições legislativas na Câmara (projetos de lei, emendas etc.).
Args: ano: Ano de apresentação, ex.: 2025. palavras_chave: Palavras-chave na ementa, ex.: "saude mental". sigla_tipo: Sigla do tipo, ex.: "PL", "PEC", "MPV".
Inputs: ano, sigla_tipo, palavras_chave. Returns: result
camara_votacoes_proposicaoA
Lista as votações realizadas para uma proposição específica da Câmara.
Args: id_proposicao: ID numérico da proposição (obtido via camara_proposicoes).
Inputs: id_proposicao (required). Returns: result
ibge_municipiosA
Busca municípios brasileiros pelo nome (IBGE), com filtro opcional por UF.
Args: nome: Nome (total ou parcial) do município, ex.: "campinas". uf: Sigla opcional da UF para restringir a busca, ex.: "SP".
Inputs: nome (required), uf. Returns: result
ibge_pibA
PIB a preços correntes de uma unidade da federação ou do Brasil (IBGE/SIDRA).
Args: uf: Sigla da UF (ex.: "MG", "BA") ou "BR" para o total nacional. ano: Ano de referência. Se omitido, retorna o período mais recente disponível.
Inputs: uf, ano. Returns: result
ibge_populacaoA
População residente de uma unidade da federação ou do Brasil (IBGE/SIDRA).
Args: uf: Sigla da UF (ex.: "SP", "RJ") ou "BR" para o total nacional. ano: Ano de referência. Se omitido, retorna o período mais recente disponível.
Inputs: uf, ano. Returns: result
ibge_sidraA
Consulta genérica à API SIDRA do IBGE para qualquer indicador.
Args: agregado: ID do agregado SIDRA (ex.: "4709" população, "5938" PIB, "1737" inflação INPC). Consulte https://servicodados.ibge.gov.br/api/v3/agregados para a lista completa. variavel: ID da variável dentro do agregado (ex.: "93"). localidades: Filtro de localidades no formato SIDRA, ex.: "N1[1]" Brasil, "N3[35]" São Paulo (estado), "N6[3550308]" Campinas (município). periodos: Períodos, ex.: "-1" (último), "2022", "2020/2024".
Inputs: agregado (required), variavel (required), periodos, localidades. Returns: result
inmet_dadosA
Dados horários observados de uma estação automática do INMET (últimos dias).
Requer o ambiente INMET_TOKEN com token fornecido pelo INMET (solicite em https://portal.inmet.gov.br). Sem token, use inmet_estacoes.
Args: estacao: Código da estação, ex.: "A001". Liste códigos com inmet_estacoes. dias: Quantidade de dias retroativos a consultar (padrão 2, máximo 7).
Inputs: estacao (required), dias. Returns: result
inmet_estacoesA
Lista estações meteorológicas do INMET (não requer autenticação).
Args: tipo: "T" para estações automáticas ou "M" para convencionais. uf: Sigla opcional da UF para filtrar, ex.: "SP".
Inputs: uf, tipo. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool targets a distinct resource and action (e.g., population vs PIB vs municipalities vs generic SIDRA), and within each source (IBGE, BCB, INMET, Camara) the functions are clearly separated—list vs details vs votes. There is no meaningful overlap that would cause an agent to misselect.
All tools follow a consistent 'source_noun' pattern with snake_case (ibge_populacao, bcb_serie, inmet_estacoes, camara_deputados). The only slight variation is the use of singular vs plural nouns, but this is a natural linguistic choice and does not break the overall consistency.
With 14 tools, the server is well-scoped for its purpose of aggregating Brazilian public data across four distinct domains. No tool feels redundant, and the count is within the optimal 3–15 range, striking a good balance between breadth and focus.
Each domain is reasonably covered: IBGE has core indicators plus generic SIDRA, BCB has time series, exchange rates, currency list, and market focus, INMET has stations and data (with token gate), and Camara offers deputies, details, propositions, and votes. Minor gaps exist (e.g., no Camara session coverage, no direct inflation series), but the generic SIDRA tool compensates for many potential lacks, and the core workflows are achievable.
Maintenance
Related MCP Connectors
IBGE: geography, census, economy and health from the official APIs, with provenance. 23 tools.
Brazilian public data API for AI agents. BCB, IBGE, CVM, B3, compliance. x402 payments on Base.
Banco Central do Brasil (BCB): SGS series, Focus expectations, PTAX, stats + provenance. 17 tools.
Brazil CNPJ, CEP, Selic/IPCA/PTAX, holidays, banks/ISPB for agents. Pay per call in USDC (x402).
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceConnects AI agents to 28 Brazilian public APIs, providing over 200 tools to access data on economy, legislation, transparency, and the judiciary. It enables complex queries and cross-referencing of government datasets like IBGE, the Central Bank, and the National Congress through natural language.MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to access Brazilian IBGE statistical data (population, economy, agriculture) via natural language, with tools for querying aggregated data and metadata.-
- AlicenseAqualityDmaintenanceEnables AI agents to access Brazilian statistical, geographic, and economic data in real-time via IBGE public APIs.32MIT
- AlicenseNot gradedqualityBmaintenanceEnables agents to query 153 live Brazilian government data tools across federal and state sources, including economy, legislature, judiciary, elections, health, education, and more, reading directly from original APIs.MIT