Opendata.cat MCP Server
The Opendata.cat MCP Server connects LLMs (Claude, ChatGPT, Gemini, etc.) to 3,000+ public datasets from 15 Catalan and Spanish open data portals, enabling discovery, exploration, and real-time querying directly from an AI assistant. The catalog is updated weekly.
Core tools:
search_datasets: Search by free text across all portals, with optional filters by portal or thematic category.get_dataset_info: Retrieve full metadata for any dataset — field definitions, data types, API endpoint, and license.list_dataset_fields: Inspect the schema of a dataset (field names, types, descriptions).query_dataset: Execute live queries against the source portal to retrieve actual data rows, with support for filters, free-text search, and pagination (max 100 rows).list_portals: Overview of all 15 indexed portals with dataset counts.list_categories: Discover thematic categories and dataset counts per portal.related_datasets: Find complementary datasets from other portals given a dataset ID.search_radioteca: Search ~485,000 episodes, programs, and people from Catalan and Spanish radio stations (Catalunya Ràdio, RAC1, iCat, RTVE, etc.).
Data sources & highlights:
Catalan portals: Generalitat de Catalunya, Ajuntament de Barcelona, Diputació de Barcelona, FGC, Renfe Rodalies, Girona, Reus, AOC, and more.
National sources (Catalonia-focused): INE (population, CPI), REE (electricity), SEPE (unemployment), CNMC (fuel prices at ~1,500 stations).
Real-time data: Train positions/delays (GTFS-RT for FGC and Renfe Rodalies), live electricity prices (PVPC), reservoir levels.
Municipal data: Budgets, service costs, and debt for 1,000+ Catalan municipalities.
It integrates with Claude Desktop, Claude Code, VS Code/Cursor, and other LLM clients via npm or a Streamable HTTP endpoint.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Opendata.cat MCP Serversearch for datasets related to public transport in Barcelona"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Opendata.cat MCP Server
Servidor MCP (Model Context Protocol) que connecta els models de llenguatge (Claude, ChatGPT, Gemini...) amb les dades obertes publiques de Catalunya. Cerca datasets, explora metadades i consulta dades reals de 15 portals directament des del teu assistent d'IA.
Un projecte d'opendata.cat — associacio sense anim de lucre fundada el 2012 que promou la transparencia, la difusio i l'estandarditzacio de les dades obertes a Catalunya. Inspirat en el projecte datagouv-mcp del govern frances.
Portals disponibles
Portals catalans
Portal | Datasets | API |
1.059 | Socrata (SoQL) | |
~887 | CKAN datastore | |
555 | CKAN datastore | |
138 | Idescat API | |
119 | CKAN datastore | |
90 | REST + JSON:API (CIDO) | |
53 | CKAN datastore | |
50 | Opendatasoft + GTFS-RT | |
6 | CKAN + GTFS-RT JSON |
Fonts estatals amb focus Catalunya
Font | Datasets | Que aporta |
6 | Poblacio, IPC, EPA (atur/ocupacio), turisme, PIB, habitatge — auto-filtrat a Catalunya | |
4 | Generacio electrica (mix energetic), demanda, balanc, preus PVPC temps real | |
2 | Atur registrat i contractes per municipis catalans | |
1 | Preus carburants a ~1.500 gasolineres de Catalunya, filtrables per municipi |
+3.073 datasets de 15 portals. La majoria queryables amb filtres, cerca i paginacio.
El cataleg s'actualitza automaticament cada setmana. Crawling incremental amb --portal per carregar fonts noves sense re-escanejar tot.
Tipus d'acces:
Socrata: consulta SoQL amb filtres i cerca (Generalitat)
CKAN: datastore_search amb filtres i cerca (Barcelona, AOC, Reus, Girona, Renfe)
Diba REST: API do.diba.cat amb paginacio i filtres (Diputacio BCN)
CIDO JSON:API: api.diba.cat per contractacions, normatives, subvencions (Diputacio BCN)
Opendatasoft: API records amb filtres i cerca (FGC)
GTFS-RT: posicions GPS, alertes i retards dels trens FGC i Renfe Rodalies en temps real
Idescat: indicadors estadistics amb series temporals
INE: estadistica oficial d'Espanya filtrada automaticament a Catalunya
REE: generacio electrica, demanda i preus de l'electricitat (PVPC) en temps real
CNMC: preus de carburants per estacio de servei, filtrables per CCAA/provincia/municipi
GIS: simplificacio automatica de geometries (centroide + bbox)
Dades municipals AOC: 9 datasets amb dades de +1.000 municipis, filtrables per NOM_ENS
Related MCP server: Spanish Public Data MCP
Installacio rapida
Claude Desktop
Afegeix al fitxer de configuracio (~/Library/Application Support/Claude/claude_desktop_config.json a macOS o %APPDATA%\Claude\claude_desktop_config.json a Windows):
{
"mcpServers": {
"opendata-cat": {
"command": "npx",
"args": ["-y", "@opendata.cat/mcp-server"]
}
}
}Claude Code (CLI)
claude mcp add opendata-cat -- npx -y @opendata.cat/mcp-serverVS Code / Cursor
Afegeix al fitxer .vscode/mcp.json del teu projecte:
{
"servers": {
"opendata-cat": {
"command": "npx",
"args": ["-y", "@opendata.cat/mcp-server"]
}
}
}Windsurf / Cline / JetBrains / Gemini CLI / Warp / ChatGPT / Copilot Studio
Consulta la guia completa amb instruccions per a 13 clients MCP a opendata.cat/mcp.
Tambe pots connectar directament via Streamable HTTP sense instal·lar res:
https://opendata.cat/api/mcpTools disponibles
Tool | Descripcio |
| Cerca datasets per text lliure al cataleg de +3.073 datasets |
| Retorna metadades completes: camps, tipus, llicencia, endpoint |
| Llista els camps d'un dataset amb nom, tipus i descripcio |
| Consulta dades reals directament al portal origen |
| Llista els 15 portals disponibles amb estadistiques |
| Llista categories i temes disponibles amb comptadors |
| Retorna datasets relacionats d'altres portals |
| Cerca al cataleg de radioteca.cat (~485K episodis, programes i persones de Catalunya Radio, RAC1, Catalunya Musica, iCat, RTVE...). Sempre retorna URL absolut a radioteca.cat per trayabilitat |
search_datasets
Cerca datasets per text lliure.
query: "qualitat aire"
portal: "barcelona" # opcional: generalitat, barcelona, diba, aoc, reus, girona, fgc, idescat, renfe, ine, ree, sepe, cnmc
category: "Medi Ambient" # opcional
limit: 20 # opcional (defecte: 20)query_dataset
Executa una consulta directament contra el portal origen i retorna dades reals.
dataset_id: "generalitat:gn9e-3qhr"
filters: {"estaci": "Sau"} # opcional
search: "embassament" # opcional
limit: 20 # opcional (defecte: 20, max: 100)
offset: 0 # opcionalExemples de filtres per fonts estatals:
INE: auto-filtrat a Catalunya (poblacio, IPC, turisme...)
REE:
ree:preus-electricitat— preus PVPC per horaCNMC:
filters: {"municipi": "Sabadell"}— gasolineres de Sabadell
Skills
A més de les tools i els prompts, el servidor publica skills: guies d'investigació
(estil SKILL.md) que orienten l'LLM pas a pas en un domini concret — com triar el dataset,
filtrar, paginar i citar bé. Es distribueixen dins el paquet (skills/) i es serveixen com a
resources MCP (skill://<nom>/SKILL.md, via resources/list + resources/read) i com a
prompts-pont invocables com a slash-command (/mcp__opendata_cat__skill_<nom>).
Skill | Per a què |
| Orientació general: navegar els 15 portals, consultar directe vs cercar, paginació, cites |
| Investigar contractació pública: creuar PSCP, registres municipals i adjudicacions, sumar imports |
| Retrat complet d'un municipi creuant portals (pressupost, deute, contractes, població) |
| Recerca a Catalònica (BNC) i radioteca.cat amb selecció de subportal i cites obligatòries |
Les mateixes skills es serveixen també des de l'endpoint HTTP https://opendata.cat/api/mcp.
Exemples d'us
Un cop configurat, pots fer preguntes al teu LLM com:
"Quin es l'estat dels embassaments de Catalunya?"
"Hi ha algun tren de Rodalies o FGC amb retard ara mateix?"
"Quina es la poblacio de Catalunya segons l'INE?"
"Quin es el preu de la gasolina a Sabadell avui?"
"Quant costa l'electricitat ara? (PVPC)"
"Analitza la qualitat de l'aire a Terrassa"
"Quina es la taxa d'atur a Catalunya?"
"Quantes pernoctacions turistiques hi ha a Barcelona?"
"Compara Girona i Tarragona en dades obertes"
"Dona'm les ultimes dades de pressupostos de Reus"
"Quin es l'endeutament de Tiana?"
Com funciona
Usuari → LLM → MCP opendata.cat → API opendata.cat (cataleg)
→ Portal origen (dades reals)L'MCP consulta l'API d'opendata.cat per descobrir datasets rellevants
Quan l'usuari vol dades concretes, l'MCP fa la consulta directament al portal origen
Les dades tornen a l'LLM, que les interpreta i presenta a l'usuari
No emmagatzema ni fa de proxy de dades. Cada consulta va directament a la font oficial.
API REST
A mes del servidor MCP, opendata.cat ofereix una API REST publica:
Endpoint | Descripcio |
| Llistat complet amb paginacio, filtres i sort |
| Cerca datasets per text lliure |
| Detall complet d'un dataset |
| Categories i portals amb comptadors |
| Servidor MCP (Streamable HTTP) |
Documentacio interactiva (Swagger): opendata.cat/api/docs.html
Sobre opendata.cat
opendata.cat es una associacio catalana sense anim de lucre fundada el 2012 (registre 47468) dedicada a promoure la transparencia i l'acces a la informacio publica.
Changelog
v0.6.0 (2026-07-15)
Noves skills servides com a resources MCP (
skill://<nom>/SKILL.md) + prompts-pont (skill_<nom>)4 skills d'investigació:
consulta-dades-obertes,contractacio-publica,radar-municipal,patrimoni-i-hemerotecaEmpaquetades a
skills/i sincronitzades amb l'endpoint HTTPopendata.cat/api/mcp
v0.5.0 (2026-06-06)
Nou tool
search_radioteca: cerca a radioteca.cat (~485K documents de radio catalana — 8 emissores)Filtres
publisher,year,type(Episode/Program/Person)Tots els hits inclouen URL absoluta a radioteca.cat per trayabilitat
Proxy server-side a opendata.cat — la clau de Typesense no s'exposa al paquet npm
v0.3.1 (2026-04-17)
Handler CNMC preus carburants al paquet npm (abans nomes funcionava via HTTP)
Filtre per municipi i provincia:
filters: {"municipi": "Sabadell"}Per defecte retorna tota Catalunya (~1.500 gasolineres)
Nova og:image amb 13 portals i fonts estatals
v0.3.0 (2026-04-16)
5 noves fonts estatals espanyoles amb focus Catalunya: INE, REE, SEPE, CNMC
Handler INE: estadistica oficial (poblacio, IPC, EPA, turisme, PIB, habitatge) auto-filtrat a Catalunya
Handler REE: generacio electrica, demanda, balanc, preus PVPC en temps real
Handler CNMC: preus carburants amb filtres per CCAA/provincia/municipi via API REST
Crawler incremental: flag
--portalper carregar fonts noves sense re-escanejar tot13 portals, 2.857 datasets
v0.2.0 (2026-04-15)
Nou portal Renfe (Rodalies de Catalunya) — 6 datasets (estacions, viatgers, GTFS-RT temps real)
Handler GTFS-RT JSON amb filtre automatic a rutes Rodalies Barcelona (R1-R16, RT, RG, RL)
Instruccions reescrites en angles per millorar comprensio dels LLMs
Llistats de portals, keywords i categories a les instruccions
Tool descriptions i prompts traduits a angles
Nou prompt trens_rodalies_temps_real
v0.1.2 (2026-04-14)
Instructions integrades: l'LLM rep datasets destacats i pot fer query directe sense cercar
Fix Idescat: ara retorna l'indicador especific en lloc de 6 aleatoris
9 datasets municipals AOC: pressupostos, cost serveis, endeutament de +1.000 municipis
v0.1.0 (2026-04-14)
Nou portal Idescat — 138 indicadors estadistics amb series temporals
Portals Reus i Girona
v0.0.17 (2026-04-14)
Decodificador GTFS-RT integrat: trens FGC en temps real
API REST documentada amb Swagger UI (OpenAPI 3.1)
v0.0.10 (2026-04-13)
Portal FGC (50 datasets via Opendatasoft)
14 prompts predefinits
v0.0.1 (2026-04-12)
Versio inicial: Generalitat, Barcelona, Diba, AOC — 6 tools, npm
Llicencia
MIT
Available Tools
3 toolslist_dataset_fieldsAInspect
List fields of a dataset with name, data type and description.
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | Dataset identifier |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It implies a read-only operation by stating 'list', but does not explicitly disclose safety or authorization needs. For a simple tool with one parameter, this is minimally adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core purpose and the returned fields. No redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity tool with one parameter and no output schema, the description sufficiently specifies what the tool does and what fields are returned. However, lacking an output schema, the description does not detail the structure (e.g., list of JSON objects), which would be beneficial.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with dataset_id described as 'Dataset identifier'. The description does not add new meaning beyond the schema, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('list fields') and the resource ('dataset'), and lists the returned attributes (name, data type, description). This distinguishes it from siblings like get_dataset_info (dataset metadata) and query_dataset (run queries).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There is no mention of prerequisites, exclusions, or context-specific recommendations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_radiotecaAInspect
Search radio shows, episodes and people indexed at radioteca.cat (Catalan radio archive, ~485K documents from Catalunya Ràdio, RAC1, Catalunya Música, iCat, Catalunya Informació, RTVE, Cadena SER, ara.cat). Searches title, description (which contains a detailed summary of what was said), program name and subheading. Returns episodes (~473K), programs (~3K) and people (~9K). IMPORTANT: always cite radioteca.cat as the source and include each hit's absolute 'url' in your reply for traceability — never paraphrase episodes without linking.
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter by document type. | |
| year | No | Filter by year (4 digits, e.g. '2025'). NOTE: only year-level filtering is indexed; for a specific day combine year + keywords and inspect the URL path (radioteca URLs include /YYYY/MM/DD/) or the 'subheading' field which often contains the date. | |
| limit | No | Maximum results (1-50). Default 10. | |
| query | Yes | Free text in Catalan or Spanish. Searches title, description (contains episode summary), program and subheading. Examples: 'visita papa', 'eleccions municipals', 'crisi habitatge', 'Albert Serra cinema'. | |
| offset | No | Pagination offset. Default 0. | |
| publisher | No | Filter by broadcaster. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that the tool searches across multiple fields, returns three types of results with counts, and requires citation and linking. It does not mention side effects or permissions, but for a read-only search tool this is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is 3-4 sentences that convey essential information: source, search scope, result types, and critical usage instructions. It is compact but not overly terse; each sentence serves a purpose. Minor redundancy in listing broadcasters twice could be tightened, but overall it's efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 6 parameters (including enums) and no output schema, the description provides a solid overview: it names the fields searched, result categories with counts, and important behavioral notes (citation, URL). It could be more complete by describing the output fields or return structure, but the current level is adequate for an AI agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by explaining the year parameter's limitation (only year-level indexing) and suggesting a workaround using keywords and URL path, which goes beyond what the schema provides. This extra guidance justifies a score of 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches radio shows, episodes, and people from the specific Catalan radio archive radioteca.cat, listing exact broadcasters and document counts. It uniquely identifies the tool's resource and scope, effectively distinguishing it from sibling tools that focus on datasets.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear usage context (source, languages, searchable fields) and critical instructions like citing the source and including URLs for traceability. However, it does not explicitly describe when not to use this tool or mention alternative tools for different contexts.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v0.6.0- Removed
get_dataset_info - Removed
list_categories - Removed
list_portals - Removed
query_dataset - Removed
search_datasets
8 tool updates
v0.5.1- First observed
get_dataset_info - First observed
list_categories - First observed
list_dataset_fields - First observed
list_portals - First observed
query_dataset - First observed
related_datasets - First observed
search_datasets - First observed
search_radioteca
TDQS
Each tool serves a clearly distinct purpose: listing fields of a specific dataset, finding related datasets from other portals, and searching a radio archive. No overlap in functionality.
Naming is inconsistent: 'list_dataset_fields' follows verb_noun, 'related_datasets' is a noun phrase without a verb, and 'search_radioteca' uses verb_noun with a proper name. No consistent pattern.
With only 3 tools, the server feels very limited for an open data portal. However, the tools cover distinct areas, so the count is not unreasonable but could be expanded.
The server lacks fundamental open data operations such as searching datasets, listing all datasets, or retrieving dataset metadata. The inclusion of a radio archive tool seems out of scope and does not fill the gaps.
Maintenance
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
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Give your agent web search and authoritative datasets: S&P Global, FRED, OECD, SimilarWeb & more.
Verified Polish open data for AI agents: debt, budget, 460 MPs, votings, judiciary search, RAG.
Real-world data for agents: air quality, geocoding, quakes, holidays, web search
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAccess to many public datasets right from your LLM application.154MIT
- AlicenseAqualityDmaintenanceMCP server for querying Spanish government open data APIs including grants, legislation, company registry, statistics, and open data catalog. Enables LLMs to access Spanish public information on-the-fly.265MIT
- AlicenseNot gradedqualityDmaintenanceConnects open data to LLMs via MCP, enabling easy access to public datasets and publishing new datasets with community help.MIT
- AlicenseAqualityCmaintenanceEnables querying and analyzing over 90,000 public datasets from the Spanish Government Open Data Portal (datos.gob.es) using natural language, with tools for search, filtering, metadata access, and SPARQL queries.105MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/xaviviro/Opendata.cat-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server