Eight tools, four resources
Discover, fetch, cross-reference, and query the Socrata portal as an MCP server.
Ask an AI agent a question about Cambridge civic data; get a cross-dataset answer.
The Cambridge MA Open Data Portal is a Socrata instance with 280+ public datasets including budget, public safety, permitting, GIS/parcels, public health, schools, and more.
This project makes the Cambridge MA Open Data Portal data usable by an AI agent through two complementary interfaces that work in union:
cambridge_data.mcp, console script cambridge-open-data-ma-mcp) — the machine interface: eight tools and four resources that an AI agent can use to discover, fetch, cross-reference, and query the Portal..claude/skills/cambridge-open-data/SKILL.md) — the cognitive interface: the discover → fetch → cross-reference → infer workflow working around know gotchas already found when working with with data in the Portal.A CLI, cambridge-data, is provided for you to directly access the same Python scripts that the MCP server and Skill use. This provides one source of truth across these tools.
Public dataset reads and catalog search work with no credentials.
TIP
New here? Start with Getting started, then read the workflows and the gotchas before trusting any responses the toolkit returns.
Five worked use-cases are included as tutorials, each grounded in a real analysis run against the portal. They double as the toolkit's test-suite:
| # | Question | What it teaches |
|---|---|---|
| 1 | FY2027 salary vs. operating budget, by department | A clean cross-dataset join (ixg8-tyau ⋈ 5bn4-5wey) |
| 2 | Are street-cleaning parking tickets paid? What's the revenue lost? | The recent-window trap — a field populated for 4.8% of rows |
| 3 | Which private spaces are open to the public, and under what rules? | Spatial discovery + reading scanned decisions (the largest analysis here) |
| 4 | What does the portal know about 80 Thorndike St? | The era gap — current permit datasets start 2018-07 |
| 5 | What did the developer of 40 Thorndike St promise the City? | Civic agreements aren't portal data + existence ≠ delivery |
Open the tutorials. After the five analyses, tutorial 6 shows the whole loop driven from a harness -- the Skill in opencode, with the MCP tool calls that produce the answer.
Clone from the GitHub repo, initiate using uv, make the CLI accessible, then set up the Portal dataset catalog:
git clone git@github.com:ali5ter/cambridge-open-data-ma-ai.git
cd cambridge-open-data-ma-ai
uv sync
mkdir -p ~/.local/bin && ln -sf "$PWD/scripts/cambridge-data" ~/.local/bin/cambridge-data
cambridge-data refresh # pull the 280+ dataset index (a few seconds)
uv run scripts/mcp_smoke.py # end-to-end check (14/14 with a populated cache)The ln -sf line puts the CLI on your PATH so cambridge-data runs from any directory. Read how to install and register across various harness's (opencode, Claude Code, Cursor, Cline/Roo, Codex, Gemini CLI, and Antigravity) and the HTTP bridge for OpenWebUI, ChatGPT, and Claude.
docs/ this site
index.md you are here
install.md register the server across harnesses + deliver the Skill
getting-started.md first cross-dataset question, end-to-end
concepts.md discover → fetch → cross-reference → infer, plus the guards
gotchas.md the failure modes that make civic-data answers wrong
reference.md the 8 tools and 4 resources
configuration.md .env, cache/reports directories
tutorials/ the five worked use-cases plus a harness how-to
src/cambridge_data/ the library + the MCP server + the cambridge-data CLI (one source of truth)
scripts/ per-operation helpers (by-hand equivalents of cambridge-data)
opencode.json the shareable server registration