A practical demonstration of how Claude, through the Opendata Explorer MCP connector, can autonomously query, analyse and visualise the entire open data catalogue of a CKAN portal.
Opendata Explorer is an MCP (Model Context Protocol) server that exposes to Claude a set of tools to query any CKAN portal and public SPARQL endpoint, without the user needing to know the underlying APIs.
Claude receives the request in natural language, autonomously selects which tool to call, builds the correct parameters and interprets the response for the user.
| Tool | Description | Used in this demo |
|---|---|---|
| ckan_catalog_stats | Global portal statistics: total datasets, distribution by format, category, organization | ✓ Step 2 |
| ckan_organization_list | Lists all organizations on a portal with dataset count, sorting and pagination | ✓ Step 3 |
| ckan_organization_show | Detail of a single organization with published datasets and users | |
| ckan_organization_search | Search organizations by name pattern (with automatic wildcards) | |
| ckan_package_search | Full-text dataset search with Solr filters (format, organization, tag, date) | |
| ckan_package_show | Complete metadata for a single dataset (resources, licence, author, dates) | |
| ckan_datastore_search | Tabular query on a CKAN DataStore resource (SELECT equivalent with filters) | ✓ Use case |
| ckan_datastore_search_sql | Arbitrary SQL query on a DataStore resource | |
| ckan_analyze_datasets | Searches datasets and inspects the DataStore schema of queryable resources | |
| ckan_find_portals | Search the global datashades.info registry (~950 CKAN portals worldwide) | |
| ckan_find_relevant_datasets | Finds and ranks datasets by semantic relevance to a query | ✓ Use case |
| ckan_list_resources | Lists all resources in a dataset with format, URL, size | ✓ Use case |
| ckan_group_list / _show / _search | Navigation of a portal's thematic groups | |
| ckan_get_mqa_quality | MQA (Metadata Quality Assurance) quality metrics for datasets on dati.gov.it | |
| sparql_query | Executes SPARQL SELECT queries on any public HTTPS endpoint (Wikidata, data.europa.eu, etc.) |
First call: fetch of the homepage to verify the portal type and CKAN version exposed in the HTML header.
No Opendata Explorer tool was needed in this step. Claude performed a direct HTTP fetch of the homepage to read the HTML metatags.
| Type | Multi-entity CKAN aggregator portal |
| CKAN version | 2.10.3 (rebuilt by Piersoft) |
| URL | opendata.maggioli.cloud |
| Language | Italiano |
| Visible thematic groups | Governo, Agricoltura, Cultura, Economia, Giustizia |
Call to the ckan_catalog_stats tool to obtain in a single API request the total dataset count and their distribution by format, category and organization.
Parameters passed to the tool: server_url = "https://www.opendata.maggioli.cloud", facet_limit = 10, response_format = "json"
| Group | Dataset | % |
|---|---|---|
| Governo | 5.969 | 99.6% |
| Agricoltura | 11 | 0.18% |
| Cultura | 11 | 0.18% |
| Economia | 4 | 0.07% |
| Giustizia | 2 | 0.03% |
Note: thematic classification is very incomplete — almost all datasets are generically catalogued as "Governo". This reflects a metadata gap on the part of the publishing entities.
Call to the ckan_organization_list tool to retrieve the full list of public bodies on the portal, sorted by number of published datasets.
Parameters: server_url="https://www.opendata.maggioli.cloud", all_fields=true, limit=200, sort="package_count desc", response_format="json"
Charts generated from the JSON response of ckan_organization_list (181 records). Entity type and geographic classification were inferred from the organization name.
Source: package_count field in ckan_organization_list response, desc sort.
Source: classification inferred from title field (prefix "Comune di", "Provincia di", "Città Metropolitana", rest → Other).
Source: manual mapping municipality→region→macro-area (North, Centre, South, Islands) on title field.
All records returned by ckan_organization_list. Filterable by name and type, sortable by column. The link leads to the organization's CKAN page.
| # | Organization ↕ | Type ↕ | Datasets ↕ |
|---|
The original CKAN server responses, as received by the Opendata Explorer connector and passed to Claude.
Of 181 organizations on the portal, 6 publish road accident datasets with data queryable via DataStore. Datasets were found with ckan_find_relevant_datasets (query: "incidenti", 116 total results, filtered by relevance), then real data was extracted with ckan_list_resources + ckan_datastore_search.
Search performed with ckan_find_relevant_datasets — query: "incidenti", weights: title=5, notes=2, tags=3. 116 results returned; the municipalities below have datasets with datastore_active: true, enabling direct API data queries.
13 dataset
Comune di Maranello 15+ dataset
Comune di Formigine 10+ dataset
Comune di Fiorano Modenese 5+ dataset
Comune di Piacenza serie storica 2022-2024
Comune di Seriate 3.241 record 2000-2013
Note: many other municipalities have Local Police datasets tagged "Polizia Locale 2024/2025" containing accident data, but generically classified under "Governo". Keyword search on the title is the most effective discovery method.
Tool: ckan_list_resources + ckan_datastore_search · Dataset: "Gravità incidenti 2024" · Fields: Tot.incidenti, Mortali, Con feriti, Senza feriti
2f5c8818
Maranello · resource 60b247bd
Formigine · resource 511ff626
Fiorano M. · resource c9c4f7fe
Dataset: Incidenti per mese 2024 · resource 92131d66 · Tool: ckan_datastore_search
Dataset: Dati Numero di Incidenti al 2024 · resource 4acff115 · Tool: ckan_datastore_search · Fields: ANNO, NUMERO INCIDENTI
Dataset: Incidenti stradali 2000–2013 · resource 823e236e · Tool: ckan_datastore_search · 3,241 records · Fields: Anno, Natura Incidente, N Feriti, N Morti, Pedoni, Velocipedi…