Skip to content
dsh.fish
Bundle

xby-open-data-hk

一个提供香港政府官方开放数据门户DATA.GOV.HK数据访问的MCP服务器,支持数据集列表、详情查询、分类检索及格式筛选等功能。

Source
xby-skill
License
MIT
Updated
Updated 2 days ago

Readme

# xby-open-data-hk

DeepSeek Harness (DSH) 的插件:香港开放数据访问服务

一个提供香港政府官方开放数据门户DATA.GOV.HK数据访问的MCP服务器,支持数据集列表、详情查询、分类检索及格式筛选等功能。

## 功能

- **set_xby_apikey** — 在聊天中设置 API 密钥(自动持久化,重启有效)
- **list_datasets** — Get a list of dataset IDs from data.gov.hk

Args:
    limit: Maximum number of datasets to return (default: 1000)
    offset: Offset of the first dataset to return
    language: Language code (en, tc, sc)
- **get_dataset_details** — Get detailed information about a specific dataset

Args:
    dataset_id: The ID or name of the dataset to retrieve
    language: Language code (en, tc, sc)
    include_tracking: Add tracking information to dataset and resources
- **list_categories** — Get a list of data categories (groups)

Args:
    order_by: Field to sort by ('name' or 'packages') - deprecated, use sort instead
    sort: Sorting of results ('name asc', 'package_count desc', etc.)
    limit: Maximum number of categories to return
    offset: Offset for pagination
    all_fields: Return full group dictionaries instead of just names
    language: Language code (en, tc, sc)
- **get_category_details** — Get detailed information about a specific category (group)

Args:
    category_id: The ID or name of the category to retrieve
    include_datasets: Include a truncated list of the category's datasets
    include_dataset_count: Include the full package count
    include_extras: Include the category's extra fields
    include_users: Include the category's users
    include_groups: Include the category's sub groups
    include_tags: Include the category's tags
    include_followers: Include the category's number of followers
    language: Language code (en, tc, sc)
- **search_datasets** — Search for datasets by query term using the package_search API.

This function searches across dataset titles, descriptions, and other metadata
to find datasets matching the query term.

Args:
    query: The solr query string (e.g., "transport", "weather", "*:*" for all)
    limit: Maximum number of datasets to return (default: 10, max: 1000)
    offset: Offset for pagination
    language: Language code (en, tc, sc)

Returns:
    A dictionary containing:
    - count: Total number of matching datasets
    - results: List of matching datasets (up to limit)
    - has_more: Boolean indicating if there are more results available
- **get_supported_formats** — Get a list of file formats supported by data.gov.hk

Returns:
    A list of supported file formats
- **search_datasets_with_facets** — Search for datasets and return faceted results for better data exploration.

Args:
    query: The solr query string
    language: Language code (en, tc, sc)

Returns:
    A dictionary containing:
    - count: Total number of matching datasets
    - search_facets: Faceted information about the results
    - sample_results: First 3 matching datasets
- **get_datasets_by_format** — Get datasets that have resources in a specific file format.

Args:
    file_format: The file format to filter by (e.g., "CSV", "JSON", "GeoJSON")
    limit: Maximum number of datasets to return
    language: Language code (en, tc, sc)

Returns:
    A dictionary containing:
    - count: Total number of matching datasets
    - results: List of matching datasets

## 安装

### 方式一:从 GitHub 直接安装(推荐)

```bash
# 格式: dsh plugin --profile <profile> add github:<owner>/<repo>
dsh plugin --profile web add github:xby_skill/xby-open-data-hk
```

### 方式二:从本地目录安装(开发模式)

```bash
# 仅用于本地开发调试
dsh plugin --profile web add /absolute/path/to/xby-open-data-hk
```

### 方式三:通过 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-open-data-hk

Profile: web

  • 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.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source