MCP server for interacting with CKAN open data portals
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Turn any (CKAN) open data portal into a conversation.
Give your AI assistant direct access to any CKAN open data portal โ search datasets, explore organizations, query tabular data, and read metadata, all through natural language.
CKAN is the open-source platform behind most public open data portals worldwide (Italy's dati.gov.it, the US data.gov, Canada's open.canada.ca, and many more). Navigating these portals usually requires knowing their structure, APIs, and search syntax. This MCP server removes that barrier: once connected, your AI tool can do it all for you.
This is possible because of open standards and open source. CKAN exposes a fully documented, public API. Metadata follows DCAT, an open W3C standard for describing datasets. Both are free to use, free to build on, and maintained by open communities. This server stands on that foundation.
Who is this for? Everyone. Journalists looking for data to verify a story. Researchers exploring public datasets. Public servants checking what data their administration publishes. Developers building data pipelines. No CKAN knowledge required.
Adopted by AgID โ This project has been reused by AgID, Italy's Agency for Digital Italy, as part of its effort to make public open data more accessible, immediate, and easier to consult through AI.
Two ways to use it โ pick the one that suits you:
| Option A: Install locally | Option B: No install | |
|---|---|---|
| How | npm install -g @aborruso/ckan-mcp-server | Point your tool to the hosted HTTP endpoint |
| Best for | Runs on your machine, works with any local tool | Quick start, zero setup |
| Request quota | No shared quota | 100k requests/day shared quota |
Hosted endpoint: https://ckan-mcp-server.andy-pr.workers.dev/mcp
Recommendation: Option B is a great way to get started and try things out without any setup. Once you're familiar with what the server can do, switching to Option A (local install) gives you unlimited usage with no shared quotas.
๐ Want to explore the codebase? The AI-generated DeepWiki is a great starting point.
License: MIT โ see LICENSE for complete details. Third-party notices: NOTICE.md.

The local and hosted server use the same tool and output caps. The hosted endpoint also has the shared request quota shown above.
| Area | Default | Maximum or configuration |
|---|---|---|
| Tool output | 50,000 characters | Fixed server-wide cap |
ckan_datastore_search rows | 100 | 32,000 (0 returns column names only) |
ckan_package_search results per page | 10 | 1,000 |
ckan_find_relevant_datasets results | 10 | 50 |
Injected sparql_query rows | 25 | 1,000 when injected; a query that supplies its own LIMIT is not capped |
ckan_tag_list results | 100 | 1,000 |
ckan_find_portals results | 10 | 50 |
| HTTP response body | 32 MiB | CKAN_MAX_RESPONSE_BYTES for local Node.js deployments |
| Decompressed response body | 64 MiB | CKAN_MAX_DECOMPRESSED_BYTES for local Node.js deployments |
Text and Markdown responses that exceed the output cap are cut and include a truncation note. JSON responses stay parseable: the server reduces known result arrays and flags the response with _truncated and _original_count, and if a response still cannot fit it is replaced by a small object carrying _truncated and an explanatory _error. The same capped payload is sent on both channels, so a client reading structuredContent sees exactly what the text shows, truncation flags included. Use pagination or a narrower query when you need the complete result set.
ChatGPT | Claude Desktop | Claude Code | Le Chat (Mistral) | Perplexity Pro | Gemini CLI | VS Code | Codex CLI
This server works with any MCP-compatible client. The sections below cover some of the most popular ones โ if your tool isn't listed, check its documentation for MCP configuration and use the same endpoint URL or command.
All examples below work with both the local installation and the hosted endpoint. Where both options differ, both are shown.
Using local installation? You need to install the server first โ see Run locally.
Requires a ChatGPT Plus, Team, or Enterprise plan.
https://ckan-mcp-server.andy-pr.workers.dev/mcpFor a step-by-step walkthrough with screenshots, see the full ChatGPT guide.
Using the hosted endpoint (no install) โ via connector UI:
https://ckan-mcp-server.andy-pr.workers.dev/mcpFor a detailed walkthrough with screenshots, see the full Claude guide.
Using the hosted endpoint (no install) โ via config file:
Configuration file location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonUsing local installation:
Using the hosted endpoint (no install):
Using local installation:
--scope usermakes the server available globally across all your projects, not just the current one.
To add it only for a specific project, run from the project folder without the --scope user flag:
https://ckan-mcp-server.andy-pr.workers.dev/mcpFor a step-by-step walkthrough with screenshots, see the full Le Chat guide.
Requires a Perplexity Pro account.
https://ckan-mcp-server.andy-pr.workers.dev/mcpFor a step-by-step walkthrough with screenshots, see the full Perplexity guide.
Or add manually to ~/.gemini/settings.json:
Add to your User Settings or .vscode/settings.json:
Using the hosted endpoint (no install):
Using local installation:
Add to ~/.codex/config.toml:
Using the hosted endpoint (no install):
Using local installation:
The quickest way. Install the package globally and it's immediately available as a command:
The server will be available as ckan-mcp-server, or you can run it without installing via:
For development or if you want to run the latest unreleased code:
Thanks to @piersoft, you can also run the server via Docker:
The MCP server will be available at http://localhost:3000/mcp. See docker/README.md for full details, including how to connect Claude Desktop to the container.
Direct data access via ckan:// URI scheme:
ckan://{server}/dataset/{id} - Dataset metadatackan://{server}/resource/{id} - Resource metadata and download URLckan://{server}/organization/{name} - Organization detailsckan://{server}/group/{name}/datasets - Datasets by group (theme)ckan://{server}/organization/{name}/datasets - Datasets by organizationckan://{server}/tag/{name}/datasets - Datasets by tagckan://{server}/format/{format}/datasets - Datasets by resource format (res_format + distribution_format)Examples:
Once connected, just ask in plain language. No query syntax needed:
"Search dati.gov.it for datasets about air quality in Milan, then summarize what each contains โ time coverage, license, and best download format."
The server finds 31 datasets, groups them by structural pattern, and returns a clear summary โ including series names, years covered, publisher, and format. No CKAN knowledge required.
The examples below show natural language requests alongside the actual tool call the LLM will generate internally and send to the CKAN portal. You never write these queries yourself โ they are shown here to illustrate how your question gets translated under the hood.
Note: when query_parser: "text" is used, Solr special characters in the query are escaped automatically.
What is DataStore? CKAN DataStore is an optional extension that imports tabular resources (CSV, Excel) into a queryable database. It allows filtering, sorting, and field selection directly on the data โ without downloading the file. Not all portals have it enabled, and not all datasets use it even when the portal supports it. Check
datastore_active: trueon a resource to confirm availability.
๐ A shout-out to Comune di Messina and all public administrations that enable the DataStore extension: by doing so, they make their data dramatically easier to query and explore โ including through AI tools like this one.
The MCP server provides the raw tools โ the skill teaches your AI assistant how to use them intelligently.
Out of the box, an AI assistant knows each tool individually. The skill adds higher-level reasoning: which portal to query for a given country, what to do when a portal is unreachable, how to fall back to the European open data portal, and how to construct queries that actually return results.
What the skill adds:
data.europa.eu with correct country filtersfq syntax, wildcard handlingdata.europa.eu) requires specific facets+facetOperator+facetGroupOperator parameters that are undocumented and easy to get wrong; the skill encodes this correctlyExamples of what the skill enables:
The skill folder lives at skills/ckan-mcp/ in this repository and is listed on skills.sh. Use the Skills CLI to install it:
Some examples of supported portals:
Datashades.info/portals maintains a live registry of ~950 CKAN portals from around the world, with metadata on version, plugins, dataset counts, and geographic coordinates. Thanks to Sara Petti for bringing it to our attention.
The ckan_find_portals tool queries this registry directly. You can filter by country, language, minimum dataset count, or DataStore availability:
The portal data is also available as a public JSON API โ no authentication required:
| Endpoint | Description |
|---|---|
GET https://datashades.info/api/portal/list | Full list of portals with CKAN version, plugins, dataset/resource/organization counts, and country coordinates |
GET https://datashades.info/api/portal/stats | Aggregate statistics across all monitored portals |
GET https://datashades.info/api/portal/historical/stats | Historical trend data for the monitored portals |
CKAN uses Apache Solr as its default search engine. Understanding Solr syntax unlocks the full power of dataset search โ from simple keywords to complex boolean expressions, fuzzy matching, proximity searches, and date math.
These real-world examples demonstrate powerful Solr query combinations tested on the Italian open data portal (dati.gov.it):
Find healthcare datasets (tolerating spelling errors) modified in the last 6 months, prioritizing title matches:
Techniques used:
sanitร ~2 - Fuzzy search with edit distance 2 (finds "sanita", "sanitรก", minor typos)^3 - Boosts title matches 3x higher in relevance scoringNOW-6MONTHS - Dynamic date math for rolling time windowsResults: 949 datasets including hospital units, healthcare organizations, medical services
Environmental datasets where "inquinamento" and "aria" (air pollution) appear close together, excluding water-related datasets:
Techniques used:
"inquinamento aria"~5 - Proximity search (words within 5 positions)~3 - Tighter proximity for title matchesNOT (title:acqua OR title:mare) - Exclude water/sea datasetsResults: 305 datasets
Regional datasets published in the last month that have at least one resource format declared:
Techniques used:
regione* - Wildcard matches all regional organizationsres_format:* - Field existence check (has at least one resource format declared)NOW-1MONTH - Rolling 30-day windowResults: 293 datasets
Datasets from the Italian Ministry of Labour modified during 2025, with facets by format and tags:
Techniques used:
[2025-01-01T00:00:00Z TO 2025-12-31T23:59:59Z] - Explicit date range (full year)organization:ministero-del-lavoro - Filter by specific organizationResults: 83 datasets
Boolean Operators: AND, OR, NOT, +required, -excluded
Wildcards: * (multiple chars), ? (single char) - Note: left truncation not supported
Fuzzy: ~N (edit distance), e.g., health~2
Proximity: "phrase"~N (words within N positions)
Boosting: ^N (relevance multiplier), e.g., title:water^2
Ranges:
[a TO b], e.g., num_resources:[5 TO 10]{a TO b}, e.g., num_resources:{0 TO 100}[2024-01-01T00:00:00Z TO *]Date Math: NOW, NOW-1YEAR, NOW-6MONTHS, NOW-7DAYS, NOW/DAY
Field Existence: field:* (field exists), NOT field:* (field missing)
CKAN portals can be source catalogs (data published directly by the organization) or harvesting aggregators (data collected from many other portals). This distinction matters a lot when filtering by date.
| Field | Meaning on source portal | Meaning on aggregator |
|---|---|---|
issued | When the publisher released the dataset | When the publisher released the dataset |
metadata_created | When the record was first created | When the record was first harvested |
metadata_modified | When the record was last updated | When the record was last re-harvested |
On an aggregator like dati.gov.it, metadata_modified is updated every time the portal re-harvests โ even if the dataset content hasn't changed. This makes it unsuitable for finding "recently updated content".
Example โ same dataset, three different timestamps on dati.gov.it (aggregator):
metadata_modifiedis February 2026 only because the portal re-harvested it then โ not because the data changed.
Which date fields are filterable on dati.gov.it?
All three fields are Solr-indexed and usable in queries:
| Field | Solr-indexed | What queries return |
|---|---|---|
issued | โ | Datasets by publisher release date โ most meaningful, but ~14% of datasets lack it |
metadata_created | โ | Datasets by first harvesting date on dati.gov.it |
metadata_modified | โ | Datasets by last re-harvesting date โ often noisy |
Query examples (dati.gov.it):
Note on
issuedcoverage: ~59,700 of 69,000+ datasets on dati.gov.it haveissuedpopulated. Queries onissuedare accurate but incomplete โ datasets without the field are silently excluded. Preferissuedfor content-date queries; usemetadata_createdonly as a fallback for "when did this appear on the portal".
Recommendation: use issued to find datasets by publication date. Use metadata_created to find datasets that appeared on the portal recently.
The MCP Inspector lets you browse tools, test calls interactively, and debug responses in a web UI:
Opens at http://localhost:5173.
The HTTP transport (TRANSPORT=http) is unauthenticated: any client that reaches
POST /mcp can drive requests through it. Since v0.4.109 it binds to 127.0.0.1
(loopback) by default and enforces DNS-rebinding protection, so it is not exposed on
the LAN and cross-origin browser requests are rejected. To prevent SSRF abuse (e.g. a
caller pointing server_url at internal hosts or cloud metadata), it also refuses to
start unless you set a domain allowlist:
| Variable | Effect |
|---|---|
CKAN_ALLOWED_DOMAINS | Comma-separated allowlist of hostnames the server may query (default-deny). Required to start the HTTP transport. Example: CKAN_ALLOWED_DOMAINS="www.dati.gov.it,dati.comune.messina.it" |
CKAN_HTTP_ALLOW_ALL=true | Explicit opt-out: start the HTTP transport without an allowlist (logs a security warning). Not recommended when network-exposed. |
CKAN_HTTP_HOST | Interface to bind (default 127.0.0.1). Set 0.0.0.0 to expose it, ideally behind an authenticating reverse proxy. |
CKAN_HTTP_ALLOWED_HOSTS | Extra Host header values accepted by the DNS-rebinding guard (comma-separated). Add your public hostname when binding beyond loopback. |
CKAN_HTTP_ALLOWED_ORIGINS | Allowed Origin header values for browser clients (comma-separated). |
The default stdio transport is unaffected โ it stays open so you can query any portal
locally. Regardless of allowlist, all requests are also validated against private/internal
IP ranges, including hostnames that resolve to internal addresses (DNS-based SSRF, fixed
in v0.4.108). The official Cloudflare Worker is sandboxed by the platform and does not
require this setting.
Some CKAN portals expose non-standard web URLs for viewing datasets or organizations. To support those cases, this project ships with src/portals.json, which maps known portal API URLs (and aliases) to custom view URL templates.
When generating a dataset or organization view link, the server:
server_url against api_url and api_url_aliases in src/portals.jsondataset_view_url / organization_view_url template when available{server_url}/dataset/{name} and {server_url}/organization/{name})Wrong URL for Italian portal โ use https://www.dati.gov.it/opendata (not https://dati.gov.it).
Connection error
Verify the URL is reachable and use ckan_status_show to confirm the portal is responding.
No results โ broaden your query or check what's available with facets:
LLM uses external data when no results are found โ when a tool returns no results, some LLMs (e.g. ChatGPT) may supplement the answer with information from their training data without warning. This is a known LLM behavior, not a server issue. To avoid it, instruct the model in your system prompt to only use data returned by the MCP tools and not rely on external sources.
For issues or questions, open an issue on GitHub.
This server collects no personal data. It is read-only and stateless โ queries are forwarded directly to the public CKAN API you specify, and no data is stored or logged.
See the full Privacy Policy.
Created with โค๏ธ by onData for the open data community
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ckan-mcp-server)<a href="https://allmcps.com/mcp/ckan-mcp-server"><img src="https://allmcps.com/api/badge/ckan-mcp-server?style=directory" alt="Ckan Mcp Server on AllMCPs" /></a>