Skip to main content

CKAN MCP Server

A Model Context Protocol (MCP) server for the CKAN API that enables browsing and managing CKAN data portals through MCP-compatible clients.

What is this?

This is an MCP server that provides access to CKAN (Comprehensive Knowledge Archive Network) APIs through the Model Context Protocol. It can be used with MCP-compatible clients like Claude Desktop, IDEs, or other AI applications to interact with CKAN data portals.

Requirements

  • Python 3.8 or higher
  • pip (Python package installer)

Installation

  1. Install Python dependencies:
pip install -r requirements.txt

Configuration

Set the following environment variables:

  • CKAN_URL: The base URL of your CKAN portal (e.g. https://demo.ckan.org)
  • CKAN_API_KEY: (Optional) Your CKAN API key for write operations

Example:

export CKAN_URL="https://demo.ckan.org"
export CKAN_API_KEY="your-api-key-here"

You can also copy .env.example to .env and set your configuration there.

Usage

Running the server directly

python mcp_ckan_server.py

Using Docker

# Build the image
docker build -t ckan-mcp-server .

# Run with environment variables
docker run -e CKAN_URL="https://demo.ckan.org" -e CKAN_API_KEY="your-key" ckan-mcp-server

Using Docker Compose

# Copy environment file and configure
cp .env.example .env
# Edit .env with your settings

# Run the server
docker-compose up

Available Tools

The MCP server provides the following tools:

Packages/Datasets

  • ckan_package_list: List all packages
  • ckan_package_show: Show details of a specific package
  • ckan_package_search: Search for packages

Organizations

  • ckan_organization_list: List all organizations
  • ckan_organization_show: Show organization details

Groups and Tags

  • ckan_group_list: List all groups
  • ckan_tag_list: List all tags

Resources

  • ckan_resource_show: Show resource details

System

  • ckan_site_read: Site information
  • ckan_status_show: Status and version information

Examples

Search packages

{
  "tool": "ckan_package_search",
  "arguments": {
    "q": "climate data",
    "rows": 5,
    "sort": "score desc"
  }
}

Show organization

{
  "tool": "ckan_organization_show",
  "arguments": {
    "id": "sample-organization",
    "include_datasets": true
  }
}

List all tags

{
  "tool": "ckan_tag_list",
  "arguments": {}
}

Resources

The server also provides the following resources:

  • ckan://api/docs: API documentation
  • ckan://config: Server configuration

Using with MCP Clients

Claude Desktop

Add this to your Claude Desktop configuration file:

{
  "mcpServers": {
    "ckan": {
      "command": "python",
      "args": ["/path/to/mcp_ckan_server.py"],
      "env": {
        "CKAN_URL": "https://demo.ckan.org",
        "CKAN_API_KEY": "your-api-key-here"
      }
    }
  }
}

Other MCP Clients

The server communicates via stdio, so any MCP-compatible client can connect to it by running the Python script and communicating through standard input/output.

CKAN API Reference

This MCP server implements the main endpoints of the CKAN API v3. Complete documentation: https://docs.ckan.org/en/latest/api/

License

Mozilla Public License Version 2.0

Author

(C) 2025, Ondics GmbH, https://ondics.de

Metadata

Release files for ckan-mcp-server 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ckan-mcp-server 0.0.1
File Size Uploaded Provenance
ckan_mcp_server-0.0.1.tar.gz 10.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ckan-mcp-server 0.0.1
File Interpreter ABI Platform
ckan_mcp_server-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / ckan_mcp_server-0.0.1.tar.gz

Download URL ckan_mcp_server-0.0.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
64919935978c644a4d0650a1598ef4b1d13a07a1fb311787ac00dbf6ffdf6b07
BLAKE2b-256 checksum
How to use checksums
aa6aa6c653555a9325321edd56e80dbb8c196f9599922c0891e7c0a3bb0e91a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.8

Release files / ckan_mcp_server-0.0.1-py3-none-any.whl

Download URL ckan_mcp_server-0.0.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
981e93c9c0d6a196cce0c998e64435eb7bcf9e6968ebbd36b7d294ae54e2a878
BLAKE2b-256 checksum
How to use checksums
e7748c4da04e5d8e79419d5dfecb9d2cb26e8bc395ef54f311b4ebeb8a9b9536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.8

Security for ckan-mcp-server 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page