
一个CKAN API的模型上下文协议(MCP)服务器,通过MCP相容客户端可以浏览和管理CKAN数据门户.
概览
一个CKAN API的模型上下文协议(MCP)服务器,通过MCP相容客户端可以浏览和管理CKAN数据门户. 这是一个MCP服务器,通过"模式上下文协议"提供访问CKAN(综合知识存档网络)API. 它可以和Claude Desktop,IDes等MCP相容客户端或其他AI应用程序一起用于与CKAN数据门户交互. - Python 3.13或更高 -- -- pip(Python包安装器) 设置以下环境变量: - CKAN URL:您的 CKAN 门户网站的基础 URL(例如 https://demo.ckan.org)] - CKAN API KEY:(可选)您的 CKAN API 键用于写入操作 您也可以将 .env.example 复制到.env 并设置您的配置在那里 。 MCP服务器提供以下工具: - ckan package list:列出所有软件包 - ckan package show:显示特定软件包的细节 - ckan package search:搜索软件包
概述(AI 翻译)
一个CKAN API的模型上下文协议(MCP)服务器,通过MCP相容客户端可以浏览和管理CKAN数据门户.
□ 这是什么?
这是一个MCP服务器,通过"模式上下文协议"提供访问CKAN(综合知识存档网络)API. 它可以和Claude Desktop,IDes等MCP相容客户端或其他AI应用程序一起用于与CKAN数据门户交互.
□ 要求
- Python 3.13或更高层
- 管道(Python包安装器)
□ 安装
- 安装 Python 依赖性 :
□ 配置
设置以下环境变量:
- [[T0]: 您 CKAN 门户网站的基础 URL (例如
https://demo.ckan.org) CKAN_API_KEY:(可选)用于写入操作的 CKAN API 密钥
示例
也可以将 [[T3] 复制到 [T4] 并在那里设置配置 。
□ 使用量
QQ 直接运行服务器
使用 Docker 键
使用 Docker 编曲
□ 工具
MCP服务器提供以下工具:
包/数据包
- [[T5]: 列出所有软件包
- [[T6]: 显示特定软件包的细节
- [[T7]: 搜索软件包
组织
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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.13 or higher
- pip (Python package installer)
Installation
- 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
Tools
The MCP server provides the following tools:
Packages/Datasets
ckan_package_list: List all packagesckan_package_show: Show details of a specific packageckan_package_search: Search for packages
Organizations
ckan_organization_list: List all organizationsckan_organization_show: Show organization details
DataStore
ckan_datastore_searchSearch DataStore Tables by Resource
Groups and Tags
ckan_group_list: List all groupsckan_tag_list: List all tags
Resources
ckan_resource_show: Show resource details
System
ckan_site_read: Site informationckan_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 documentationckan://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"
安装
docker run -e CKAN_URL="https://demo.ckan.org" -e CKAN_API_KEY="your-key" ckan-mcp-server配置
{
"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"
}
}
}
}