socrata-mcp
Click on "Install 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., "@socrata-mcpsearch for crime datasets on data.seattle.gov"
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.
socrata-mcp
An MCP server that gives LLM agents typed, cached access to civic open-data portals. Speaks Socrata (SODA 2.1 + Discovery API) today; the provider layer is a thin interface so CKAN can be added later without touching the tool surface.
Highlights:
Server-side profiling — null rates, distinct counts, min/max, top values computed via aggregate SoQL; the dataset is never downloaded.
Hard row caps with honest truncation — every query result carries a
truncatedflag; paging uses a stable:idorder.Disk cache under
~/.socrata-mcp/cachekeyed by query hash, with short TTLs for metadata and configurable TTLs for query results.Polite by default — request throttling, retries with backoff that honor
Retry-After, optionalSOCRATA_APP_TOKENsent asX-App-Token.Loud failures — the portal's actual error message is surfaced to the agent, never swallowed.
Tableau-ready CSV export — streamed, paged download designed to chain into vizforge's
csv_to_dashboard.
Install
git clone <this repo> && cd socrata-mcp
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"Register with your MCP client (see .mcp.json.example):
{
"mcpServers": {
"socrata": {
"command": "/absolute/path/to/socrata-mcp/.venv/bin/python",
"args": ["-m", "socrata_mcp"],
"env": { "SOCRATA_APP_TOKEN": "optional-app-token" }
}
}
}Related MCP server: ontario-data-mcp
Tools
Tool | What it does |
| Full-text catalog search via the Socrata Discovery API. |
| Columns with types, row count, update cadence, license, attribution. |
| Structured SoQL ( |
| Per-column null rates, distinct counts, min/max for dates/numbers, top values for categoricals — all portal-side. |
| First n rows (capped at 100) to see real values. |
| Streamed, paged CSV export of any query. |
Example agent flow:
search_datasets("crime", domain="data.seattle.gov")
get_dataset("data.seattle.gov", "tazs-3rd5")
profile_dataset("data.seattle.gov", "tazs-3rd5")
query("data.seattle.gov", "tazs-3rd5",
where="offense_date > '2026-06-10T00:00:00'",
order="offense_date DESC", limit=100)
export_csv("data.seattle.gov", "tazs-3rd5", "out/spd_30d.csv",
where="offense_date > '2026-06-10T00:00:00'")
# → vizforge: csv_to_dashboard("out/spd_30d.csv", ...)Configuration
All optional, via environment variables:
Variable | Default | Meaning |
| unset | Sent as |
|
| Disk cache root. |
|
| Seconds to cache dataset metadata. |
|
| Seconds to cache catalog searches. |
|
| Seconds to cache query/profile results ( |
|
| Rows returned when a query gives no limit. |
|
| Hard row cap for inline query results. |
|
| Hard row cap for CSV exports. |
|
| Rows fetched per HTTP request. |
|
| Minimum seconds between portal requests. |
|
| Per-request timeout in seconds. |
Cache layout: cache/<kind>/<sha256>.json (kind ∈ catalog, metadata, query,
profile), each file {"cached_at": <epoch>, "data": …}. Deleting the directory
is always safe.
Notes:
Discovery searches use the US endpoint (
api.us.socrata.com); EU-hosted portals are still directly queryable viaget_dataset/queryon their domain.Raw
soqlexports run as a single request, so give them an explicitLIMIT(default cap 50,000); structured exports page automatically.
Development
.venv/bin/pytest # unit tests (all HTTP mocked)
.venv/bin/pytest -m network # live smoke tests against data.seattle.govArchitecture: deterministic core (soql.py, cache.py, http_client.py,
profile.py, export.py) with the MCP layer (socrata_mcp/mcp/) as thin
wrappers over a Provider interface (providers/base.py). To add CKAN,
implement Provider in providers/ckan.py — the tool surface stays unchanged.
License
MIT — see LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jcscocca/socrata-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server