Spain’s National Statistics Institute (INE) released an open-source MCP (Model Context Protocol) server on 26 November 2026 that connects AI assistants to its public JSON API. Written in Python and licensed under EUPL 1.2, it lets an assistant answer questions such as the last four quarterly unemployment rates for men in Murcia with official figures fetched at query time, plus a link to the INE source table.

The INE MCP server at a glance in 30 seconds

  • Requires Python 3.11+ and the uv package manager; no authentication needed.
  • Runs over stdio by default or Streamable HTTP via environment variables.
  • Exposes five read-only tools that must be called in a strict order.
  • The catalogue lists 166 statistical operations, 110 with tables available today.
  • It is beta software (version 0.1.0) and the hosted endpoint is not live yet.

The code is published at github.com/es-ine/mcp, while the README points to INE’s own GitLab as the main repository. According to the documentation it works with any MCP client, including Claude, Codex, Cursor, VS Code, Windsurf, Gemini CLI and Zed.

Local installation

You need Python 3.11 or later and uv, Astral’s package manager. The main dependencies are the official MCP SDK, httpx and pydantic. Clone, sync and run:

git clone https://github.com/es-ine/mcp.git ine-mcp
cd ine-mcp
uv sync
uv run ine-mcpCode language: PHP (php)

By default the server starts on the stdio transport and waits silently for a client, which is expected. To update, run git pull followed by uv sync.

Connecting an assistant

Command-line clients need one line, with the absolute path to your clone. For Claude Code or Codex:

claude mcp add ine -- uv run --directory /path/to/ine-mcp ine-mcp
codex mcp add ine -- uv run --directory /path/to/ine-mcp ine-mcp

Most desktop clients (Claude Desktop, Cursor, Windsurf, Gemini CLI, Cline, LM Studio) read the same JSON block in their MCP settings file:

{
  "mcpServers": {
    "ine": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/ine-mcp", "ine-mcp"]
    }
  }
}Code language: JSON / JSON with Comments (json)

VS Code uses a servers key with "type": "stdio" in .vscode/mcp.json, and Codex also accepts TOML in ~/.codex/config.toml. You can then ask things like the CPI rate in Madrid over the last year, or how many people live in each province according to the latest figures. Data labels come back in Spanish, as INE publishes them.

Five tools and an order that cannot be skipped

The design is the most interesting part for anyone running these integrations. The server exposes five read-only tools, annotated with readOnlyHint, which the assistant must call in sequence:

  1. ine_select_operation: finds the statistical operation (CPI, Labour Force Survey, GDP…).
  2. ine_select_multiple_tables: lists the tables for that operation.
  3. ine_select_multiple_table_groups: returns the variables that structure a table.
  4. ine_select_multiple_values: returns the possible values, such as provinces or sex.
  5. ine_select_multiple_table_data: pulls observations using tv filters and a period.

The sequence is enforced in code and cannot be disabled. If the model skips a step or uses an identifier the server did not return earlier, it gets an error starting with BLOCKED that names the missing step and the next tool to call. Filters use the FK_Variable:Id format built from the step-four response, which effectively prevents the model from inventing plausible-looking IDs. Every result carries a source field with the operation, the table, its public URL on ine.es and the filters applied.

HTTP mode and security

To serve multiple users you can run it in Streamable HTTP mode via environment variables. According to its config.py, MCP_TRANSPORT accepts stdio or http, and MCP_HOST and MCP_PORT set the bind address and port, defaulting to 0.0.0.0 and 8000:

MCP_TRANSPORT=http MCP_HOST=127.0.0.1 MCP_PORT=8000 uv run ine-mcp

Since the server has no authentication (the data is public) and listens on all interfaces by default, on a shared host it is wise to bind it to 127.0.0.1 and publish it behind a TLS reverse proxy, adding access control and rate limiting if needed, so you do not expose a service anyone could use to generate traffic against INE’s API. The server caches the operation and table catalogues in memory for six hours and keeps up to 1,000 sessions, evicting the least recently used. It writes nothing and needs no personal data; it only forwards the queries required to the public API.

The repository warns that the project is under active development, provided as is, and should be reviewed and tested before use in critical environments. Tests run with uv run pytest.

FAQ

What do I need to install the INE MCP server?

Python 3.11 or later and uv. Clone the repository, run uv sync and start it with uv run ine-mcp.

Does it need an API key?

No. It uses INE’s public JSON API and requires no authentication or personal data.

Can it run as an HTTP service?

Yes, with MCP_TRANSPORT=http. It listens on 0.0.0.0:8000 by default, so restrict it with MCP_HOST and a reverse proxy.

What licence does it use?

The European Union Public Licence, EUPL 1.2.

Sources:

Scroll to Top