socrata-mcp-server
v0.1.5
Published
MCP server that enables a client, such as Claude Desktop, to access open government data through Socrata APIs
Downloads
111
Maintainers
Readme
Socrata MCP Server
A Model Context Protocol (MCP) server that connects AI tools to open data on any Socrata-powered portal — including NYC, Chicago, San Francisco, and hundreds of other cities.
Formerly known as opengov-mcp-server. Renamed to avoid confusion with OpenGov Inc.
What it does
This server gives AI assistants (Claude, Copilot, Cursor, Codex) direct access to public datasets via Socrata's open data API. Instead of the AI guessing at data, it can query real civic data in real time.
Example queries an AI can answer with this server:
- "What are the top 311 complaint types in Brooklyn this month?"
- "Show me restaurant inspection trends in Manhattan"
- "Compare crime data across Chicago neighborhoods"
Quick start
Use with npx (no install needed)
npx socrata-mcp-server --stdioClaude Desktop configuration
Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"socrata": {
"command": "npx",
"args": ["-y", "socrata-mcp-server", "--stdio"],
"env": {
"DEFAULT_DOMAIN": "data.cityofnewyork.us"
}
}
}
}Development
git clone https://github.com/npstorey/socrata-mcp-server.git
cd socrata-mcp-server
npm install
npm run build
npm run dev # Starts on http://localhost:10000Environment variables
# .env
PORT=10000
DATA_PORTAL_URL=https://data.cityofnewyork.us # Default portal (optional)Available tools
| Tool | Description |
|------|-------------|
| get_data | Unified data access: catalog search, metadata lookup, SoQL queries, and dataset metrics |
| search | Search for datasets or records, returns ID/score pairs |
| fetch | Retrieve full dataset metadata or records by ID |
Supported portals
Works with any Socrata-powered open data portal. Some popular ones:
| City | Portal |
|------|--------|
| New York City | data.cityofnewyork.us |
| Chicago | data.cityofchicago.org |
| San Francisco | data.sfgov.org |
| Seattle | data.seattle.gov |
| Los Angeles | data.lacity.org |
Transport
- stdio — For local use with Claude Code, Cursor, and VS Code Copilot
- HTTP (Streamable HTTP) — For web applications. Endpoint:
POST /mcp
The deployed instance at https://socrata-mcp-server.onrender.com powers civicaitools.org.
Development
npm test # Run tests
npm run build # Build TypeScript
npm run dev # Start dev server
npm run lint # LintRelated projects
| Repository | Description | |-----------|-------------| | civic-ai-tools | Starter project that bundles this server with Data Commons MCP for multi-source civic data queries | | civic-ai-tools-website | Demo website at civicaitools.org — side-by-side comparison of AI with and without live data | | odp-mcp | Socrata's official MCP server (similar functionality, different implementation) |
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Disclaimer
This is a personal project and is not affiliated with, endorsed by, or representative of any employer or organization.
License
MIT
