OpenGov MCP Server
An MCP (Model Context Protocol) server that enables MCP clients like Claude Desktop to access Socrata Open Data APIs. This integration allows Claude Desktop to search for, retrieve, and analyze public datasets from government data portals.
Overview
This MCP server provides access to open data from any Socrata-powered data portal, including those from cities, states, and federal agencies such as:
No API key is required for basic usage, as the server accesses public data.
Features
With this MCP server, clients can:
- Search and discover datasets by keyword, category, or tags
- View dataset metadata and column information
- Run SQL-like queries to retrieve and analyze data
- Get portal usage statistics
Installation for Claude Desktop
Quick Setup with npx (Recommended)
The easiest way to use this MCP server is with npx, which doesn't require any installation:
- Create or edit your Claude Desktop configuration:Create or edit
claude_desktop_config.json
in your home directory:You can replace the DATA_PORTAL_URL with any Socrata-powered data portal.Copy - Restart Claude Desktop (if it was already running)
- Start using the MCP server:In Claude Desktop, you can now ask questions like:and you can follow up with questions that drill further into detail:CopyThe first time you run a query, npx will automatically download and run the latest version of the server.Copy
Manual Installation from Source
If you prefer to run from source (for development or customization):
- Clone this repository:Copy
- Install dependencies and build:Copy
- Create Claude Desktop configuration:Create or edit
claude_desktop_config.json
in your home directory:ReplaceCopy/path/to/your/opengov-mcp-server
with the actual path where you cloned the repository. - Restart Claude Desktop (if it was already running)
Available Tool: get_data
This MCP server provides a unified get_data
tool that Claude Desktop uses to access Socrata data.
Parameters
type
(string, required): Operation typecatalog
: Search and list datasetscategories
: List dataset categoriestags
: List dataset tagsdataset-metadata
: Get dataset detailscolumn-info
: Get dataset column informationdata-access
: Query and retrieve recordssite-metrics
: Get portal statistics
domain
(string, optional): Data portal hostname (without protocol)query
(string, optional): Search query for datasetsdatasetId
(string): Dataset identifier for specific operationssoqlQuery
(string, optional): SoQL query for filtering datalimit
(number, optional): Maximum results to return (default: 10)offset
(number, optional): Results to skip for pagination (default: 0)
Example Queries
These are examples of how Claude Desktop will format queries to the MCP server:
Configuration Options
The server requires one environment variable:
DATA_PORTAL_URL
: The Socrata data portal URL (e.g.,https://data.cityofchicago.org
)
This can be set:
- In the Claude Desktop configuration (recommended)
- In your environment variables
- Via command line:
DATA_PORTAL_URL=https://data.cityofchicago.org opengov-mcp-server
Related MCP Servers
- Python
- Python
- MIT License
- Python