Houston Open Data MCP
This server lets an AI search and read public City of Houston open data (a read-only CKAN portal) — no key or sign-in needed.
Search datasets by keyword, department/organization, or topic group, with paging and totals.
List the catalog structure: publishing organizations (departments) with dataset counts, and topic groups with dataset counts — helpful for filling in search filters.
Inspect a dataset: description, owner, license, and its resources (e.g., one per year), showing which resources are queryable vs. download-only, plus as-of dates.
Describe a table: column names, types, and total row count so filters and sorts use real column names.
Query records: read rows with exact-match filters, full-text search, column selection, sorting, and pagination (max 100 rows per call).
Count matches using the returned total without paging through results; long text is truncated and errors come back with a fix-it hint.
Explore Houston+ extras (when ArcGIS mode is enabled): address lookup for council district/super neighborhood, plus NWS weather and EPA air quality by ZIP code.
Read-only and safe: only allow-listed read actions, no SQL endpoint, no writes, and no stored user data.
Enables address lookup against City of Houston GIS layers on ArcGIS Online, returning city limits, council district, and super neighborhood when USE_ARCGIS is enabled.
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., "@Houston Open Data MCP Find Houston datasets about 311 service requests"
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.
Houston Open Data MCP
An MCP server that lets an AI assistant search and read public data from the City of Houston Open Data portal, which runs on CKAN.
Built from the GSA MCP hackathon template as a Dataset Access Server. It is read-only, and it needs no key or sign-in.
Disclaimer Hackathon prototype built on the City of Houston's public open data portal. This is an independent project and not an official City of Houston service. Answers reflect published datasets and may be incomplete or out of date — verify anything important against the source dataset.
Why it matters
People already ask AI about city services. This project tests whether AI can actually use Houston's open data to answer them. With the same AI and the same question, the answer goes from generic (no MCP), to grounded in City datasets (Ask Houston), to specific to your address (Ask Houston+).
Evaluation (November 2026): 8 known-answer questions, including one the portal can't answer, asked in two agent configurations. Each matched 7 and was partial on 1 (question 3: the district-dataset count is a lower bound); the Streamlit app also made one error in supporting detail, recorded separately. 80 live tool calls with 0 errors; 81 of 81 unit tests passing (November 16, 2026). The test also exposed metadata gaps worth fixing. See eval/EVALUATION.md.
Related MCP server: Calgary Open Data MCP Server
Works with any MCP client
This is a standard MCP server: any MCP client can connect, over stdio locally or
stateless HTTP at /api/mcp. It was tested with Claude Desktop; the Streamlit demo
app uses Claude. The server itself is not tied to any one AI vendor.
Design approach: built as an experiment
The server is designed to answer a question, not only to serve data: can AI actually use our open data, and where does it fail?
Design idea | How the code delivers it |
A fair comparison. One server, two versions, same AI, same questions, so the only difference is the data. | One setting, |
MCP as an AI-readiness test. Comparing answers with and without MCP shows which datasets AI can't use, and why. |
|
Questions that probe failure. The test set includes data the portal doesn't have, so the agent must say so instead of guessing. | Question 5 (employee commute time); every tool returns an |
City data as the key to national data. The City's own list of 118 ZIP codes turns National Weather Service and EPA AirNow data into Houston answers. |
|
Tools shaped like the questions people ask. | 8 tools built around questions; |
Tested in two agent configurations. | The same 8 questions in Claude Desktop (an MCP client, over stdio) and the Streamlit app's chat agent (the same tool functions, called directly); 7 matched and 1 partial in each |
The evaluation found problems in three layers, data sources, tools and deployment, and each became a recommendation for the City's open data program.
Data sources, MCP design and deployment all matter. The data sources decide what the AI can know; the design of the tools and the choice of deployment decide how well it uses that data.
Architecture
flowchart TD
subgraph IN["Ways in"]
CD["Claude Desktop<br/>MCP client, stdio"]
ANY["Any MCP client<br/>HTTP at /api/mcp"]
ST["Streamlit app<br/>calls tools directly"]
end
subgraph SRV["Ask Houston MCP server (FastMCP, app.py)"]
T["8 tools<br/>5 + 3 in Ask Houston+ (USE_ARCGIS)"]
PR["2 prompts, 2 resources"]
PY["Pydantic inputs (models.py)<br/>shared descriptions (tool_docs.py)"]
end
subgraph CON["Read-only connectors"]
P["portal.py<br/>allow-listed CKAN read actions"]
G["gis.py<br/>4 fixed City GIS layers"]
C["conditions.py<br/>NWS + AirNow via 118 City ZIP codes"]
end
GR["Guardrails (utils.py): fixed origins, no redirects,<br/>5 MB response cap, sanitized errors"]
subgraph SRC["Public data sources"]
OD["City of Houston Open Data Portal<br/>data.houstontx.gov"]
GIS["City GIS layers<br/>ArcGIS Online"]
NWS["National Weather Service"]
AQ["EPA AirNow"]
end
CD --> SRV
ANY --> SRV
ST -. "direct function calls, not MCP" .-> SRV
SRV --> P & G & C
P & G & C --> GR
GR --> OD & GIS & NWS & AQEach layer has one job, so it can be read and tested on its own:
Ways in. Claude Desktop connects over stdio; any other MCP client can connect over stateless HTTP at
/api/mcp. The Streamlit app calls the same tool functions directly, which is why the evaluation compares two agent configurations rather than two MCP clients.Server. Tools are built around the questions people ask, not one per API endpoint. Every input is a validated Pydantic model, and both ways in read one shared set of tool descriptions.
Connectors. Each upstream service has one read-only client. Upstream addresses are fixed in code, so no tool accepts a URL from the caller.
Guardrails. All requests share the same limits, and errors return a fix-it
hintinstead of raw upstream output.Data. Everything is public. The server stores no user data and has no write actions.
Tools
Each tool answers a question a person or agent actually asks, rather than mirroring
one portal endpoint. Inputs are validated with Pydantic models (models.py); bad
values in the right shape come back with a fix-it hint.
Tool | Question it answers | What it combines |
| Is there data on this subject? | Keyword, department and topic filters in one search |
| What does the portal cover, and who publishes the most? | Department and topic listings, paged past the portal's 25-item cap, ranked |
| What's in this dataset, and which table should I query? | Dataset metadata + column lists and row counts for up to 6 tables, read in parallel; picks the newest table |
| How are values written in this table? | Columns, row count and sample rows, so exact-match filters work |
| Which records match? How many, or how much, by group? | Rows mode, or summary mode: counts, sums and averages over up to 100,000 rows, computed on the server |
With USE_ARCGIS=true, the server adds three more tools:
Tool | Question it answers |
| Who represents me, and what neighborhood am I in? Matches the address to City address points, then checks city limits, council district and super neighborhood layers in parallel: one call instead of five GIS queries. An exact match wins; if several addresses fit, it returns the choices to ask the user about |
| Should I plan around the weather? NWS forecast plus active alerts (such as flood warnings), joined to the City's own ZIP list (no key needed) |
| Is the air healthy right now? EPA AirNow current reading and forecast, joined to the City's ZIP list (needs |
Both ZIP code tools use src/houston_opendata/data/houston_zip_centroids.csv: the 118
ZIP codes fully or partially within the City (from the open data portal), each with a
center point from the Census Bureau's 2026 ZCTA Gazetteer.
The server also offers two prompts (explore_houston_topic, compare_by_geography)
and two resources (houston://info/server, houston://docs/join-keys).
Run it on your computer
Install uv, then, in PowerShell or any terminal:
uv sync --group dev
uv run pytest tests/ -v
uv run streamlit run streamlit_app.pyThe page opens at http://localhost:8501 and the MCP endpoint is
http://localhost:8501/api/mcp. Check the endpoint from a second terminal:
uv run python scripts/smoke_test.py http://localhost:8501/api/mcpTo run it as a local stdio server for Claude Code instead, use uv run python main.py.
Chat agent
The page's Ask tab is a chat agent that uses Claude and the same read-only tools.
It needs ANTHROPIC_API_KEY and APP_PASSWORD, set as Streamlit secrets or locally in
.streamlit/secrets.toml, which Git ignores. Copy .streamlit/secrets.toml.example to
start. API usage is billed separately from a Claude plan.
Ask Houston and Ask Houston+
One codebase runs as two apps, so the only difference between them is the data:
App |
| Data sources |
Ask Houston |
| Open Data Portal |
Ask Houston+ |
| Open Data Portal + City GIS address lookup + weather (NWS) and air quality (AirNow) by ZIP code |
Set USE_ARCGIS in each Streamlit app's secrets. The City GIS layers are fixed in
src/houston_opendata/gis.py: site addresses, city limits, council districts, and
super neighborhoods. For air quality, also add AIRNOW_API_KEY to Ask Houston+'s
secrets; a free key comes from https://docs.airnowapi.org. Both apps also give the
agent today's date in Houston time.
Host it
See deploy/streamlit/README.md. One process serves
the Streamlit page at / and MCP at /api/mcp. Streamlit Community Cloud may block
outside MCP clients, so test it with scripts/smoke_test.py.
Repo layout
streamlit_app.py # Streamlit host: page + /api/mcp
Dockerfile.streamlit # Same host, in a container
main.py # Local stdio entry point
src/houston_opendata/
├── app.py # Builds FastMCP, picks the transport
├── portal.py # Read-only CKAN client, shared by the tools and the page
├── gis.py # Read-only City GIS client for Ask Houston+
├── conditions.py # Weather (NWS) and air quality (AirNow) by ZIP code
├── data/ # Houston ZIP codes with center points
├── page.py # Streamlit page
├── config.py, models.py, utils.py, routes.py
├── tools/ # One file per tool
├── prompts/
└── resources/
scripts/smoke_test.py # Checks a running server with a real MCP client
scripts/run_eval.py # Collects known answers and response times
tests/ # Tests that run without network access
eval/EVALUATION.md # Evaluation write-up for the hackathon submission
eval/results.md # Raw output of scripts/run_eval.py
deploy/streamlit/ # Hosting guideAdd a tool
Create src/houston_opendata/tools/my_tool.py with a register(mcp) function, then
call it from tools/__init__.py. Put any portal call in portal.py.
Security
Tools use only allow-listed CKAN read actions. There is no SQL endpoint and no write action.
The portal and City GIS addresses come from server code and configuration, never from a tool argument.
Identifiers are validated before any request, and upstream errors are sanitized.
The endpoint has no authentication, which suits public data. Review your agency's requirements before using it beyond the hackathon.
License
MIT. See SECURITY.md.
Available Tools
6 toolshouston_describe_tableDescribe a Houston tableARead-onlyIdempotent
List a queryable resource's columns, types, and total row count.
Call this before houston_query_records so that filters, column lists, and
sorting use real column names. Only works when queryable is true.
Inputs: resource_id (required). Returns: object
houston_get_datasetGet a Houston datasetARead-onlyIdempotent
Get a dataset's description, owner, license, and resources.
A dataset can hold several resources (for example one per year). Each
resource reports queryable: when true, use its id with
houston_describe_table and houston_query_records; when false, use its
download_url. last_modified gives the resource's as-of date.
Inputs: dataset (required). Returns: object
houston_list_groupsList Houston topic groupsARead-onlyIdempotent
List the portal's topic groups and their dataset counts.
Use a group's name as the group filter in
houston_search_datasets.
Inputs: no named parameters. Returns: object
houston_list_organizationsList Houston organizationsARead-onlyIdempotent
List publishing organizations (departments) and their dataset counts.
Use an organization's name as the organization filter in
houston_search_datasets.
Inputs: no named parameters. Returns: object
houston_query_recordsQuery Houston recordsARead-onlyIdempotent
Read rows from a queryable resource, with filters and pagination.
Returns at most 100 rows per call. Use total to count matches without
paging through them, for example with a limit of 1. There is no server-side
aggregation, so for sums or averages over many rows, page through
next_offset. Very long text values are truncated.
Inputs: resource_id (required), sort, text, columns, +2 more. Returns: object
houston_search_datasetsSearch Houston datasetsARead-onlyIdempotent
Search City of Houston open datasets by keyword, department, or topic.
Start here. Each result's metadata_modified shows when its catalog entry
last changed; update frequency varies by dataset. Results include
harvested GIS datasets. Pass a result's name to houston_get_dataset.
Returns datasets with total, has_more, and next_offset, or an
error with a hint.
Inputs: group, query, pagination, organization. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct step of the same workflow: search → get dataset → describe table → query records, plus two facet-listing tools. The only superficially similar pair (list_organizations vs list_groups) is clearly differentiated by descriptions that explain which filter each name feeds into. No two tools could be reasonably confused.
Every tool follows a uniform `houston_verb_noun` pattern (search_datasets, get_dataset, describe_table, list_organizations, query_records, list_groups) in snake_case throughout. The verb choice also consistently signals the operation type (search/get/describe/list/query).
Six tools is tightly scoped for an open-data catalog: discovery, metadata retrieval, schema inspection, querying, and two facet listings. Every tool has an explicit role in the documented workflow and none appear redundant.
The core lifecycle (find → inspect → describe → query) is fully covered, including pagination and row counts, and non-queryable resources are handled via download_url. Minor gap: no dedicated tool to fetch or preview a resource download, and no aggregation, though both are documented workarounds rather than dead ends.
Maintenance
Related MCP Connectors
Search and query government open-data portals (Socrata SODA API).
Provides access to Civic Plus - See Click Fix, allowing you to interact with your data via an LLM.…
Search 77k public-sector open data APIs across 10 countries. Read-only, no API key.
City of Houston GIS — Houston, Texas open geospatial data (ArcGIS).
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables AI assistants to search, explore, and query any CKAN open data portal through natural language, making public datasets accessible without requiring knowledge of the portal's API.201,648 npm82MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, explore, and query Calgary's open data portal using SoQL, with tools for dataset discovery, metadata inspection, and data querying.MIT
- AlicenseNot gradedqualityBmaintenanceEnables querying Austin, TX open data from data.austintexas.gov using the Socrata SODA API, allowing AI agents to access municipal datasets through natural language.74 npmMIT
- AlicenseAqualityCmaintenanceProvides AI assistants with plain-English access to official Houston-area public data including weather alerts and school ratings, no API keys required.31Apache 2.0