
Ckan Mcp Server
io.github.aborrusoPublished by GitHub account aborrusov0.4.137Updated Nov 7, 2026
MCP server for interacting with CKAN open data portals
Overview
Lets an assistant search, explore and query CKAN open data portals in natural language — datasets, organizations, groups, tags and tabular data.
- What you can do
- Search and inspect datasets: Solr-style package search, relevance ranking, full dataset details, tag lists
- Browse organizations and groups: list, show and search by name
- Query tabular data: DataStore record filtering and SQL queries on DataStore resources
- Analyze catalogs: portal statistics, dataset and schema inspection, MQA quality scores for dati.gov.it
- Discover portals worldwide and run SPARQL SELECT queries against public endpoints
- Read metadata directly through ckan:// resource templates for datasets, resources, organizations, groups, tags and formats
- When to use it
- Useful when you need public open data for research, journalism, policy checks or data pipelines and want the assistant to find and summarize datasets without learning CKAN APIs or Solr syntax. Also handy for comparing what administrations publish or for querying tabular resources without downloading files.
- Requirements
- Runs locally via npx or a global npm install (Node.js), or as a Docker container; a hosted HTTP endpoint is also offered. No account or API key. The HTTP transport requires the CKAN_ALLOWED_DOMAINS allowlist to start, and network access to the target portals.
Installation
In SourceWeft
- Open Ckan Mcp Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
[npm version] [GitHub] [Ask DeepWiki] [License: MIT] [Newsletter] [Greptile: The War on Bugs]
CKAN MCP Server
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:
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.
⚖️ Limits
The local and hosted server use the same tool and output caps. The hosted endpoint also has the shared request quota shown above.
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.
🔌 Use it in your favorite tool
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.
ChatGPT
Requires a ChatGPT Plus, Team, or Enterprise plan.
- Open the profile menu and go to Settings → Apps → Advanced settings
- Enable Developer mode
- Click Create app (top-right)
- Fill in the form:
- Name: CKAN MCP Server
- Description: Search datasets on CKAN open data portals
- MCP Server URL:
https://ckan-mcp-server.andy-pr.workers.dev/mcp - Authentication: No Auth
- Check the confirmation box, then click Create
- In a new chat, click + → More and select CKAN MCP Server
For a step-by-step walkthrough with screenshots, see the full ChatGPT guide.
Claude Desktop
Using the hosted endpoint (no install) — via connector UI:
- Open Claude Desktop and go to Settings → Integrations
- Click Add custom integration
- Fill in the details:
- Name: CKAN MCP Server
- MCP Server URL:
https://ckan-mcp-server.andy-pr.workers.dev/mcp
- Click Add to save
- Open a new chat, click +, select Integrations, and enable CKAN MCP Server
- When Claude asks to use a tool, click Allow (or Always allow)
For a detailed walkthrough with screenshots, see the full Claude guide.
Using the hosted endpoint (no install) — via config file:
Configuration file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Using local installation:
Claude Code
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:
Le Chat (Mistral)
- In the left sidebar, click Intelligence, then select Connectors
- Click + Add Connector
- Select the Custom MCP Connector tab and fill in the details:
- Name: CKAN
- Connector Server:
https://ckan-mcp-server.andy-pr.workers.dev/mcp
- Click Connect to save
- Open a new chat, click +, then Connectors, and enable CKAN
For a step-by-step walkthrough with screenshots, see the full Le Chat guide.
Perplexity Pro
Requires a Perplexity Pro account.
- Click the "+" (Attach) icon in the message input bar and select Connectors & sources
- Click Connect external app
- Fill in the details:
- Name: CKAN MCP Server
- MCP Server URL:
https://ckan-mcp-server.andy-pr.workers.dev/mcp - Authorization Type: No Authentication
- Connection Type: HTTP Streamable
- Check the confirmation box and click Save
- In a new chat, click + → Connectors & sources and enable ckan_mcp_server
For a step-by-step walkthrough with screenshots, see the full Perplexity guide.
Gemini CLI
Or add manually to ~/.gemini/settings.json:
VS Code
Add to your User Settings or .vscode/settings.json:
Using the hosted endpoint (no install):
Using local installation:
Codex CLI
Add to ~/.codex/config.toml:
Using the hosted endpoint (no install):
Using local installation:
🖥️ Run locally
Option 1 — Install via npm
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:
Option 2 — Clone and build
For development or if you want to run the latest unreleased code:
Option 3 — Docker
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.
🛠️ Available Tools
Search and Discovery
- ckan_package_search: Search datasets with Solr queries
- ckan_find_relevant_datasets: Rank datasets by relevance score
- ckan_package_show: Complete details of a dataset. On portals that use ckanext-scheming the schema's other root fields are added as
fields, each with its label and the value as stored - ckan_tag_list: List tags with counts
Organizations
- ckan_organization_list: List all organizations
- ckan_organization_show: Details of an organization
- ckan_organization_search: Search organizations by name
Groups
- ckan_group_list: List groups
- ckan_group_show: Show group details
- ckan_group_search: Search groups by name
DataStore
- ckan_datastore_search: Query tabular data
- ckan_datastore_search_sql: SQL queries on DataStore
Quality Metrics
- ckan_get_mqa_quality: Get the MQA quality score (methodology v2, 0-7.5 scale with band) for dati.gov.it datasets, with the failing metrics that would raise it most
- ckan_get_mqa_quality_details: List every failing MQA metric for dati.gov.it datasets, grouped by FAIR dimension, with DCAT-AP property, weight and gain
Portal Discovery
- ckan_find_portals: Discover CKAN portals worldwide by country, language, or topic (uses datashades.info live registry of ~950 portals)
Catalog Analysis
- ckan_analyze_datasets: Search datasets and inspect DataStore schemas of queryable resources
- ckan_catalog_stats: Statistical overview of a portal (totals, breakdown by category, format, organization)
SPARQL
- sparql_query: Execute SPARQL SELECT queries against any public SPARQL endpoint
Utilities
- ckan_status_show: Verify server status
📎 MCP Resource Templates
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:
💡 Usage Examples
A natural language conversation
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.
Search datasets (natural language: "search for population datasets")
Force text-field parser for long OR queries (natural language: "find hotel or accommodation datasets")
Note: when query_parser: "text" is used, Solr special characters in the query are escaped automatically.
Rank datasets by relevance (natural language: "find most relevant datasets about urban mobility")
Filter by organization (natural language: "show recent datasets from Tuscany Region")
Get statistics with faceting (natural language: "show statistics by organization, tags and format")
List tags (natural language: "show top tags about health")
Search groups (natural language: "find groups about environment")
DataStore Query (natural language: "query tabular data filtering by region and year")
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.
DataStore SQL Query (natural language: "count road orders by type")
🧠 AI Skill for smarter multi-step queries
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:
- Country routing — automatically identifies the most authoritative CKAN portal for a country (national > regional > local)
- Fallback chain — if a portal is unreachable or returns 0 results, tries alternatives and, for European countries, falls back to
data.europa.euwith correct country filters - Query construction — bilingual queries, parser selection,
fqsyntax, wildcard handling - Correct API patterns — the European portal (
data.europa.eu) requires specificfacets+facetOperator+facetGroupOperatorparameters that are undocumented and easy to get wrong; the skill encodes this correctly
Examples of what the skill enables:
Install the skill
The skill folder lives at skills/ckan-mcp/ in this repository and is listed on skills.sh. Use the Skills CLI to install it:
🌍 Supported CKAN Portals
Some examples of supported portals:
- 🇮🇹 https://www.dati.gov.it/opendata - Italian National Open Data Portal (CKAN 2.10.3)
- 🇨🇦 https://open.canada.ca/data - Canada Open Government (CKAN 2.10.8)
- 🇦🇺 https://data.gov.au - Australian Government Open Data (CKAN 2.11.4)
- 🇬🇧 https://data.gov.uk - United Kingdom Open Data
- And many more portals worldwide
catalog.data.gov is no longer CKAN. Data.gov replaced its catalog in 2025 with a different API (details); a call to it now explains this instead of failing with a bare 404.
Discover CKAN portals worldwide
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:
🔍 Advanced Solr Queries
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.
Basic syntax
Advanced Query Examples
These real-world examples demonstrate powerful Solr query combinations tested on the Italian open data portal (dati.gov.it):
1. Fuzzy Search + Date Math + Boosting (natural language: "find healthcare datasets modified in last 6 months")
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 windows- Combined boolean logic with multiple field searches
Results: 949 datasets including hospital units, healthcare organizations, medical services
2. Proximity Search + Complex Boolean (natural language: "find air pollution datasets excluding water")
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 datasets- Faceting for statistical breakdown
Results: 305 datasets
3. Wildcard + Field Existence + Date Math (natural language: "regional datasets with any format from last month")
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 window
Results: 293 datasets
4. Explicit Date Range + Facets (natural language: "Ministry of Labour datasets updated in 2025")
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 organization- Multiple facets for format and topic breakdown
Results: 83 datasets
Solr Query Syntax Reference
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:
- Inclusive:
[a TO b], e.g.,num_resources:[5 TO 10] - Exclusive:
{a TO b}, e.g.,num_resources:{0 TO 100} - Open-ended:
[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)
📅 Understanding date fields
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.
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:
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.
👩💻 Developer Reference
Project Structure
Build & Test
Explore with MCP Inspector
The MCP Inspector lets you browse tools, test calls interactively, and debug responses in a web UI:
Opens at http://localhost:5173.
Security: HTTP transport requires a domain allowlist
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:
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.
Manual HTTP Testing
Portal View URL Templates
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:
- matches the
server_urlagainstapi_urlandapi_url_aliasesinsrc/portals.json - uses the portal-specific
dataset_view_url/organization_view_urltemplate when available - falls back to the generic defaults (
{server_url}/dataset/{name}and{server_url}/organization/{name})
Troubleshooting
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.
🆘 Support
For issues or questions, open an issue on GitHub.
Privacy Policy
A local installation (npm, Claude Desktop extension, stdio or your own HTTP server) sends nothing to us: queries go straight to the CKAN portal you specify, and the only log is an audit line on your machine's standard error. The public demo instance on Cloudflare Workers logs the arguments of each tool call (tool, portal, search text and parameters, datasets returned, outcome), never IP addresses, headers or conversation content; an archive of those fields is published as open data in data/, so do not put personal information in queries sent to it.
See the full Privacy Policy.
Related tools
- opensituas — Codes and history of every Italian territorial unit, from the CLI. The join key for any ISTAT dataset.
- opensdmx — Official statistics from Eurostat, ISTAT, OECD, and other SDMX providers — no hallucinations, only published figures.
- ISTAT MCP Server — Italian statistical data directly in your AI assistant, via the MCP protocol.
🔗 Useful Links
- CKAN — the open-source platform behind most public open data portals
- CKAN API Documentation — full reference for the CKAN API v3
- DCAT Vocabulary (W3C) — the metadata standard used by CKAN portals to describe datasets
- MCP Protocol — Model Context Protocol specification
Created with ❤️ by onData for the open data community
Source: README.md at commit bd1d5a1
Tools
0Version history
10- v0.4.137LatestNov 7, 2026
- v0.4.135Nov 4, 2026
- v0.4.134Oct 29, 2026
- v0.4.131Oct 22, 2026
- v0.4.130Oct 19, 2026
- v0.4.129Oct 6, 2026
- v0.4.128Sep 28, 2026
- v0.4.127Sep 25, 2026
- v0.4.126Sep 23, 2026
- v0.4.124Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts