# ckan-mcp-server

Connects your AI assistant to CKAN open data portals: search datasets, browse organizations, query tabular data and read metadata in plain language.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 59
- Author: ondata
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ondata/ckan-mcp-server
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/ckan-mcp-server

## What it does

CKAN powers most public open data portals, and finding anything there usually means knowing the portal's structure, API and search syntax. This server removes that step. Once connected, your assistant handles the searching and the parsing.

The server ships tools for dataset search (`ckan_package_search`), tabular queries (`ckan_datastore_search`), tag listing, portal discovery and relevant-dataset matching. Metadata follows the DCAT standard. Two ways to run it: install locally with `npm install -g @aborruso/ckan-mcp-server`, or skip the install and point your tool at the hosted endpoint `https://ckan-mcp-server.andy-pr.workers.dev/mcp`. The hosted option shares a 100k requests/day quota; the local one has no shared quota.

Output caps apply on both channels. A response tops out at 50,000 characters, `ckan_datastore_search` returns 100 rows by default and 32,000 at most. Truncated JSON stays parseable: the server trims known result arrays and flags the payload with `_truncated` and `_original_count`, so a client reading `structuredContent` sees the same thing as the text. Need the full set? Paginate or narrow the query. Local Node.js deployments can raise the body limits with `CKAN_MAX_RESPONSE_BYTES` and `CKAN_MAX_DECOMPRESSED_BYTES`. The `CKAN_ALLOWED_DOMAINS` variable controls which portals the server may reach.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `CKAN_ALLOWED_DOMAINS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env CKAN_ALLOWED_DOMAINS=<CKAN_ALLOWED_DOMAINS> --transport stdio ckan-mcp-server -- npx -y @aborruso/ckan-mcp-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add ckan-mcp-server --env CKAN_ALLOWED_DOMAINS=<CKAN_ALLOWED_DOMAINS> -- npx -y @aborruso/ckan-mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ckan-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@aborruso/ckan-mcp-server"
            ],
            "env": {
                "CKAN_ALLOWED_DOMAINS": "<CKAN_ALLOWED_DOMAINS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ckan-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@aborruso/ckan-mcp-server"
            ],
            "env": {
                "CKAN_ALLOWED_DOMAINS": "<CKAN_ALLOWED_DOMAINS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e CKAN_ALLOWED_DOMAINS=<CKAN_ALLOWED_DOMAINS> ckan-mcp-server npx -y @aborruso/ckan-mcp-server
```
Replace <…> with your own values

## When to use it
- find a dataset on a CKAN portal without learning its API
- run a tabular query against datastore records
- list the organizations and tags a portal exposes
- check what datasets a public body publishes
- match relevant datasets to a research topic

## Example prompts
- Search this portal for air quality datasets from last year
- List the organizations publishing datasets here
- Query `ckan_datastore_search` and show me the first rows

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
