Bundle
xby-toronto-open-data-server
一个通过CKAN API直接访问多伦多开放数据的MCP服务器,支持智能数据集发现、灵活查询和CSV数据预览,专为LLM代理设计。
- Source
- xby-skill
- License
- MIT
- Updated
- Updated 2 days ago
Readme
# xby-toronto-open-data-server
DeepSeek Harness (DSH) 的插件:开放数据查询服务
一个通过CKAN API直接访问多伦多开放数据的MCP服务器,支持智能数据集发现、灵活查询和CSV数据预览,专为LLM代理设计。
## 功能
- **set_xby_apikey** — 在聊天中设置 API 密钥(自动持久化,重启有效)
- **toronto_start_here** — 🚀 START HERE! Essential first call for any Toronto data query. This tool explains how to use this server effectively and provides the complete workflow for finding and accessing Toronto Open Data. Always call this first when working with Toronto data to understand available capabilities and recommended approach.
- **toronto_popular_datasets** — ⭐ POPULAR TORONTO DATASETS: Quick access to the most commonly used Toronto Open Datasets. Shows dataset IDs and what they contain. Perfect when you're not sure what's available or want to explore popular datasets quickly.
- **toronto_smart_data_helper** — 🧠 SMART DATA HELPER - The easiest way to get Toronto data! Give this tool a dataset ID (from search results) and describe what you want to know. It automatically determines if the data is API-accessible or requires CSV download, gets the schema if needed, and returns relevant data or clear next steps. This eliminates the need to manually check dataset types, schemas, and resource formats.
- **toronto_list_datasets** — 📋 LIST ALL DATASETS: Shows all 500+ available Toronto Open Datasets with titles and descriptions. Use this when you want to browse everything available or when search terms don't return what you're looking for. Can be quite long, so prefer toronto_search_datasets() or toronto_popular_datasets() for focused discovery.
- **toronto_search_datasets** — 🔍 FIND TORONTO DATA: Search 500+ Toronto Open Datasets by keywords (e.g., 'traffic', 'parks', 'budget', 'health'). Returns dataset IDs and descriptions. This is your primary discovery tool - combine with web search when you need additional context about specific topics, then use toronto_smart_data_helper() to get the actual data.
- **toronto_get_dataset_schema** — 📋 GET DATA STRUCTURE: Shows the schema (column names, field IDs, and types) for a Toronto dataset if it has an active datastore. Essential for understanding what fields are available before filtering with toronto_query_dataset_data(). For CSV files, suggests checking the header row manually.
- **toronto_query_dataset_data** — 🔧 ADVANCED QUERYING: Query Toronto datasets with precise filtering, sorting, and field selection.
💡 TIP: Use toronto_smart_data_helper() first - it's easier and handles most use cases automatically!
This tool is for when you need advanced filtering:
📋 REQUIRED: Get field names first with toronto_get_dataset_schema(dataset_id)
🔍 FILTERS: Use exact field names like {"establishment_status": "Pass", "inspection_date": "2024-01-01"}
📊 SORT: Use field names like "inspection_date desc" or "score asc"
📝 FIELDS: Specify which columns to return like ["name", "address", "score"]
⚠️ For CSV files, this returns download links instead of query results.
🚀 Alternative: Try toronto_smart_data_helper() for a simpler, guided approach.
- **toronto_get_dataset_stats** — 📈 DATASET STATISTICS: Get basic statistics for a Toronto dataset including record counts, field information, and resource overview. Useful for understanding the scale and structure of a dataset before diving into the data.
- **toronto_fetch_csv_data** — 📄 FETCH CSV DATA: Downloads and returns sample content from a CSV file URL. Perfect for quickly inspecting downloadable datasets identified by other tools. Shows headers and sample rows to understand the data structure.
## 安装
### 方式一:从 GitHub 直接安装(推荐)
```bash
# 格式: dsh plugin --profile <profile> add github:<owner>/<repo>
dsh plugin --profile web add github:xby_skill/xby-toronto-open-data-server
```
### 方式二:从本地目录安装(开发模式)
```bash
# 仅用于本地开发调试
dsh plugin --profile web add /absolute/path/to/xby-toronto-open-data-server
```
### 方式三:通过 cordis.patch.yml 开发调试
```bash
dsh web --profile web --patch /absolute/path/to/dsh-ocr-plugin/cordis.patch.yml
```
## 配置
### 获取 API 密钥
前往 [小笨羊官网](https://xiaobenyang.com) 注册并获取 API 密钥。
Install
dsh plugin --profile web add github:xby-skill/xby-toronto-open-data-server#2b0455ed25606162ff687ff99960a458d4191f1b
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install xby-toronto-open-data-server from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.