ibge-br-mcp
This MCP server provides 22 tools for live, authoritative access to Brazilian public data from IBGE and other sources. Key capabilities include:
Geography & Localities
List states (with region filtering) and all 5,570 municipalities
Get locality details, decode/search IBGE codes, find neighboring municipalities
Census & Demographics
Query Census data (1970β2022) across 16 themes (population, literacy, housing, race, income, etc.)
Real-time population projection with birth/death rates
Name frequency and rankings by decade, sex, and locality
Statistical & Economic Data
Query SIDRA tables (Census, PNAD, GDP, etc.) with metadata and territorial filtering
Economic/social indicators: GDP, IPCA, INPC, unemployment, income, population density
Compare up to 10 municipalities or states on key indicators
Municipal & International Data
Municipal indicators via the Cidades@ portal (HDI, GDP per capita, enrollment, mortality, etc.)
Country data following UN M49 methodology, filterable by continent
Maps & Classifications
Administrative meshes in GeoJSON, TopoJSON, or SVG at various resolutions
Thematic meshes: biomes, Legal Amazon, semi-arid, coastal zones, metropolitan regions
CNAE economic activity lookup across all hierarchy levels
Health & Finance
Health indicators via DataSUS (infant mortality, life expectancy, fertility, sanitation)
Central Bank of Brazil (BCB) data: SELIC, CDI, exchange rates, public debt, reserves
News & Calendar
IBGE news and press releases with date/type filtering
Upcoming data release and field collection schedule (IPCA, PNAD, GDP, etc.)
Infrastructure: automatic caching with configurable TTL, exponential backoff retries, and input validation.
ibge-br-mcp
Live, exact Brazilian public data for your AI assistant β with provenance, not guesswork.
Ask an LLM "what was Belo Horizonte's population in the 2022 Census?" and you get a plausible number from its training data: maybe right, maybe outdated, with no source. ibge-br-mcp instead has your assistant query the official IBGE APIs in real time β returning the exact figure together with the table and period it came from.
π§π· Leia em PortuguΓͺs
This server implements the Model Context Protocol (MCP) to give AI assistants live, structured access to Brazil's public geographic, demographic, economic, and health data β sourced from the IBGE APIs (including health indicators served through IBGE's SIDRA system).
Features
22 specialized tools covering all major IBGE data domains
Reference resources & analysis prompts (MCP catalogs + ready-made templates)
460 automated tests with 97%+ core coverage
Automatic caching with configurable TTL for optimal performance
Retry mechanism with exponential backoff for network resilience
Comprehensive validation for all input parameters
Standardized error handling with helpful suggestions
Full TypeScript support with strict typing
Related MCP server: Brazilian CEP MCP
Available Tools
Localities & Geography
Tool | Description |
| List Brazilian states with region filtering |
| List municipalities by state or search by name |
| Get details of a locality by IBGE code |
| Decode IBGE codes or search codes by name |
| Find neighboring municipalities |
Statistical Data (SIDRA)
Tool | Description |
| Query SIDRA tables (Census, PNAD, GDP, etc.) |
| List and search available SIDRA tables |
| Get table metadata (variables, periods, levels) |
| List IBGE research surveys and their tables |
Economic & Social Indicators
Tool | Description |
| Economic and social indicators (GDP, IPCA, unemployment) |
| Census data (1970-2022) with 16 themes |
| Compare indicators across localities with rankings |
Municipal Data (Cidades@)
Tool | Description |
| Municipal indicators (population, HDI, GDP per capita, etc.) |
International Data
Tool | Description |
| Country data following UN M49 methodology |
Demographics
Tool | Description |
| Real-time Brazilian population projection |
| Name frequency and rankings in Brazil |
Classifications
Tool | Description |
| CNAE (National Classification of Economic Activities) |
Maps & Geographic Meshes
Tool | Description |
| Geographic meshes (GeoJSON, TopoJSON, SVG) |
| Thematic meshes (biomes, Legal Amazon, semi-arid) |
Health
Tool | Description |
| Health indicators via IBGE's SIDRA |
News & Calendar
Tool | Description |
| IBGE news and press releases |
| IBGE release and collection calendar |
Which tool should I use?
With 22 tools, several can touch the same topic. Quick guide for the common overlaps:
Population & demographics
You want⦠| Use |
Brazil's population right now (real-time) |
|
A single municipality/state panel (population, HDI, GDPβ¦) |
|
Census data or historical series (1970β2022) |
|
Rank/compare 2β10 localities on one indicator |
|
A macro indicator time series (GDP, IPCA, unemploymentβ¦) |
|
A specific SIDRA table / fine control |
|
Economic indicators
You want⦠| Use |
IPCA, INPC, GDP, unemployment (IBGE, primary source) |
|
Localities & codes
You want⦠| Use |
List/search municipalities |
|
List states |
|
Resolve a nameβcode at any level, or decode a code's structure |
|
Full record of one locality you already have the code for |
|
Neighboring municipalities |
|
SIDRA workflow
Discover β inspect β query: ibge_pesquisas / ibge_sidra_tabelas (find a table) β ibge_sidra_metadados (its structure) β ibge_sidra (query). For common data, the wrappers above (ibge_censo, ibge_indicadores, ibge_comparar, ibge_cidades) are usually easier.
Maps (meshes)
You want⦠| Use |
Administrative outlines (Brazil/region/state/municipality) |
|
Thematic areas (biomes, Legal Amazon, semi-arid, metro regions) |
|
Installation
Prerequisites
Node.js 18.x or higher
npm or yarn
From npm (recommended)
npm install -g ibge-br-mcpFrom source
# Clone the repository
git clone https://github.com/SidneyBissoli/ibge-br-mcp.git
cd ibge-br-mcp
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
Claude Desktop
Add to your Claude Desktop configuration file (claude_desktop_config.json):
{
"mcpServers": {
"ibge-br-mcp": {
"command": "npx",
"args": ["ibge-br-mcp"]
}
}
}Or if installed from source:
{
"mcpServers": {
"ibge-br-mcp": {
"command": "node",
"args": ["/path/to/ibge-br-mcp/dist/index.js"]
}
}
}Claude Code
{
"mcpServers": {
"ibge-br-mcp": {
"command": "npx",
"args": ["ibge-br-mcp"]
}
}
}Tool Usage Examples
ibge_estados
List all Brazilian states.
# List all states
ibge_estados
# States in Northeast region
ibge_estados(regiao="NE")
# States sorted by abbreviation
ibge_estados(ordenar="sigla")ibge_municipios
List Brazilian municipalities.
# Municipalities of SΓ£o Paulo state
ibge_municipios(uf="SP")
# Search municipalities by name
ibge_municipios(busca="Campinas")
# Municipalities in MG containing "Belo"
ibge_municipios(uf="MG", busca="Belo")ibge_cidades
Query municipal indicators (similar to Cidades@ portal).
# Panorama of SΓ£o Paulo
ibge_cidades(tipo="panorama", municipio="3550308")
# Population history
ibge_cidades(tipo="historico", municipio="3550308", indicador="populacao")
# List available research
ibge_cidades(tipo="pesquisas")Available indicators: populacao, area, densidade, pib_per_capita, idh, escolarizacao, mortalidade, salario_medio, receitas, despesas
ibge_paises
Query international country data.
# List all countries
ibge_paises(tipo="listar")
# Brazil details
ibge_paises(tipo="detalhes", pais="BR")
# Search countries
ibge_paises(tipo="buscar", busca="Argentina")
# Countries in Americas
ibge_paises(tipo="listar", regiao="americas")Regions: americas, europa, africa, asia, oceania
ibge_sidra
Query SIDRA tables (IBGE's Automatic Recovery System).
# Brazil population in 2023
ibge_sidra(tabela="6579", periodos="2023")
# Population by state
ibge_sidra(tabela="6579", nivel_territorial="3", periodos="2023")
# Census 2022 for SΓ£o Paulo municipality
ibge_sidra(tabela="9514", nivel_territorial="6", localidades="3550308")Common tables:
Code | Description |
6579 | Population estimates (annual) |
9514 | Census 2022 population |
4714 | Unemployment rate (PNAD) |
6706 | GDP at current prices |
Territorial levels:
Code | Level |
1 | Brazil |
2 | Region (North, Northeast, etc.) |
3 | State (UF) |
6 | Municipality |
7 | Metropolitan Region |
106 | Health Region |
127 | Legal Amazon |
128 | Semi-arid |
ibge_censo
Query Census data (1970-2022).
# Population Census 2022
ibge_censo(ano="2022", tema="populacao")
# Historical population series
ibge_censo(ano="todos", tema="populacao")
# Literacy by state in 2010
ibge_censo(ano="2010", tema="alfabetizacao", nivel_territorial="3")Available themes: populacao, alfabetizacao, domicilios, idade_sexo, religiao, cor_raca, rendimento, migracao, educacao, trabalho
ibge_indicadores
Query economic and social indicators.
# GDP
ibge_indicadores(indicador="pib")
# IPCA last 12 months
ibge_indicadores(indicador="ipca", periodos="last 12")
# Unemployment by state
ibge_indicadores(indicador="desemprego", nivel_territorial="3")
# List all indicators
ibge_indicadores(indicador="listar")Available indicators:
Category | Indicators |
Economic | pib, pib_variacao, pib_per_capita, industria, comercio, servicos |
Prices | ipca, ipca_acumulado, inpc |
Labor | desemprego, ocupacao, rendimento, informalidade |
Population | populacao, densidade |
Agriculture | agricultura, pecuaria |
ibge_nomes
Query name frequency and rankings.
# Frequency of "Maria"
ibge_nomes(tipo="frequencia", nomes="Maria")
# Compare names
ibge_nomes(tipo="frequencia", nomes="JoΓ£o,JosΓ©,Pedro")
# Ranking of names in 2000s
ibge_nomes(tipo="ranking", decada=2000)
# Female names ranking
ibge_nomes(tipo="ranking", sexo="F")ibge_malhas
Get geographic meshes (maps).
# Brazil with states
ibge_malhas(localidade="BR", resolucao="2")
# SΓ£o Paulo with municipalities
ibge_malhas(localidade="SP", resolucao="5")
# Specific municipality
ibge_malhas(localidade="3550308")
# SVG format
ibge_malhas(localidade="BR", formato="svg")Resolution levels:
Value | Internal Divisions |
0 | No divisions (outline only) |
2 | States |
5 | Municipalities |
datasaude
Query Brazilian health indicators served through IBGE's SIDRA (some originally produced by DataSUS, e.g. mortality and births).
# Infant mortality in Brazil
datasaude(indicador="mortalidade_infantil")
# Life expectancy by state
datasaude(indicador="esperanca_vida", nivel_territorial="3")
# List indicators
datasaude(indicador="listar")Available indicators: mortalidade_infantil, esperanca_vida, nascidos_vivos, obitos, fecundidade, saneamento_agua, saneamento_esgoto, plano_saude
APIs Used
IBGE APIs
Localities:
servicodados.ibge.gov.br/api/v1/localidadesNames:
servicodados.ibge.gov.br/api/v2/censos/nomesAggregates/SIDRA:
servicodados.ibge.gov.br/api/v3/agregadosSIDRA API:
apisidra.ibge.gov.br/valuesMeshes:
servicodados.ibge.gov.br/api/v3/malhasNews:
servicodados.ibge.gov.br/api/v3/noticiasPopulation:
servicodados.ibge.gov.br/api/v1/projecoes/populacaoCNAE:
servicodados.ibge.gov.br/api/v2/cnaeCalendar:
servicodados.ibge.gov.br/api/v3/calendarioCountries:
servicodados.ibge.gov.br/api/v1/paisesResearch:
servicodados.ibge.gov.br/api/v1/pesquisas
Development
# Build
npm run build
# Watch mode
npm run watch
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Lint
npm run lint
# Format
npm run format
# Test with MCP inspector
npm run inspectorProject Structure
ibge-br-mcp/
βββ src/
β βββ index.ts # Main MCP server
β βββ types.ts # TypeScript types
β βββ config.ts # Configuration and constants
β βββ cache.ts # Request caching system
β βββ retry.ts # Retry with exponential backoff
β βββ errors.ts # Standardized error handling
β βββ validation.ts # Input validation helpers
β βββ metrics.ts # Metrics and logging
β βββ utils/
β β βββ formatters.ts # Formatting utilities
β βββ tools/
β βββ index.ts # Tool exports
β βββ estados.ts # ibge_estados
β βββ municipios.ts # ibge_municipios
β βββ localidade.ts # ibge_localidade
β βββ geocodigo.ts # ibge_geocodigo
β βββ censo.ts # ibge_censo
β βββ populacao.ts # ibge_populacao
β βββ sidra.ts # ibge_sidra
β βββ sidra-tabelas.ts # ibge_sidra_tabelas
β βββ sidra-metadados.ts# ibge_sidra_metadados
β βββ indicadores.ts # ibge_indicadores
β βββ cnae.ts # ibge_cnae
β βββ calendario.ts # ibge_calendario
β βββ comparar.ts # ibge_comparar
β βββ malhas.ts # ibge_malhas
β βββ malhas-tema.ts # ibge_malhas_tema
β βββ vizinhos.ts # ibge_vizinhos
β βββ datasaude.ts # datasaude
β βββ pesquisas.ts # ibge_pesquisas
β βββ nomes.ts # ibge_nomes
β βββ noticias.ts # ibge_noticias
β βββ paises.ts # ibge_paises
β βββ cidades.ts # ibge_cidades
βββ tests/ # Test files
βββ dist/ # Compiled files
βββ package.json
βββ tsconfig.json
βββ vitest.config.ts
βββ README.mdTesting
The project includes a comprehensive test suite with 227 tests covering:
Validation functions
Retry mechanism
Formatting utilities
Error handling
Cache operations
Integration tests with mocks
npm testQuality Assurance
This project maintains high code quality standards:
227 automated tests covering validation, caching, retry logic, formatting, and integrations
97%+ test coverage on core modules (cache, validation, errors, types)
ESLint for code linting with zero warnings
Prettier for consistent code formatting
TypeScript strict mode for type safety
Automated CI/CD via GitHub Actions
Run tests locally:
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run linter
npm run lintLicense
MIT
Author
Sidney da Silva Pereira Bissoli
References
Maintenance
Latest Blog Posts
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/SidneyBissoli/ibge-br-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server