Skip to main content
Glama

MCP Badge License: MIT Python 3.11+ No Auth Required

INEI MCP Server

Connects any MCP-compatible AI agent to INEI Estadist — the official statistics platform of Peru's Instituto Nacional de Estadística e Informática (INEI).

Access Census 2017 data, population indicators, geographic profiles, and social statistics for all 25 departments, 196 provinces, and 1,874 districts of Peru — no API key required.

Works with: Claude Desktop · Claude Code · Cursor · VS Code Copilot · Windsurf · any MCP client


Quickstart

# From source (development)
git clone https://github.com/JOSETRA44/inei-mcp.git
cd inei-mcp
uv sync
uv run inei-mcp

Related MCP server: BCRP MCP Server

Available Tools (7)

Tool

Description

inei_get_departments

List all 25 Peruvian departments with ubigeo codes and IDs

inei_get_provinces

List provinces of a department by ccdd code

inei_get_districts

List districts of a province, or search districts by name

inei_search_indicators

Search statistical indicators by keyword

inei_get_indicator_data

Get indicator values across geographies

inei_browse_topics

Browse the full thematic indicator tree

inei_get_geography_profile

Census 2017 population profile for a region

inei_get_census_dashboard

National demographic or social dashboard

inei_get_data_sources

List official data sources


Available Prompts (3)

Prompt

Description

demographic_analysis

Structured demographic analysis for a department

regional_comparison

Compare an indicator across Peru's regions

census_deep_dive

Comprehensive Census 2017 analysis


Available Resources (3)

URI

Contents

inei://api-guide

Complete API reference

inei://department-codes

All 25 department codes and IDs

inei://thematic-categories

Indicator categories with example IDs


Configuration (Claude Code / Claude Desktop)

From source (development)

{
  "mcpServers": {
    "inei": {
      "command": "uv",
      "args": ["--directory", "C:\\Users\\USER\\source\\MCPs\\INEI-mcp", "run", "inei-mcp"]
    }
  }
}

Data Source

All data from INEI Estadist — Peru's official national statistics platform. Primary data: Censos Nacionales 2017 — XII de Población y VII de Vivienda.


License

MIT — © 2026 JOSETRA44

Available Tools

9 tools
inei_browse_topicsA

Browse the INEI thematic indicator tree — all categories and sub-categories.

Returns the hierarchical topic tree with ~1977 entries from the Census 2017 database. Nodes with tipo=1 are categories; tipo=2 are leaf indicators with an id_indicador.

Use id_indicador (only on tipo=2 nodes) with inei_get_indicator_data (requires id_geografia).

Top-level categories include DEMOGRAFICO, SOCIAL, ECONOMICO, VIVIENDA, HOGARES, EDUCACION, SALUD, EMPLEO.

Inputs: root_id, only_indicators.

inei_get_census_dashboardA

Get national Census 2017 summary dashboard — demographics or social indicators.

demografico: Population totals, age structure, gender breakdown, urban/rural split, population density, age pyramid data.

social: Education (literacy, school attendance), housing (water, electricity, sanitation), health insurance coverage, household composition.

Returns key national figures, charts data, and breakdowns by region. For specific regional data, use inei_get_geography_profile instead.

Inputs: tipo.

inei_get_data_sourcesA

List the official data sources available in the INEI Estadist platform.

Returns source IDs, names, and descriptions. Sources include:

  • Censos Nacionales 2017 (Census)

  • MINSA (Health Ministry)

  • RENIEC (Civil Registry)

  • MEF (Economy Ministry)

  • SEAS (Education indicators)

Inputs: no named parameters.

inei_get_departmentsA

List all 25 departments (regions) of Peru with their geography IDs and ubigeo codes.

Returns id_geografia (used in other tools), ubigeo (6-digit code), ccdd (2-digit dept code), and department name.

Use this first to get the id_geografia or ccdd needed by other tools.

Inputs: no named parameters.

inei_get_districtsC

Returns all 25 Peruvian departments (province/district data not available via current API).

Note: The INEI Estadist API currently only exposes department-level geography. Use id_geografia from the results with inei_get_geography_profile for census data.

Inputs: ccdd, ccpp, search.

inei_get_geography_profileA

Get the Census 2017 population profile for a specific Peruvian geography.

Returns key census indicators for a department, province or district: total population, urban/rural breakdown, gender split, working-age population, electoral population, population density, and more.

Provide id_geografia — a 7-digit ID from inei_get_departments or inei_get_provinces.

Common department IDs:

  • 2010000: Amazonas - 2020000: Ancash - 2030000: Apurimac

  • 2040000: Arequipa - 2050000: Ayacucho - 2060000: Cajamarca

  • 2070000: Callao - 2080000: Cusco - 2150000: Lima

  • 2130000: La Libertad - 2140000: Lambayeque - 2200000: Piura

Inputs: id_geografia (required).

inei_get_indicator_dataA

Get census data for a geography, referencing a specific indicator ID.

Requires both id_indicador (from inei_search_indicators) and id_geografia (from inei_get_departments). Returns the full census profile for that geography including population totals, housing, education, and economic indicators.

Note: due to API changes, returns all available census data for the geography rather than a single filtered indicator. Scan seccion1/seccion2 for your indicator.

Common indicator IDs (Census 2017):

  • 516654: Población Total

  • 262215: Población Censada

  • 262218: Población Censada Urbana

  • 262221: Población Censada Rural

Inputs: id_indicador (required), id_geografia.

inei_get_provincesA

List all provinces in a Peruvian department.

Provide ccdd (2-digit department code) — e.g. '15' for Lima, '01' for Amazonas. Get ccdd from inei_get_departments.

Returns province list with id_geografia, ubigeo, nombre, ccdd, ccpp.

Inputs: ccdd (required).

inei_search_indicatorsA

Search INEI thematic statistical indicators by keyword.

The INEI Estadist database contains indicators from the National Census 2017 and other official surveys. Search by keyword to find indicators on population, education, housing, health, employment, poverty, and more.

Returns indicator ID (id_indicador), name, and hierarchical path (ruta). Use id_indicador with inei_get_indicator_data to retrieve actual values.

Example searches: 'poblacion', 'educacion', 'vivienda', 'salud', 'empleo', 'pobreza', 'analfabetismo', 'electricidad', 'agua', 'desague'

Inputs: query (required), limit, offset.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation2/5

    The tool set has a major disambiguation problem due to inei_get_districts being misnamed: its description says it returns all 25 departments, not districts, making it redundant with inei_get_departments. Other tools like inei_browse_topics, inei_search_indicators, and inei_get_indicator_data have distinct roles, but the duplication causes confusion.

    Naming Consistency4/5

    All tools use the 'inei_' prefix and snake_case, with a consistent verb_noun pattern (get_*, browse_*, search_*). However, inei_get_districts is misleading because it does not return districts but departments, breaking semantic consistency. inei_get_census_dashboard uses 'dashboard' instead of a data-object noun, which is a minor deviation.

    Tool Count5/5

    With 9 tools, the set is well-scoped for a statistical API covering browsing, searching, geography listing, geography profiling, and data retrieval. Each tool has a clear purpose, and the count feels neither too sparse nor overwhelming.

    Completeness4/5

    The set covers the main workflows: explore topics, search indicators, retrieve data by geography, and get national summaries. It can handle department and province queries. However, the duplicate get_districts tool is unnecessary, and the API's limitation to department-level geography (no district data) is a domain constraint. Minor gaps exist (e.g., no hierarchical drill-down beyond two levels), but overall coverage is good for a read-only census API.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Peruvian public-data lookups including SUNAT RUC registrations, BCRP exchange rates, and SEACE tenders. Provides official open-data access through tools for Claude, Cursor, and other MCP clients.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to access economic statistics from the Central Reserve Bank of Peru, including exchange rates, interest rates, and GDP, without requiring an API key.
      7
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and analysts to query UN CEPALSTAT indicators through MCP by resolving natural-language requests into statistically valid indicators and retrieving clean, decoded data with anti-hallucination safeguards.
      MIT