Skip to main content
Glama

inegi-mcp

Zero-token-first hybrid Model Context Protocol (MCP) server for INEGI (Instituto Nacional de Estadística y Geografía de México).

Instead of wrapping a single rate-limited REST endpoint, inegi-mcp combines:

  • Semantic Resolution: Accent-insensitive search for states, municipalities, and localities (wscatgeo/v2), SCIAN economic activity codes, and Banco de Indicadores metrics.

  • Descarga Masiva Crawler: Queries INEGI's internal JSON catalog (/app/api/descarga/descarga/descargamasiva/lista/...) to discover open-data and microdata archives across DENUE, Microdatos, Tabulados, and Indicadores.

  • Local DuckDB Lakehouse: Streams .zip archives on demand into ~/.local/share/inegi-mcp/, parses .csv (UTF-8 & CP1252) and .dbf tables, indexes diccionario_de_datos, and executes safe read-only SQL with norm_txt() and haversine_m().

  • Progressive Live API Fusion: Works immediately with zero tokens, and automatically unlocks live Banco de Indicadores v2.0, DENUE REST v1, and SAKBÉ v3.1 routing/tolls when tokens are configured.

Quickstart

cd /home/stinkyyy/dev/inegi-mcp
uv sync
uv run inegi-mcp

Streamable HTTP mode

uv run inegi-mcp --transport streamable-http --host 127.0.0.1 --port 8000

Related MCP server: Tlaloc MCP Server

Optional Environment Variables

Variable

Purpose

Default

INEGI_TOKEN

Shared token for Indicadores v2 & DENUE REST v1

Unset (zero-token bulk/geo mode)

INEGI_INDICADORES_TOKEN

Override token for Banco de Indicadores v2

INEGI_TOKEN

INEGI_DENUE_TOKEN

Override token for DENUE REST v1

INEGI_TOKEN

INEGI_SAKBE_TOKEN

Token for SAKBÉ v3.1 road routing & tolls

Unset (Haversine distance estimate)

INEGI_DATA_DIR

Local cache & DuckDB database directory

~/.local/share/inegi-mcp

INEGI_MAX_DOWNLOAD_MB

Safety cap per downloaded archive (MB)

500

INEGI_SQL_MAX_ROWS

Default max rows returned by inegi_sql_query

200

MCP Client Configuration

{
  "mcpServers": {
    "inegi-mcp": {
      "command": "/home/stinkyyy/dev/inegi-mcp/.venv/bin/inegi-mcp",
      "args": []
    }
  }
}

Bundled Agent Skills (skills/)

This repository ships 4 cross-host agent skills designed specifically to pair with inegi-mcp:

Skill

Purpose

mx-site-selection

Score Mexican municipalities & micro-radii using Censo 2020 ITER purchasing-power proxies, DENUE competitor saturation, and SAKBÉ corridors

mx-microdata-economist

Enforce expansion weights (factor, fac_tri, fac_hog/fac_ele/fac_del) & universe filters for ENIGH, ENOE, ENVIPE, and Censos Económicos

mx-osint-footprint

Two-hop nom_estab → raz_social corporate network mapping, industrial park rosters, and headcount bracket estimation in denue_bulk

mx-geo-viz

Export DuckDB geospatial queries to RFC 7946 GeoJSON and zero-key standalone dark-mode MapLibre HTML maps

Install all 4 skills locally across ~/.agents/skills/, ~/.claude/skills/, and ~/.gemini/config/skills/:

./scripts/install-skills.sh

Or install from GitHub via the skills CLI:

npx skills add stinkyyyyy/inegi-mcp

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides access to Mexico's INEGI (national statistics office) indicators API, enabling AI agents to query statistical data through natural language or direct tool calls.
      63 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI assistants with live, authenticated access to official Mexican data sources including CURP, RFC, postal codes, phone numbers, SPEI payments, CFDI status, DOF semantic search, and geocoding via INEGI/INE.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to query official Brazilian public data on water, sanitation, energy, and territory through a single unified query interface, with spatial filters, a sector ontology, and source/date provenance attached to every number. Ships discoverable tools and resources for listing domains, describing datasets, searching, and running queries over local DuckDB data.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying Mexican public government data in a single consistent shape through natural-language tool calls: searching and inspecting datasets.gob.mx, tracking catalog changes, verifying RFCs against SAT's 69-B list, normalizing state names, and pulling Banxico series, DENUE nearby businesses, and INEGI indicators. Every response carries its official source and data date, with all figures produced by deterministic reads of official files and APIs.
      MIT