| Crates.io | data-gov-mcp-server |
| lib.rs | data-gov-mcp-server |
| version | 0.3.1 |
| created_at | 2025-10-10 15:49:41.917496+00 |
| updated_at | 2025-10-25 05:58:04.034636+00 |
| description | MCP Server for AI integration with Data.Gov |
| homepage | https://github.com/dspadea/data-gov-rs |
| repository | https://github.com/dspadea/data-gov-rs |
| max_upload_size | |
| id | 1877119 |
| size | 106,947 |
This crate provides a Model Context Protocol (MCP) server
exposing the high-level helpers from the data-gov crate and the lower-level CKAN
bindings from data-gov-ckan. The server operates strictly as a thin proxy: it does
not modify either library and forwards requests directly to the underlying
implementations.
DataGovClientpackage_search, package_show, and
organization_listThis software is brand new, and has not been thoroughly tested or hardened. Use at your own risk.
cargo run -p data-gov-mcp-server
The process reads JSON-RPC 2.0 messages (one per line) from standard input and writes responses to standard output. On startup it emits a ready message that advertises the available methods.
The MCP server exposes the following tools (methods):
data_gov.search: Search datasets on data.gov with optional filtersdata_gov.dataset: Fetch detailed metadata for a dataset by name or IDdata_gov.autocompleteDatasets: Autocomplete dataset names based on a partial querydata_gov.listOrganizations: List publishing organizations (agencies) on data.govdata_gov.downloadResources: Download one or more dataset resources to the local filesystemckan.packageSearch: Perform a low-level CKAN package_search requestckan.packageShow: Retrieve detailed metadata for a dataset using CKANckan.organizationList: List CKAN organizations with optional sorting and paginationtools/list: List all available tools and their schemastools/call: Call a tool by name with argumentsinitialize, initialized, shutdown: MCP protocol lifecycleEach request is expected to follow the shape:
{
"jsonrpc": "2.0",
"id": 1,
"method": "data_gov.search",
"params": {
"query": "climate",
"limit": 5
}
}
Responses mirror the JSON-RPC 2.0 schema and either contain a result payload or
an error object.
The data_gov.search tool accepts a query string that supports Solr-style
syntax (wildcards, phrase matching, boolean operators). For advanced fielded
filters, use the ckan.packageSearch tool and provide an filter/fq string
in Solr syntax (for example: organization:nasa-gov AND res_format:CSV). The
MCP server forwards q and fq directly to the underlying CKAN client.
To use the MCP server in VSCode, add the following to your workspace .vscode/mcp.json. Adjust the command path accordingly to the location of the MCP server.
For more information on configuring VSCode to use MCP servers:
https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_add-an-mcp-server
{
"servers": {
"data-gov": {
"type": "stdio",
"command": "target/debug/data-gov-mcp-server",
"args": []
}
},
"inputs": []
}
This will configure VSCode to launch the MCP server and connect to it for tool-based workflows.
Environment variables allow the server to reuse API configuration without altering the upstream crates:
DATA_GOV_API_KEY – CKAN API key for higher rate limitsDATA_GOV_BASE_URL – Override the default CKAN base pathDATA_GOV_USER_AGENT – Custom user agent applied to both clientsThese settings are optional; when omitted the defaults from the existing libraries are used.
The crate lives under tools/mcp/data-gov-mcp-server and is part of the main
Cargo workspace. Tests and formatting can be run from the repository root:
cargo fmt
cargo test -p data-gov-mcp-server
This is an independent project and is not affiliated with data.gov or any government agency. For authoritative information, refer to the official data.gov portal.
Licensed under the Apache License 2.0.