Idescat MCP Server

cat.idescatPublished by idescat.catOfficial publisherv1.1.1Updated Oct 27, 2026

Query official statistics of Catalonia (Idescat): tables, metadata and JSON-stat data via MCP.

VerifiedStreamable HTTPWeb executableLocation & LifestyleData & Analytics

Overview

AI-generated overview

Remote MCP server for official statistics of Catalonia (Idescat): browse statistics, inspect table metadata and fetch JSON-stat data or Markdown tables.

What you can do
  • List and inspect statistics: full catalogue, details by acronym, and the tables each statistic contains
  • Inspect table structure: dimensions, categories, units and available territorial divisions
  • Fetch table data in JSON-stat, whole or filtered by dimension, territory and last periods, with server-side sums, shares and percent changes
  • Render a ready-made Markdown table with title, units, status notes and a link to the source table
  • Read bundled resources such as usage guidance, a territorial-code glossary and the statistics catalogue
When to use it
Useful when you need official Catalan statistics — population, census, GDP, labour or similar indicators — for Catalonia, its counties, municipalities or provinces, and want the assistant to pull and tabulate the figures instead of guessing them.
Requirements
A remote Streamable HTTP endpoint; no authentication, API key or local runtime is needed. Data is public and labels are in Catalan. Stdio-only clients need a bridge such as mcp-remote, which requires Node.js.
Before you install
All tools are read-only and the data is public, so no credentials are exposed. Requests go to the Idescat API, and results should cite the source table as the server's guidance requires. Large tables are capped at 20,000 cells, so unfiltered queries may be refused.

Installation

In SourceWeft

  1. Open Idescat MCP Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/cat.idescat%2Fmcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "idescat": {
      "type": "http",
      "url": "https://api.idescat.cat/mcp"
    }
  }
}

README

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)

json
{	"mcpServers": {		"idescat": {			"serverUrl": "https://api.idescat.cat/mcp"		}	}}

Cursor, Roo Code, Zoo Code (type: streamable-http)

json
{	"mcpServers": {		"idescat": {			"type": "streamable-http",			"url": "https://api.idescat.cat/mcp"		}	}}

Cline (type: streamableHttp)

json
{	"mcpServers": {		"idescat": {			"type": "streamableHttp",			"url": "https://api.idescat.cat/mcp"		}	}}

VS Code and the emerging standard form (servers, type: http)

json
{	"servers": {		"idescat": {			"type": "http",			"url": "https://api.idescat.cat/mcp"		}	}}

Claude.ai (custom connector)

Claude.ai (web and desktop apps) can reach the remote server directly as a custom connector, no configuration file needed.

  1. Open Customize → Connectors
  2. Click Add custom connector.
  3. Fill in the fields:
    • Name: Idescat
    • Remote MCP server URL: https://api.idescat.cat/mcp
  4. Click Add. No authentication (OAuth / API key) is needed, since the data is public.
  5. Back in a chat, enable the Idescat connector from the tools/attachments menu. Its tools and resources are now available to the assistant.
  6. (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:

json
{	"mcpServers": {		"idescat": {			"command": "npx",			"args": ["-y", "mcp-remote", "https://api.idescat.cat/mcp"]		}	}}

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:

json
{	"mcpServers": {		"idescat": {			"url": "https://api.idescat.cat/mcp",			"serverUrl": "https://api.idescat.cat/mcp",			"type": "streamable-http",			"streamableHttp": "https://api.idescat.cat/mcp"		}	}}

Protocol versions

The server is dual-era (MCP versioning):

EraProtocol versionsHow the version is chosenBehaviour
Legacy2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05initialize negotiationExactly as before: JSON-RPC in → JSON-RPC out, ping, initialize; errors keep HTTP 200 (-32002 for a missing resource).
Modern2026-07-28params._meta["io.modelcontextprotocol/protocolVersion"] on every request (or server/discover)Results carry resultType: "complete", _meta serverInfo, and ttlMs/cacheScope on cacheable methods. initialize/ping don't exist here (-32601 → HTTP 404); a missing resource is -32602; an unsupported version is -32022; header violations are -32020 (HTTP 400).

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

ToolDescription
get_idescat_statsFull list of available statistics.
get_idescat_statInformation about a statistic (by acronym: censph, pibc, ...).
get_idescat_stat_tablesList of tables of a statistic.
get_table_metadataTable metadata (dimensions, categories, units, ...).
get_table_dataTable data in JSON-stat: full, or filtered by dimension/territory/periods with the optional filters and last parameters (max. 20,000 cells after applying filters). Supports server-side calculations: age-range filters (">=65"), sum of a dimension's categories and derive (share / difference / percent_change).
get_table_geoTerritorial divisions available for a table (cat, prov, com, mun, ...).
render_tableReady-pivoted Markdown table (selectable rows/columns) with an attribution link to the table on the Idescat website. Accepts the same calculations as get_table_data (age-range filters, sum, derive) and reports them in a "Calculations:" block under the table.

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):

URIDescription
idescat://instructionsUsage guidance.
idescat://glossary/geoGlossary of territorial codes (cat, prov, com, mun, ...).
idescat://catalog/statsFull catalogue of statistics.

Resource templates (resources/templates/list) — parametrised URIs:

URI templateDescription
idescat://stat/{stat}Information about a statistic (e.g. .../censph).
idescat://stat/{stat}/tablesList of tables of a statistic.
idescat://table/{stat}/{table}Table metadata (e.g. .../censph/538).
idescat://table/{stat}/{table}/dataJSON-stat data of a table (max. 20,000 cells).

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:

json
{ "filters": { "AGE": ">=65", "SEX": "TOTAL" }, "last": 1 }{ "sum": ["AGE"] }{ "derive": { "share": "AGE", "percent_change": "previous" } }
  • 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:

SkillURLDescription
jsonstathttps://www.idescat.cat/dev/api/taules/jsonstat/SKILL.mdHow to read JSON-stat 2.0 datasets: dimension index, row-major order, stride/offset arithmetic, null and status handling. Generic — useful with any JSON-stat producer.
workflowhttps://www.idescat.cat/dev/api/taules/workflow/SKILL.mdHow to query Idescat data reliably (via this MCP server or the Tables API): choosing the statistic and territorial level, metadata-first flow, the 20,000-cell limit and filters, and mandatory source citation.

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:

https://registry.modelcontextprotocol.io/v0.1/servers/cat.idescat%2Fmcp/versions/latest

Interactive testing with MCP Inspector

bash
npx @modelcontextprotocol/[email protected]

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

Source: README.md at commit c385655

Tools

7

get_idescat_stats

Obtains the complete list of Idescat statistics (all, normalized and non-normalized). It has no parameters. The response contains a 'statistics' array where each element has: 'acronym' (lowercase acronym, e.g., 'censph', to be used as the 'stat' argument of the other tools), 'name' (title), 'description' (summary), 'datasets' (boolean), 'geo' (array of available territorial disaggregations), and 'url' (initial web address, relative to https://www.idescat.cat). Use it when the user asks what statistics are available or when a statistic needs to be found by name or territorial disaggregation. THREE KEY FIELDS to decide the flow: (1) 'datasets' — if true, the statistic is normalized and you can use the rest of the tools (get_idescat_stat_tables, get_table_metadata, get_table_data, get_table_geo, render_table); if false, ONLY the information from this tool and get_idescat_stat is available. (2) 'geo' — available levels of geographical disaggregation (e.g., 'cat'=Catalonia, 'prov'=provinces, 'at'=territorial plan areas, 'com'=counties and Aran, 'mun'=municipalities, 'dis'=districts, 'sec'=census sections). ALWAYS CHECK 'geo' before choosing a statistic for a territorial query: if the user asks for county data, choose a statistic that includes 'com' in 'geo'. (3) 'url' — home page of the statistic on the Idescat website. POPULATION FIGURES: when population data is requested, there are several sources: the main and richest is CENSPH (population and housing census, annual); for semi-annual estimates there is EP (population estimates, semi-annual); and there is also PMH (municipal register of inhabitants, annual). By default, choose CENSPH (or EP if semi-annual data is requested) and NEVER use PMH for population data unless the user explicitly asks for it.

Takes no parameters.

get_idescat_stat

Obtains information about an Idescat (Statistical Institute of Catalonia) statistic given its acronym. Use it when the user asks about a specific statistic identified by its acronym (for example, CENSPH, EPA, PIBC, AFI, etc.). The 'datasets' field is a key boolean: if true, the statistic is normalized and therefore available in get_idescat_stat_tables and the rest of the table-level tools (metadata, data, divisions, etc.); if false, the statistic is NOT normalized and get_idescat_stat_tables will not recognize it (it would return an identifier error), so the only information available is what this same tool returns ('url', 'time_ref', 'update_date', 'update_title', 'update_text'). To know if a statistic has queryable tables, this tool is enough, without calling get_idescat_stat_tables. The 'url' field is a relative address to https://www.idescat.cat. The 'geo' field is an array with the available geographical disaggregation levels (e.g., 'cat', 'prov', 'at', 'com', 'mun', 'dis', 'sec'). POPULATION FIGURES: when population data is requested, the main and richest source is CENSPH (population and housing census, annual); for semi-annual estimates there is EP (population estimates, semi-annual); and there is also PMH (municipal register of inhabitants, annual). By default, choose CENSPH (or EP if semi-annual data is requested) and NEVER use PMH for population data unless the user explicitly asks for it.

Parametersstatrequired

get_idescat_stat_tables

Obtains the list of tables for an Idescat statistic given its official acronym. Use it when the user asks what tables or information a statistic has. The response contains a 'tables' array where each element has 'id' (numerical identifier) and 'name' (table title). Present each table as: name (id). Inform the user that they can request more details about a table by indicating its identifier.

Parametersstatrequired

get_table_metadata

Obtains the metadata for a specific Idescat table in JSON-stat format, given the statistic acronym (stat) and the table identifier (table). Use it when the user wants to know the details of a table: dimensions, categories available for each dimension (time periods, territorial scopes, sex, etc.), date of last update, units, etc. The acronym and identifier are previously obtained with get_idescat_stat_tables. At the end of the response, always include this Markdown link (substituting {stat} and {table} in lowercase): [See the results in this table](https://www.idescat.cat/pub/?id={stat}&n={table}). TERRITORIAL DIVISIONS: the response includes 'link.related', an array with other available territorial divisions (provinces, counties, municipalities, etc.); therefore it is often NOT necessary to call get_table_geo. If you pass the 'geo' parameter (for example geo='com' or geo='mun'), you get the metadata for that division, which includes the codes and labels (category.index / category.label) for the geographical dimension and the rest of the dimensions; use these codes directly to build the 'filters' parameter of get_table_data or render_table, without having to test and correct. SIZE CONTROL: check the 'size' field (array): the product of all its elements is the total number of cells. If it exceeds 20,000 (common case for municipal data), DO NOT retrieve the entire table; use get_table_data with filters (filters, last) to reduce the selection. If it is equal to or less than 20,000, you can retrieve it entirely with get_table_data.

Parametersgeostatrequiredtablerequired

get_table_data

Retrieves the data (values) of an Idescat table in JSON-stat format for a territorial division. You can retrieve the ENTIRE table (without filters) or only a SUBSET by passing the OPTIONAL parameters 'filters' (specific categories per dimension) and/or 'last' (number of last time periods); filtering returns smaller responses and allows querying tables that as a whole would exceed the limit. The filters use the dimension identifiers and category codes (category.index) returned by get_table_metadata (with the same 'geo'). IMPORTANT: the 20,000 cell limit is checked AFTER applying the filters; if it exceeds it, it returns a 'Dataset too large' error and you must add more filters (filters, last). You can call get_table_metadata beforehand to know the dimensions, periods, and category codes. The result contains: 'id' (dimension names in order), 'size' (number of categories per dimension), 'value' (flat array of values), 'dimension' (details per dimension: codes in category.index, labels in category.label, units in category.unit), 'role' (which dimensions are time, geo, or metric), 'status' (marks special values). HOW TO READ 'value' (row-major order): the array is FLAT; the LAST dimension of 'id' varies fastest and the first slowest. To get the value of a combination of categories (one per dimension) follow these 4 steps: (1) for each dimension, look for the POSITION (0-based) of the chosen category in dimension.{nom}.category.index — this 'index' can be a code→position object or a list of codes (the position is the index within the list); ALWAYS use this index, DO NOT assume alphabetical order or by label; (2) the stride of each dimension = product of the 'size' of the SUBSEQUENT dimensions (the last dimension has stride 1); (3) offset = sum of (position × stride) of all dimensions; (4) the searched value is value[offset]. Use the order of the 'id' array in all steps (NOT the order of keys in 'dimension'). EXAMPLE: id=['territory','sex'], size=[3,2], territory.index={BC

Parametersgeosumlaststatrequiredtablerequiredderivefilters

get_table_geo

Obtains the list of territorial divisions available for an Idescat table (for example: cat=Catalonia, com=counties and Aran, mun=municipalities, prov=provinces, at=territorial plan areas). The response contains a 'divisions' array where each element has 'id' (division code) and 'name' (label). Often it is NOT necessary to call it because get_table_metadata already returns these divisions in 'link.related'. Use it only if you need the list of divisions without having called the metadata. The 'id' code is the value to pass to the 'geo' parameter of get_table_metadata, get_table_data, or render_table. If not specified, these tools use the 'cat' division (Catalonia as a whole) by default.

Parametersstatrequiredtablerequired

render_table

Returns a Markdown table already built with the filtered data from an Idescat table, ready to be shown to the user without having to interpret the JSON-stat. It includes the title, units, the table with category labels, status notes (e.g., provisional data), and ALWAYS a final link to the table on the Idescat website that must be kept in the response to the user. By default, it puts the time dimension in rows and the first dimension with more than one category in columns; this can be changed with the 'rows' and 'cols' parameters. All other dimensions with more than one category must be reduced to a single category with 'filters'. IMPORTANT (error self-correction): if the tool returns the error with 'pending_dimensions', DO NOT change tools: call render_table again adding the 'filters' parameter with a single category for each pending dimension (you can start from the 'suggested_filters' field that comes in the same error response, but choose the appropriate category for the user's question according to 'categories'). If it then returns the size error (maximum 40 rows × 15 columns), follow the 'how_to_fix' field: if the time dimension has too many columns, add the 'last' parameter (e.g., last: 12), and if the rows dimension is too large, filter it with 'filters' or swap 'rows'/'cols'. You can chain 'filters' and 'last' in the same call. The values '..' indicate data not available. CALCULATIONS: never add, subtract or compute percentages yourself from the returned values; use filters ranges, sum and derive and report the server's result, checking that the Calculations notes under the table (codes used, warnings) match the question.

Parametersgeosumcolslastrowsstatrequiredtablerequiredderivefilters

Version history

3
  1. v1.1.1LatestOct 26, 2026
  2. v1.1.0Oct 16, 2026
  3. v1.0.0Sep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts