opengov-mcp-server
The OpenGov MCP Server enables access to Socrata-powered government data portals, allowing users to search, retrieve, and analyze public datasets.
Search and Discover Datasets: Search datasets by keyword, category, or tags using the
catalog,categories, andtagsoperations.Access Dataset Metadata: Retrieve detailed metadata and column information for specific datasets.
Query and Analyze Data: Run SQL-like queries to filter, sort, and retrieve data records using parameters like
soqlQuery,select,where, andorder.Pagination and Limits: Control the number of results with
limitandoffset.Aggregate Functions: Group and filter data with
groupandhavingfor aggregate queries.Portal Statistics: Get portal-wide usage statistics with
site-metrics.Custom Domain Support: Specify a data portal domain for flexibility across different Socrata portals.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opengov-mcp-server show me recent building permits in Chicago"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: json-mcp-server
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.jsonin your home directory:{ "mcpServers": { "opengov": { "command": "npx", "args": ["-y", "opengov-mcp-server@latest"], "env": { "DATA_PORTAL_URL": "https://data.cityofchicago.org" } } } }You can replace the DATA_PORTAL_URL with any Socrata-powered data portal.
Restart Claude Desktop (if it was already running)
Start using the MCP server:
In Claude Desktop, you can now ask questions like:
How many cars were towed in Chicago this month?and you can follow up with questions that drill further into detail:
Which make and color were towed the most? Also, were there any interesting vanity plates?The first time you run a query, npx will automatically download and run the latest version of the server.
Manual Installation from Source
If you prefer to run from source (for development or customization):
Clone this repository:
git clone https://github.com/srobbin/opengov-mcp-server.git cd opengov-mcp-serverInstall dependencies and build:
npm install npm run buildCreate Claude Desktop configuration:
Create or edit
claude_desktop_config.jsonin your home directory:{ "mcpServers": { "opengov": { "command": "node", "args": [ "/path/to/your/opengov-mcp-server/dist/index.js" ], "env": { "DATA_PORTAL_URL": "https://data.cityofchicago.org" } } } }Replace
/path/to/your/opengov-mcp-serverwith 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:
// Find datasets about budgets
{
"type": "catalog",
"query": "budget",
"limit": 5
}
// Get information about a dataset
{
"type": "dataset-metadata",
"datasetId": "6zsd-86xi"
}
// Query dataset records with SQL-like syntax
{
"type": "data-access",
"datasetId": "6zsd-86xi",
"soqlQuery": "SELECT * WHERE amount > 1000 ORDER BY date DESC",
"limit": 10
}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
Available Tools
1 toolget_dataC
[City of Chicago | Data Portal] Access data and metadata to learn more about the city and its underlying information.
Inputs: type (required), domain, query, datasetId, +9 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools, so disambiguation is perfect.
The single tool name 'get_data' follows a clear verb_noun pattern, and consistency is trivially maintained.
Only one tool is far below the typical 3-15 range for a well-scoped server, and the broad purpose of accessing open government data likely requires multiple tools.
The single generic 'get_data' tool cannot cover the expected operations for a government data portal, such as searching datasets, filtering, or accessing specific data types.
Maintenance
Related MCP Connectors
MCP server for prozorro_tender_monitor_mcp
MCP server for customer-io
MCP server for public_holidays_mcp
Related MCP Servers
- Apache 2.0
- MIT
- Apache 2.0
- MIT