mcp-territorio-brasil
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-territorio-brasil compare population and GDP of São Paulo and Rio de Janeiro"
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-territorio-brasil
Servidor MCP de dados territoriais oficiais do Brasil (IBGE) — com as armadilhas de cruzamento entre bases declaradas na resposta.
Três tools que não mentem, em vez de trinta que não sabem.
O problema que este servidor resolve
Quase toda análise regional no Brasil cruza o IBGE com outra base oficial — DATASUS, CNES, Receita Federal. E o primeiro cruzamento costuma falhar em silêncio:
O código de município do IBGE tem 7 dígitos — o 7º é dígito verificador. O DATASUS e o CNES usam 6 (Canoas/RS =
4304606no IBGE,430460no CNES). Um JOIN direto entre as bases devolve zero linhas, sem erro. A análise parece vazia, não quebrada.
Este servidor devolve os dois códigos em toda resposta e aceita qualquer um deles como entrada.
Related MCP server: ibge-data-mcp
A garantia
Toda resposta segue o phi-data-contract v0.1: data + provenance (fonte, data de coleta,
ano de referência) + caveats (os defeitos que se aplicam àquela consulta, com evidência e data
de verificação) + cannot_answer (o que a pergunta pediu e a fonte não responde).
Instalação
Requer Node ≥ 22.5 (SQLite embutido — zero dependências nativas).
npm install && npm run build
npm run db:build # baixa direto do IBGE (Localidades + SIDRA) e monta o SQLiteNada é redistribuído — a base é construída na sua máquina, sempre da fonte.
{
"mcpServers": {
"territorio": {
"command": "node",
"args": ["--experimental-sqlite", "/caminho/mcp-territorio-brasil/dist/index.js"],
"env": { "TERRITORIO_LANG": "pt" }
}
}
}As tools
Tool | O que faz |
| Município com região imediata/intermediária, população (estimativa + Censo 2022), PIB e PIB per capita. Aceita nome, código de 7 ou de 6 dígitos; |
| Totais de UF, região intermediária ou imediata (nº de municípios, população, PIB) + a lista de municípios. Aceita o código de um município. |
| As armadilhas conhecidas, com evidência e procedência. |
Os caveats
id | Severidade | Corrigido? |
| crítico | ✅ os dois códigos em toda resposta |
| aviso | — as duas séries vêm separadas, com ano |
| aviso | ✅ PIB per capita sobre a população do mesmo período (Censo 2022), nunca sobre a estimativa corrente |
| info | ✅ agrega pela região imediata (divisão oficial desde 2017) |
Fontes
IBGE — API de Localidades (servicodados.ibge.gov.br) e SIDRA (apisidra.ibge.gov.br):
tabelas 6579 (estimativa de população), 4709 (Censo 2022) e 5938 (PIB dos municípios).
npm testMIT · Autor: Luis Delfin · parte da rede de servidores MCP de dados públicos de Phi AI
English
MCP server for Brazil's official territorial data (IBGE) — with cross-dataset traps declared in the response.
The first join between IBGE and another official dataset (DATASUS, CNES, Federal Revenue) usually fails silently: IBGE municipality codes have 7 digits (the 7th is a check digit), DATASUS/CNES use 6. A direct JOIN returns zero rows, no error. This server returns both codes in every response and accepts either as input.
Every response follows phi-data-contract v0.1: data + provenance + caveats + cannot_answer.
Tool | What it does |
| Municipality with immediate/intermediate region, population (estimate + 2022 Census), GDP and GDP per capita. Accepts name, 7- or 6-digit code; |
| Totals for a state, intermediate or immediate region, plus its municipalities. |
| Known traps, with evidence and provenance. |
Requires Node ≥ 22.5. npm install && npm run build && npm run db:build. No data is redistributed.
MIT · Author: Luis Delfin
Available Tools
3 toolsterritorio_data_caveatsB
As armadilhas conhecidas destas bases, com evidência e procedência. Use antes de cruzar com outras bases.
Inputs: id.
territorio_municipioA
Município brasileiro com a hierarquia regional oficial (região imediata e intermediária, UF), população (estimativa anual e Censo 2022) e PIB municipal. Aceita nome (sem acento, parcial), código IBGE de 7 dígitos ou código DATASUS/CNES de 6 dígitos — e devolve os dois códigos. Use codes para resolver muitos de uma vez.
Inputs: uf, codes, limit, query.
territorio_regiaoA
Totais de uma região — UF, região geográfica intermediária ou imediata (divisão oficial desde 2017): nº de municípios, população e PIB, mais a lista de municípios. Aceita o código de um município para devolver a região dele.
Inputs: codigo (required), nivel, incluir_municipios.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct level of data: municipality, region, and data caveats. Although both municipio and regiao can reveal a municipality's region, their outputs and purposes are clearly differentiated. No ambiguity exists.
All tools follow the same `territorio_<entity>` snake_case pattern, making the set predictable and easy to navigate. The naming convention is uniform across all three tools.
Three tools is a focused, well-scoped set for a Brazilian territory data server. Each tool addresses a distinct need without redundancy or bloat.
The server covers municipality-level data, regional aggregates, and data-quality caveats, which covers the core needs for querying official Brazilian territorial divisions. No obvious missing operations exist for a read-only data server.
Maintenance
Related MCP Connectors
IBGE: geography, census, economy and health from the official APIs, with provenance. 23 tools.
Discover, resolve, and query official Brazilian economic data with semantic search and provenance.
Find, understand and query Brazilian data on companies, economy, health and education.
IBGE: Código de Município, official-source lookup. Platform-hosted, pay per query with prepaid credi
Related MCP Servers
- AlicenseAqualityBmaintenanceExposes official IBGE data as MCP tools, including Brazilian localities, SIDRA statistical aggregates, and population indicators.11MIT
- 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 gradedqualityDmaintenanceProvides read-only access to Brazilian municipality codes from IBGE, an official government source, via MCP. Works with any MCP-compatible client to query municipality data using natural language.MIT