
chester-2026/gov-stat-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
A Centralized MCP Server for Fetching Data from Many Countries' Govs
概要
A Model Context Protocol (MCP) server that lets AI agents . One unified tool interface across the United States, United Kingdom, Canada, and Australia — with per-portal quirks (API migrations, auth walls, bilingual metadata, stale DataStore flags) absorbed behind a common adapter layer. Built for the typical agent workflow: "Is there a government dataset for X?" → find candidates → inspect the files → preview rows or grab a download link and move on. - US (data.gov v4 / DCAT), UK (data.gov.uk / CKAN), Canada (open.canada.ca / CKAN), Australia (data.gov.au / CKAN + DataStore). - Descriptions are HTML-stripped and truncated, search results are compact summaries, and large files are never inlined by accident. - Uses CKAN DataStore where available (Australia), and transparently falls back to reading the head of CSV/TSV files everywhere else. - Errors are returned as actionable text ("use get_download_link instead", "retry with dataset_id", "available portals: …") — never raw tracebacks.
README
以下は原文 README の抜粋です。原文を見る。
GovData MCP
A Model Context Protocol (MCP) server that lets AI agents search, explore, and fetch open datasets from official government data portals. One unified tool interface across the United States, United Kingdom, Canada, and Australia — with per-portal quirks (API migrations, auth walls, bilingual metadata, stale DataStore flags) absorbed behind a common adapter layer.
Built for the typical agent workflow: “Is there a government dataset for X?” → find candidates → inspect the files → preview rows or grab a download link and move on.
Key Features
- Four national portals, one interface. US (data.gov v4 / DCAT), UK (data.gov.uk / CKAN), Canada (open.canada.ca / CKAN), Australia (data.gov.au / CKAN + DataStore).
- Token-frugal by design. Descriptions are HTML-stripped and truncated, search results are compact summaries, and large files are never inlined by accident.
- Row-level preview. Uses CKAN DataStore where available (Australia), and transparently falls back to reading the head of CSV/TSV files everywhere else.
- Agent-friendly failure modes. Errors are returned as actionable text (“use
get_download_linkinstead”, “retry withdataset_id”, “available portals: …”) — never raw tracebacks. - Extensible registry. Adding another CKAN-based portal is a single config entry; non-CKAN portals plug in via a small adapter class.
- Dual transport.
stdiofor local clients (Claude Desktop etc.), statelessstreamable-httpfor serverless deployment (Google Cloud Run).
Supported Portals
| Code | Portal | API | Search | Explore | Row Preview | Notes |
|---|---|---|---|---|---|---|
us |
data.gov | data.gov v4 (DCAT) | ✅ | ✅ | CSV fallback | Requires free api.data.gov key |
uk |
data.gov.uk | CKAN | ✅ | ✅ | CSV fallback | Resource lookups need the parent dataset_id |
ca |
open.canada.ca | CKAN | ✅ | ✅ | CSV fallback | Bilingual titles normalized to English |
au |
data.gov.au | CKAN + DataStore | ✅ | ✅ | ✅ DataStore | Full row queries with text filtering |
Requirements
- Python 3.11+
- An api.data.gov API key for the US portal (free; other portals need no credentials)
Installation
git clone https://github.com/YOUR_ORG/Gov-Stat-MCP-Server.git
cd Gov-Stat-MCP-Server
# pip
pip install -e ".[dev]"
# or conda
conda env create -f environment.yml
conda activate opendata-mcp
Copy .env.example to .env and set your key:
DATAGOV_API_KEY=your-api-data-gov-key
Getting Started
Standard config for most MCP clients (stdio transport):
{
"mcpServers": {
"govdata": {
"command": "govdata-mcp",
"env": {
"DATAGOV_API_KEY": "your-api-data-gov-key"
}
}
}
}
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"govdata": {
"command": "govdata-mcp",
"env": {
"DATAGOV_API_KEY": "your-api-data-gov-key"
}
}
}
}