Idescat MCP server
MCP (Model Context Protocol) server that exposes tools to query the official
statistics of Catalonia, published by Idescat (Institut d'Estadística de
Catalunya), from any MCP client (Claude, Windsurf, Cursor, VS Code, etc.).
- Public endpoint:
https://api.idescat.cat/mcp
- Transport: Streamable HTTP (MCP spec 2026-07-28, per-request metadata and
server/discover, with legacy initialize compatibility for 2025-11-25 and earlier), stateless — each POST request is independent, with no sessions. POST responses use JSON or SSE according to the client's Accept header; no persistent SSE stream is offered via GET.
- Authentication: none required (the data is public).
- Data: official Idescat statistics in JSON-stat; labels and descriptions are in Catalan; territorial scope is Catalonia and its territorial breakdowns (counties, municipalities, provinces, etc.).
Installation
The public endpoint is https://api.idescat.cat/mcp. Add one of the snippets
below to your MCP client's configuration. Different clients expect a different
key (serverUrl, url, ...) and sometimes a type.
Windsurf/Devin, Antigravity (serverUrl)
Cursor, Roo Code, Zoo Code (type: streamable-http)
Cline (type: streamableHttp)
VS Code and the emerging standard form (servers, type: http)
Claude.ai (custom connector)
Claude.ai (web and desktop apps) can reach the remote server directly as a
custom connector, no configuration file needed.
- Open Customize → Connectors
- Click Add custom connector.
- Fill in the fields:
- Name:
Idescat
- Remote MCP server URL:
https://api.idescat.cat/mcp
- Click Add. No authentication (OAuth / API key) is needed, since the data
is public.
- Back in a chat, enable the Idescat connector from the tools/attachments
menu. Its tools and resources are now available to the assistant.
- (Optional) In the connector's tool settings, switch each Idescat tool from
Needs approval to Always allow so the assistant can run them without
asking for confirmation every time. All the tools are read-only, so this is
safe.
Claude Desktop and stdio-only clients (bridge with mcp-remote)
Clients that only speak stdio can reach the remote server through the
mcp-remote bridge:
Not sure which key your client expects? (catch-all)
Most clients ignore keys they don't recognise, so this superset works with many
of them at once:
Protocol versions
The server is dual-era (MCP versioning):
Modern requests must also send matching headers: MCP-Protocol-Version
(equal to the _meta version), Mcp-Method (equal to the JSON-RPC method),
and Mcp-Name for tools/call (the tool name) and resources/read (the
URI; UTF-8 values may use the =?base64?...?= sentinel). Origin is always
accepted — the data is public and the API answers CORS *.
Modern clients may open subscriptions/listen: the server answers on an SSE
stream with notifications/subscriptions/acknowledged carrying an empty
filter (no notification types are supported — the server is stateless and the
listings don't change), followed by the gradual close defined by the spec.
Clients should rely on ttlMs instead.
Available tools
Available resources
Beyond the tools, the server exposes MCP resources — content a client can
attach to the context without executing any action.
Static resources (resources/list):
Resource templates (resources/templates/list) — parametrised URIs:
The transport is stateless, so subscribe and resources/list_changed
notifications are not offered (there is no persistent connection).
Server-side calculations
Language models are notoriously unreliable at mental arithmetic on long series
of values. get_table_data and render_table therefore accept three optional
parameters that make the server compute the result deterministically instead
of leaving the model to add, subtract or divide the returned values itself:
- Age-range filters. For dimensions coded
Y000, Y005_009, Y_GE100,
etc., a filter value can be a range expression (">=65", ">65", "<16",
"<=15", "16-64"); the server resolves it to the exact list of codes and
fails with range_not_representable when the published groups cannot express
the bound exactly.
sum collapses the listed dimensions by adding up their categories; the
result is a single SUM category. TOTAL is excluded automatically.
derive appends derived metrics to the metric dimension:
share (<METRIC>_SHARE = 100 × value / value at TOTAL of the given
dimension), difference (<METRIC>_DIFF vs. the previous or a given period)
and percent_change (<METRIC>_PCT = 100 × (value − base) / base).
The engine relies on Idescat's conventions: additivity is declared by
extension["%"] on the metric dimension (only additive metrics can be summed
or shared), TOTAL is the total code, and non-computable cells come back as
null with status d. Everything applied is recorded in extension.derived
(ranges, summed codes, formulas, warnings) and render_table prints it under
the table as a Calculations: block.
Unsafe requests are refused: metric_not_additive, geo_not_summable (the
territorial dimension is never summed — use the geo parameter with the
division that already publishes the aggregate), range_not_representable,
incomplete_data and total_not_available.
Agent skills
Two skills in the Agent Skills open format (a
directory with a SKILL.md file: YAML frontmatter + Markdown instructions)
teach agents how to use Idescat data correctly. They are published on the
website and advertised in the ARD manifest:
Repository files
The following files define the server's guidance and resources and are served,
unchanged, to MCP clients:
instructions.md — usage guidance the server sends to
clients during the handshake and exposes as the idescat://instructions
resource. It explains how to choose a statistic, the data-retrieval flow, how
to interpret JSON-stat, and the source-attribution rules.
resources.json — declaration of the MCP resources
and resource templates the server exposes (the two tables in the
Available resources section above), including each
URI, title, description, MIME type, and its backing file or tool.
resources/geo.md — glossary of territorial codes
(cat, prov, at, com, mun, dis, sec) used by the geo parameter,
exposed as the idescat://glossary/geo resource.
The repository also includes:
Discovery (Agentic Resource Discovery)
The server is advertised using the Agentic Resource Discovery (ARD)
specification (v0.91) so agents can find it automatically:
- An ARD manifest is published at
https://www.idescat.cat/.well-known/ard.json and
https://api.idescat.cat/.well-known/ard.json (served with
Access-Control-Allow-Origin: * on both hosts). It carries a top-level
specVersion so the same document is valid both as an ARD manifest and as
an AI Catalog file:
/.well-known/ai-catalog.json is served directly by an internal rewrite of
ard.json (no redirect) as application/ai-catalog+json — the predecessor
format that some MCP discovery flows still request first.
The manifest advertises four entries: this MCP server
(application/mcp-server-card+json), the
Idescat Tables API, described by
its OpenAPI document (application/openapi+json) at
https://www.idescat.cat/dev/api/taules/openapi.json, and the two
agent skills
(application/agent-skills+md, the AI Catalog media type for a skill
published as a Markdown SKILL.md file).
- The MCP server card (
application/mcp-server-card+json) is served at
https://api.idescat.cat/mcp/server-card, the location the experimental
Server Card discovery specification
reserves as <streamable-http-url>/server-card. A GET (or HEAD) on the
bare endpoint https://api.idescat.cat/mcp returns 405 — the endpoint is
POST-only, although POST responses can use SSE. The Card and the MCP
handshake (serverInfo) share the name cat.idescat/mcp, matching the
MCP Registry. The Card response honours the spec's caching contract:
Cache-Control: public, max-age=3600, an ETag that answers
If-None-Match with 304, and CORS headers (Allow-Methods: GET,
Allow-Headers: Content-Type, If-None-Match, Expose-Headers: ETag).
- The legacy Card aliases
/.well-known/mcp/server-card.json and
/.well-known/mcp.json are served directly on api.idescat.cat by an
internal rewrite (identical bytes, no redirect — some crawlers do not
follow them); on www.idescat.cat they redirect (307) to
https://api.idescat.cat/mcp/server-card.
- The MCP entry in
ard.json points to the Card URL and exposes the
transport endpoint via metadata.mcpEndpoint
(https://api.idescat.cat/mcp). It uses application/mcp-server-card+json:
the older application/mcp-server+json media type was deprecated in
ARD ADR-0008.
- The website pages also include a link to the manifest:
<link rel="ard" href="/.well-known/ard.json" type="application/json">
(the ard link relation replaces the predecessor ai-catalog relation).
robots.txt includes an Agentmap: directive pointing to the manifest.
- The MCP server is also advertised in the site's
llms.txt file.
MCP Registry
The server is listed in the official
MCP Registry under the name
cat.idescat/mcp (see server.json). MCP clients and
aggregators can retrieve its metadata from the registry API:
Interactive testing with MCP Inspector
Pinning a specific version (e.g. @2.0.0) keeps the tool reproducible and
avoids picking up unexpected changes; it requires Node.js >= 22.19.0. Any
npm warn deprecated ... / ERESOLVE messages come from the Inspector's own
dependencies and are harmless — they do not affect this MCP server.
Select the "Streamable HTTP" transport and enter the endpoint URL.
Links