Skip to main content
Glama
mxnueel
by mxnueel

denue-mcp

CI License: MIT Node.js

MCP server for INEGI's DENUE (5M+ Mexican businesses) and Banco de Indicadores (population, inflation, consumer confidence, industrial activity) — query both in plain language from Claude or any MCP-compatible agent.

I built this because a client project needed to look up real Mexican business data from an agent, and INEGI only ships DENUE and Indicadores as two separate REST APIs — each with its own undocumented quirks. The one that actually bit me: Indicadores silently splits every code across two data banks, BISE and BIE-BISE, and asking the wrong one doesn't 404 — it returns ErrorCode:100 with no hint which bank you should've used. obtenerIndicador() in src/indicadores.ts just tries one bank, and on ErrorCode:100 retries with the other before giving up — so the agent never has to know banks exist.

Claude calling denue_buscar_por_estado and returning real DENUE records for pharmacies in Jalisco

(Real query and response, replayed from the README example below. Source in docs/demo-src, rendered with HyperFramescd docs/demo-src && npm run render.)

Existing MCP integrations with DENUE (e.g. cdmx-mcp) bundle it as one of several Mexico City-only datasets. No MCP server previously existed for INEGI's Indicadores API — this one covers both, at national level, across any of the 32 states or the whole country at once.

Tools

Tool

What it does

denue_buscar_cercania

Search businesses by keyword near a lat/long coordinate (radius up to 5km)

denue_buscar_por_estado

Search businesses by keyword within a specific state, or nationwide

denue_buscar_por_nombre

Search businesses by commercial or legal name

denue_detalle

Get the full record for a specific establishment by its DENUE id

inegi_indicador

Get a socioeconomic indicator (population, inflation, consumer confidence, industrial activity, or any raw INEGI indicator code) nationally or by state, latest value or full history

State names are accepted in plain Spanish ("Jalisco", "Ciudad de Mexico") — no need to know INEGI's numeric codes.

Related MCP server: agentweb-mcp

Example

Asking Claude "find pharmacies in Jalisco" calls denue_buscar_por_estado and returns real DENUE records:

- PV ARCOS LUROLA (id: 1963523)
  Actividad: Farmacias sin minisúper
  Direccion: CALLE MORELOS 291 CENTRO 48300 PUERTO VALLARTA, Puerto Vallarta, JALISCO
  Telefono: N/D
  Coordenadas: 20.60831764, -105.23612503

- PV INSUERGENTES LUROLA (id: 1963298)
  Actividad: Farmacias sin minisúper
  Direccion: CALLE BASILIO BADILLO 344 EMILIANO ZAPATA 48380 PUERTO VALLARTA, Puerto Vallarta, JALISCO
  Telefono: N/D
  Coordenadas: 20.60264623, -105.23377801

Asking "population of Jalisco" calls inegi_indicador and returns the real INEGI figure:

Poblacion total (codigo 1002000001) — Jalisco:
- 2020: 8,348,151

Setup

  1. Get a free DENUE API token — register at inegi.org.mx/servicios/api_denue.html.

  2. Clone and build:

    git clone https://github.com/mxnueel/denue-mcp.git
    cd denue-mcp
    npm install
    npm run build
  3. Register it with your MCP client.

    Claude Code (CLI):

    claude mcp add denue -s user -e INEGI_DENUE_TOKEN=your-token-here -- node /absolute/path/to/denue-mcp/build/index.js

    Claude Desktop (or any client using a mcpServers JSON config, e.g. claude_desktop_config.json):

    {
      "mcpServers": {
        "denue": {
          "command": "node",
          "args": ["/absolute/path/to/denue-mcp/build/index.js"],
          "env": { "INEGI_DENUE_TOKEN": "your-token-here" }
        }
      }
    }
  4. Ask your agent something like "find pharmacies in Jalisco" or "what businesses are near 20.6597, -103.3496?"

Testing

npm test

Runs the full build and the test suite (node --test) — covers state-name resolution (estados.ts) and the missing-token error path for every DENUE call. CI runs this on every push against Node 18, 20, and 22.

Contributing

Issues and PRs welcome — especially reports of DENUE response shapes this hasn't been tested against yet (different methods return slightly different field sets). Fork, branch, npm test, and open a PR.

License

MIT — see LICENSE.

Available Tools

5 tools
denue_buscar_cercaniaBuscar negocios cerca de una coordenadaA

Busca establecimientos economicos de todo Mexico en el Directorio Estadistico Nacional de Unidades Economicas (DENUE) de INEGI, cerca de una coordenada dada. Util para encontrar negocios, competidores o proveedores en una zona especifica.

ParametersJSON Schema
NameRequiredDescriptionDefault
latitudYesLatitud del punto de busqueda
longitudYesLongitud del punto de busqueda
condicionYesPalabra clave a buscar, por ejemplo 'restaurante', 'farmacia', 'oxxo'
distanciaMetrosNoRadio de busqueda en metros (maximo 5000)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. The verb 'Busca' clearly signals a read/search operation rather than a mutation, and the description adds useful context: nationwide coverage via 'todo Mexico', the authoritative source 'DENUE de INEGI', and proximity-based behavior via 'cerca de una coordenada dada'. It does not mention result shape or pagination, but for a lookup tool this is not a critical omission.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two compact sentences: the first states the operation, source, scope, and criterion; the second states practical use cases. Every clause adds value and there is no filler or repetition of the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 4-parameter lookup with complete schema descriptions, the description provides enough context about the data source, scope, search criterion, and use cases for an agent to select and invoke it correctly. The absence of an output schema means return details are not explicitly stated, but the notion of finding businesses in a zone strongly implies a list of matching establishments.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with latitud, longitud, condicion, and distanciaMetros all described, including the default and maximum for distance. The tool description adds no parameter-specific details beyond reinforcing the idea of a coordinate and a zone, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Evidencia: 'Busca establecimientos economicos de todo Mexico en el DENUE de INEGI, cerca de una coordenada dada.' The description specifies a concrete verb, target resource, national scope, and spatial criterion. This clearly distinguishes it from sibling tools based on state, name, or detail.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Evidencia: 'Util para encontrar negocios, competidores o proveedores en una zona especifica.' This gives a clear when-to-use context: discovering nearby businesses, competitors, or suppliers. However, it does not explicitly state when not to use this tool or name alternatives such as denue_buscar_por_nombre or denue_buscar_por_estado.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

denue_buscar_por_estadoBuscar negocios en un estado de MexicoA

Busca establecimientos economicos por palabra clave dentro de un estado especifico de Mexico (o a nivel nacional). Util cuando no se tiene una coordenada exacta, solo una region.

ParametersJSON Schema
NameRequiredDescriptionDefault
finNoNumero de registro final (maximo 100 por consulta)
estadoYesNombre del estado (ej. 'Jalisco', 'Ciudad de Mexico') o codigo de dos digitos (01-32). Usa 'nacional' para buscar en todo Mexico.
inicioNoNumero de registro inicial (para paginar resultados)
condicionYesPalabra clave a buscar, por ejemplo 'panaderia', 'taller mecanico'

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It discloses the main query behavior and national fallback, but does not describe result shape, pagination implications, read-only nature, or what happens with invalid state names. This is adequate but has clear gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the action and followed by a decision-relevant condition. The first clause slightly restates the title, but every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The schema richly documents all four parameters, and the description provides selection context. However, with no output schema or annotations, it would benefit from stating what kind of records are returned and when to prefer sibling search tools such as denue_buscar_por_nombre.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are already well documented. The description adds only the general 'keyword + state' concept and does not add format details or examples beyond the schema's own examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action (search economic establishments) with a concrete resource and query style ('por palabra clave'), plus a geographic scope ('estado especifico... o nacional'). This clearly distinguishes it from coordinate-based siblings like denue_buscar_cercania.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit use condition: use this when there is no exact coordinate, only a region. It does not explicitly name sibling alternatives or exclusion criteria, but the region-vs-coordinate distinction is enough to route an agent correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

denue_buscar_por_nombreBuscar un negocio por nombre o razon socialB

Busca establecimientos economicos por su nombre comercial o razon social en todo Mexico o en un estado especifico.

ParametersJSON Schema
NameRequiredDescriptionDefault
finNo
estadoNoNombre del estado o codigo de dos digitos. Por defecto busca a nivel nacional.nacional
inicioNo
nombreYesNombre comercial o razon social a buscar

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavior on its own. It only restates the search criteria and scope; it does not mention pagination, result limits, matching behavior (exact/partial), or output structure. The schema's 'inicio' and 'fin' fields hint at pagination but the description adds no context on how results are returned or any limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no filler; the verb and target resource are front-loaded. It is appropriately sized for the content it conveys.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with four parameters, no output schema, and no annotations, a one-sentence description is insufficient. It omits essential call context: how pagination parameters work, what a result record looks like, and how to refer to states. The description leaves an agent to infer too much, especially relative to the richer sibling set.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, leaving 'inicio' and 'fin' undocumented. The description adds no explanation for these pagination parameters and only paraphrases the existing schema descriptions for 'nombre' and 'estado'. It fails to compensate for the undocumented half of the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states a specific verb ('Busca') and resource ('establecimientos economicos'), with clear search dimensions: by trade name or corporate name, and geographic scope (all Mexico or a specific state). It matches the title and unambiguously differentiates from sibling tools like denue_detalle or denue_buscar_cercania by naming the resource and criteria.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for searching businesses by name, and mentions the optional state filter, which hints at usage. However, it never tells an agent when to prefer this over siblings like denue_buscar_por_estado, nor does it state exclusions or preconditions. The geographic note is more parameter elaboration than usage routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

denue_detalleObtener el detalle completo de un establecimientoA

Obtiene la ficha completa de un establecimiento economico dado su ID de DENUE (obtenido de otra busqueda).

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesID del establecimiento en DENUE

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations to carry the safety profile, so the description must convey behavior on its own. The verb 'Obtiene' implies a read-only operation and 'ficha completa' hints at the response scope, but the description does not disclose error behavior, what happens for an invalid ID, or whether any special authorization is needed. This is adequate but leaves gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence conveys the operation, resource, input, and source of that input with no redundant words. All essential information is front-loaded and clearly structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter retrieval tool with no output schema, the description provides the key operational context: what it returns, what input it needs, and where that input comes from. It could be more complete only by mentioning error or edge-case behavior, but the low complexity makes the current description nearly sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents 'id' as the DENUE establishment ID with 100% coverage, so the baseline is 3. The description adds meaningful context beyond the schema by stating that the ID comes from another search, which helps the agent understand how to obtain and supply this value correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('Obtiene'), a specific resource ('la ficha completa de un establecimiento economico'), and the required input ('ID de DENUE'). It is immediately distinguishable from sibling search tools like denue_buscar_por_nombre and denue_buscar_por_estado, which are broader lookups rather than detail retrieval by ID.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'obtenido de otra busqueda' explicitly frames this tool as a follow-up to a previous search, giving clear context for when it should be used. It does not name the alternative search tools explicitly or state when not to use them, so it stops just short of a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

inegi_indicadorConsultar un indicador socioeconomico de INEGIA

Consulta indicadores socioeconomicos oficiales de INEGI (Banco de Indicadores): poblacion, inflacion, confianza del consumidor, actividad industrial, y mas, a nivel nacional o por estado. Indicadores conocidos por nombre: poblacion, inflacion, inpc, confianza del consumidor, actividad industrial. Tambien acepta directamente un codigo numerico de indicador de INEGI para consultar cualquiera de su catalogo.

ParametersJSON Schema
NameRequiredDescriptionDefault
estadoNoNombre del estado (ej. 'Jalisco') o 'nacional' para todo el paisnacional
historicoNoSi es true, regresa toda la serie historica disponible en vez de solo el dato mas reciente
indicadorYesNombre del indicador (ej. 'poblacion', 'inflacion') o codigo numerico de INEGI

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No hay anotaciones, así que la descripción carga con la responsabilidad. El verbo 'Consulta' sugiere una operación de solo lectura y se menciona la cobertura nacional/estatal, pero no se describen el formato de respuesta, el comportamiento ante códigos inválidos ni si devuelve el dato más reciente o la serie histórica. Es adecuada pero con vacíos.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

La descripción es breve y comienza con el propósito principal, pero la segunda frase repite casi los mismos ejemplos de la primera y solo aporta 'inpc'. Podría condensarse en dos frases sin perder información. No es redundante en exceso, pero no es un modelo de concisión.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Para una herramienta de consulta sin anotaciones ni esquema de salida, cubre bien qué se puede consultar y cómo especificar indicador, estado y serie histórica. Sin embargo, no describe la estructura del resultado esperado ni el manejo de errores (por ejemplo, código inexistente), lo que deja cierta incertidumbre operativa.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Aunque la cobertura del esquema es del 100% (baseline 3), la descripción añade valor real al enumerar nombres válidos adicionales ('inpc', 'confianza del consumidor', 'actividad industrial') y al explicar que se acepta cualquier código numérico del catálogo INEGI. Esto ayuda a construir correctamente el parámetro 'indicador' más allá de lo que ya dice el esquema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

La descripción usa un verbo específico ('Consulta'), identifica el recurso ('indicadores socioeconómicos oficiales de INEGI') y detalla ejemplos concretos como población, inflación y actividad industrial. Además, el ámbito nacional/estatal y la mención del catálogo INEGI la distinguen claramente de las herramientas hermanas DENUE, que son de directorios empresariales.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Proporciona un contexto claro: usar para indicadores INEGI a nivel nacional o estatal, con indicadores conocidos por nombre o mediante código numérico. No excluye explícitamente otras herramientas ni menciona cuándo NO usarla, pero el dominio queda lo bastante definido para que un agente seleccione correctamente.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.9/5.0
Disambiguation4/5

The three search tools are differentiated by search mode (coordinates, state, name), and the detail tool clearly targets a specific record by ID. However, buscar_por_estado and buscar_por_nombre can overlap when searching by keyword within a state, so a slight ambiguity remains.

Naming Consistency4/5

Most tools follow a denue_ verb_noun or denue_buscar_* pattern, with inegi_indicador as a minor deviation. The naming is readable and mostly predictable, but detalle is a noun rather than a verb and the inegi_ prefix breaks the denue convention.

Tool Count5/5

With 5 tools, the server is well-scoped for its purpose: querying DENUE establishments and INEGI indicators. Each tool addresses a distinct workflow step without redundancy or bloat.

Completeness4/5

The DENUE search-and-detail lifecycle is covered for discoverability, including coordinate, state, and name lookups. Missing search by economic activity or category is a minor gap, and the INEGI side is thin with a single indicator query tool, but core read-only workflows are complete.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables MCP clients to search and retrieve structured business data from the Vexi API, allowing AI agents to get clean, typed business objects with identity, offerings, and trust signals.
    4
    14
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables agents to search, retrieve, and contribute business data from a directory of 11M+ businesses across 195 countries, returning markdown prose by default.
    22
    115
    3
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides AI agents with access to real, verifiable businesses with provenance and source URLs, enabling natural-language business search and profile retrieval.
    2
    MIT

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/mxnueel/denue-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server