xaviviro avatar

Opendata Cat

xaviviro/opendata.cat-mcp-server

This server connects Claude to 2,991 public datasets across 14 Catalan and Spanish government portals. It exposes seven tools including search_datasets for full-text catalog search, query_dataset for live data queries with filters and pagination, and get_dataset_info for metadata inspection. You can pull real-time train positions via GTFS-RT from FGC and Renfe, query reservoir levels from Generalitat's Socrata API, check fuel prices by municipality from CNMC, or grab electricity pricing from REE. Built by opendata.cat, a nonprofit promoting open data transparency in Catalonia since 2012. The catalog auto-updates weekly and queries hit source APIs directly rather than proxying data. Reach for this when you need programmatic access to Catalan budgets, demographics, transport, environmental data, or CORA research outputs without manually wrangling thirteen different API formats.

GitHub stars
22
tools
8
transport
STDIO, HTTP
last updated
Jul 30, 2026

Install

From registry metadata
$ npx add-mcp https://opendata.cat/api/mcp --name opendata-cat

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http opendata-cat https://opendata.cat/api/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 8 tools

Verified live against the running server on Nov 6, 2026.

search_datasetsSearch datasets by free text. IMPORTANT: check server instructions first — many common queries have a direct dataset_id you can use with query_dataset without searching. Only use search_datasets when you don't know which dataset you need.4 params

Search datasets by free text. IMPORTANT: check server instructions first — many common queries have a direct dataset_id you can use with query_dataset without searching. Only use search_datasets when you don't know which dataset you need.

Parameters* required
categorystring
Filter by thematic category. Examples: 'Medi Ambient', 'Educació', 'Salut', 'Economia', 'Transport', 'Seguretat'. Use list_categories to see all available categories.
limitnumber
Maximum number of results to return. Min 1, max 100. Default 20.default: 20
portalstring
Filter results to a single portal.one of generalitat · barcelona · diba · aoc · reus · girona
query*string
Search text in Catalan or Spanish. Examples: 'qualitat aire', 'pressupostos municipals', 'transport públic', 'residus', 'educació', 'rodalies'.
get_dataset_infoGet complete metadata for a dataset: fields with types and descriptions, API endpoint, license, available formats and last update. Call after search_datasets to get full details of a specific dataset.1 params

Get complete metadata for a dataset: fields with types and descriptions, API endpoint, license, available formats and last update. Call after search_datasets to get full details of a specific dataset.

Parameters* required
dataset_id*string
Unique dataset identifier in 'portal:id' format. Obtained from search_datasets results. Examples: 'generalitat:gn9e-3qhr', 'barcelona:qualitat-de-laire', 'renfe:vehicle-positions-gtfsrt'.
list_dataset_fieldsList fields of a dataset with name, data type and description. Call before query_dataset to know which fields and filters are available.1 params

List fields of a dataset with name, data type and description. Call before query_dataset to know which fields and filters are available.

Parameters* required
dataset_id*string
Unique dataset identifier in 'portal:id' format. Obtained from search_datasets results.
query_datasetQuery real data from a dataset. Check instructions for featured dataset_ids and NOTES section for common filter patterns (municipal budgets, contracts, weather, energy, fuel prices).5 params

Query real data from a dataset. Check instructions for featured dataset_ids and NOTES section for common filter patterns (municipal budgets, contracts, weather, energy, fuel prices).

Parameters* required
dataset_id*string
Unique dataset identifier in 'portal:id' format. Obtained from search_datasets results.
filtersobject
Key-value filters where the key is the field name and the value is the filter value. Examples: {"municipi": "Barcelona"}, {"any": "2024"}, {"NOM_ENS": "Ajuntament de Tiana"}. Use list_dataset_field...
limitnumber
Number of rows to return. Min 1, max 100. Default 20. Use offset for pagination.default: 20
offsetnumber
Number of rows to skip for pagination. Default 0. Combine with limit to navigate large results.default: 0
searchstring
Free text search within dataset data. Works with Socrata ($q) and CKAN (q). For Diba and CIDO, use specific filters.
list_portalsList all 13 indexed open data portals with dataset counts. Catalan portals (Generalitat, Barcelona, Diba, AOC, Reus, Girona, FGC, Idescat, Renfe) + Spanish national sources with Catalonia focus (INE statistics, REE energy, SEPE employment, CNMC fuel prices). No parameters requ...

List all 13 indexed open data portals with dataset counts. Catalan portals (Generalitat, Barcelona, Diba, AOC, Reus, Girona, FGC, Idescat, Renfe) + Spanish national sources with Catalonia focus (INE statistics, REE energy, SEPE employment, CNMC fuel prices). No parameters requ...

No parameters. Call it with no arguments.

list_categoriesList all dataset categories and themes with counts per portal. Great first step to discover what data types are available before searching with search_datasets. Returns total datasets, count per portal and category list with counts. No parameters required.

List all dataset categories and themes with counts per portal. Great first step to discover what data types are available before searching with search_datasets. Returns total datasets, count per portal and category list with counts. No parameters required.

No parameters. Call it with no arguments.

related_datasetsFind related datasets from OTHER portals. Great for discovering complementary data: if you're looking at air quality from Generalitat, it may suggest traffic data from Barcelona or emissions from AOC. Relations are computed by thematic similarity across portals.1 params

Find related datasets from OTHER portals. Great for discovering complementary data: if you're looking at air quality from Generalitat, it may suggest traffic data from Barcelona or emissions from AOC. Relations are computed by thematic similarity across portals.

Parameters* required
dataset_id*string
Dataset ID to find related datasets for. Obtained from search_datasets.
search_radiotecaSearch 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 across episode titles, descriptions (which include a detailed...6 params

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 across episode titles, descriptions (which include a detailed...

Parameters* required
limitnumber
Maximum results. Min 1, max 50. Default 10.default: 10
offsetnumber
Pagination offset. Default 0.default: 0
publisherstring
Filter by broadcaster.one of Catalunya Ràdio · RAC1 · Catalunya Música · iCat · Catalunya Informació · RTVE
query*string
Free text in Catalan or Spanish. Searches title, description (contains episode summary), program and subheading. Examples: 'visita papa', 'eleccions municipals', 'crisi habitatge', 'Albert Serra ci...
typestring
Filter by document type.one of Episode · Program · Person
yearstring
Filter by year (4 digits, e.g. '2025'). NOTE: only year-level filtering is indexed; for a specific day, use the broader year filter and look at the URL path (radioteca URLs include /YYYY/MM/DD/) or...

Sponsors

Readme

Opendata.cat MCP Server — Connecta el teu LLM amb les dades obertes de Catalunya

npm npm downloads github web license

Opendata.cat MCP Server


View the full README on GitHub

Details

Repository
github.com/xaviviro/opendata.cat-mcp-server
Package
@opendata.cat/mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
4
Prompts
21
Tools verified
Nov 6, 2026