by mcp-open-data-hk
Access Hong Kong government datasets with DATA.GOV.HK for easy search, filtering, and metadata tools. Ideal for research
Provides access to Hong Kong government's official open data portal, allowing you to search, browse, and retrieve metadata for thousands of public datasets from DATA.GOV.HK.
DATA.GOV.HK is a community-built MCP server published by mcp-open-data-hk that provides AI assistants with tools and capabilities via the Model Context Protocol. Access Hong Kong government datasets with DATA.GOV.HK for easy search, filtering, and metadata tools. Ideal for research It is categorized under analytics data. This server exposes 8 tools that AI clients can invoke during conversations and coding sessions.
You can install DATA.GOV.HK in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
DATA.GOV.HK is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Share your MCP server with the developer community
We wired DATA.GOV.HK into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
According to our notes, DATA.GOV.HK benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
DATA.GOV.HK reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Strong directory entry: DATA.GOV.HK surfaces stars and publisher context so we could sanity-check maintenance before adopting.
We evaluated DATA.GOV.HK against two servers with overlapping tools; this profile had the clearer scope statement.
DATA.GOV.HK is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
DATA.GOV.HK has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
Strong directory entry: DATA.GOV.HK surfaces stars and publisher context so we could sanity-check maintenance before adopting.
I recommend DATA.GOV.HK for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
Useful MCP listing: DATA.GOV.HK is the kind of server we cite when onboarding engineers to host + tool permissions.
showing 1-10 of 75
This is an MCP (Model Context Protocol) server that provides access to data from DATA.GOV.HK, the official open data portal of the Hong Kong government.
To install mcp-open-data-hk for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mcp-open-data-hk/mcp-open-data-hk --client claude
When using uv no specific installation is needed. We will
use uvx to directly run mcp-server-fetch.
Alternatively you can install mcp-server-fetch via pip:
pip install mcp-open-data-hk
After installation, you can run it as a script using:
python -m mcp_open_data_hk
After installation, configure your MCP-compatible client (like Cursor, Claude Code, or Claude Desktop) by adding the following to your settings.json:
<details> <summary>Using uvx</summary>{
"mcpServers": {
"mcp-open-data-hk": {
"command": "uvx",
"args": ["mcp-open-data-hk"]
}
}
}
</details>
<details>
<summary>Using pip installation</summary>
{
"mcpServers": {
"mcp-open-data-hk": {
"command": "python",
"args": ["-m", "mcp_open_data_hk"]
}
}
}
</details>
The server provides the following tools to interact with the DATA.GOV.HK API:
list_datasets - Get a list of dataset IDsget_dataset_details - Get detailed information about a specific datasetlist_categories - Get a list of data categoriesget_category_details - Get detailed information about a specific categorysearch_datasets - Search for datasets by query term with advanced optionssearch_datasets_with_facets - Search datasets and return faceted resultsget_datasets_by_format - Get datasets by file formatget_supported_formats - Get list of supported file formatsGet a list of dataset IDs from DATA.GOV.HK
Parameters:
limit (optional): Maximum number of datasets to return (default: 1000)offset (optional): Offset of the first dataset to returnlanguage (optional): Language code (en, tc, sc) - defaults to "en"Get detailed information about a specific dataset
Parameters:
dataset_id: The ID or name of the dataset to retrievelanguage (optional): Language code (en, tc, sc) - defaults to "en"include_tracking (optional): Add tracking information to dataset and resources - defaults to FalseGet a list of data categories (groups)
Parameters:
order_by (optional): Field to sort by ('name' or 'packages') - deprecated, use sort insteadsort (optional): Sorting of results ('name asc', 'package_count desc', etc.) - defaults to "title asc"limit (optional): Maximum number of categories to returnoffset (optional): Offset for paginationall_fields (optional): Return full group dictionaries instead of just names - defaults to Falselanguage (optional): Language code (en, tc, sc) - defaults to "en"Get detailed information about a specific category (group)
Parameters:
category_id: The ID or name of the category to retrieveinclude_datasets (optional): Include a truncated list of the category's datasets - defaults to Falseinclude_dataset_count (optional): Include the full package count - defaults to Trueinclude_extras (optional): Include the category's extra fields - defaults to Trueinclude_users (optional): Include the category's users - defaults to Trueinclude_groups (optional): Include the category's sub groups - defaults to Trueinclude_tags (optional): Include the category's tags - defaults to Trueinclude_followers (optional): Include the category's number of followers - defaults to Truelanguage (optional): Language code (en, tc, sc) - defaults to "en"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. It supports advanced Solr search parameters.
Parameters:
query (optional): The solr query string (e.g., "transport", "weather", ":" for all) - defaults to ":"limit (optional): Maximum number of datasets to return (default: 10, max: 1000)offset (optional): Offset for pagination - defaults to 0language (optional): Language code (en, tc, sc) - defaults to "en"Returns: A dictionary containing:
count: Total number of matching datasetsresults: List of matching datasets (up to limit)search_facets: Faceted information about the resultshas_more: Boolean indicating if there are more results availableSearch for datasets and return faceted results for better data exploration.
This function is useful for exploring what types of data are available by showing counts of datasets grouped by tags, organizations, or other facets.
Parameters:
query (optional): The solr query string - defaults to ":"language (optional): Language code (en, tc, sc) - defaults to "en"Returns: A dictionary containing:
count: Total number of matching datasetssearch_facets: Faceted information about the resultssample_results: First 3 matching datasetsGet datasets that have resources in a specific file format.
Parameters:
file_format: The file format to filter by (e.g., "CSV", "JSON", "GeoJSON")limit (optional): Maximum number of datasets to return - defaults to 10language (optional): Language code (en, tc, sc) - defaults to "en"Returns: A dictionary containing:
count: Total number of matching datasetsresults: List of matching datasetsGet a list of file formats supported by DATA.GOV.HK
Returns: A list of supported file formats
python tests/test_client.py
python tests/debug_search.py
python tests/comprehensive_test.py
python -m src.mcp_open_data_hk
pytest tests/
When installed as a package, the server can be referenced by its module name rather than file path. This is more convenient for users as they don't need to specify full file paths.
{
"mcpServers": {
"mcp-open-data-hk": {
"command": "python",
"args": ["-m", "mcp_open_data_hk"]
}
}
}
{
"mcpServers": {
"mcp-open-data-hk": {
"command": "python",
"args": ["-m", "src.mcp_open_data_hk"],
"cwd": "/full/path/to/mcp-open-data-hk"
}
}
}
The package installation approach is recommended for end users, while the file path approach is useful for local development and testing.
Once installed, try these queries with your AI assistant:
The AI will automatically use the appropriate tools from your MCP server to fetch the requested information.
Module not found errors: Make sure you've installed the dependencies with pip install -e . for local development, or pip install mcp-open-data-hk for the published package.
Path issues: Ensure the cwd in your IDE configuration is the correct absolute path to the project root.
Permission errors: On Unix systems, make sure the scripts have execute permissions:
chmod +x src/mcp_open_data_hk/__main__.py
FastMCP not found: Install it with:
pip install fastmcp
If you're having issues, you can test the connection manually:
Run the server in one terminal:
python -m src.mcp_open_data_hk
In another terminal, run the test client:
python tests/test_client.py
If this works, the issue is likely in the IDE configuration.
You can extend the server by adding more tools in src/mcp_open_data_hk/server.py. Follow the existing patterns:
@mcp.toolThe server automatically exposes all functions decorated with @mcp.tool to MCP clients.
This project includes GitHub Actions workflows for CI/CD:
This project uses PyPI's Trusted Publishing which is more secure than using API t
Prerequisites
Time Estimate
15-60 minutes depending on server complexity
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
Compatibility
✓ Use when
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid when
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.