Idescat MCP Server

cat.idescat由 idescat.cat 发布官方发布者v1.1.1更新于 Oct 27, 2026

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

已验证Streamable HTTP可网页运行位置与生活数据与分析

概览

AI 生成的概览

加泰罗尼亚官方统计(Idescat)的远程 MCP 服务器:浏览统计项目、查看表元数据,并获取 JSON-stat 数据或 Markdown 表格。

可以做什么
  • 列出并查看统计项目:完整目录、按缩写查询详情,以及每个统计项目包含的表
  • 查看表结构:维度、类别、单位以及可用的地域划分
  • 获取 JSON-stat 表数据,可整表或按维度、地域和最近期数筛选,并支持服务器端求和、占比与百分比变化
  • 生成现成的 Markdown 表格,含标题、单位、状态说明和原表链接
  • 读取随附资源,例如使用指南、地域代码词汇表和统计目录
适用场景
当你需要加泰罗尼亚的官方统计数据(人口、普查、GDP、劳动力等指标),范围涵盖加泰罗尼亚全境、县、市镇或省,并希望助手直接取数并制表而不是自行推测时适用。
运行要求
需要一个远程 Streamable HTTP 端点;无需身份验证、API 密钥或本地运行时。数据公开,标签为加泰罗尼亚语。仅支持 stdio 的客户端需借助 mcp-remote 之类的桥接,需安装 Node.js。
安装前请注意
所有工具均为只读,数据公开,不会暴露凭据。请求会发送至 Idescat 的 API,按服务器指南应注明来源表。大表上限为 20,000 个单元格,未筛选的查询可能被拒绝。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Idescat MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/cat.idescat%2Fmcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "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

来源:README.md,提交 c385655

工具

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.

无需输入参数。

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.

输入参数stat必填

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.

输入参数stat必填

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.

输入参数geostat必填table必填

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

输入参数geosumlaststat必填table必填derivefilters

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.

输入参数stat必填table必填

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.

输入参数geosumcolslastrowsstat必填table必填derivefilters

版本历史

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

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分