MCP server
Install the MCP server
Run mcp/server.py locally and register it with your agent runtime.
The TXLookup MCP server lives at mcp/server.py. It uses FastMCP and speaks stdio, so any MCP-compliant runtime (Claude Code, Codex, Cursor) can call it.
Section
Prerequisites
- Python 3.11+
pip install -r requirements.txt(installsfastmcp,httpx,pydantic, etc.)- Optional: a Socrata app token — without one, requests are throttled per IP.
Section
Environment variables
Set these in .env at the repo root:
# Optional but recommended (lifts rate limits)
SOCRATA_KEY_ID=your_key_id
SOCRATA_KEY_SECRET=your_key_secret
# Only needed for Miro tools
MIRO_API_TOKEN=...
MIRO_BOARD_ID=...
See .env.example for the full list.
Section
Run the server standalone
python mcp/server.py
It starts a stdio MCP loop and waits for a client.
Section
Register with Claude Code
claude mcp add txlookup -- python /absolute/path/to/TXLookup/mcp/server.py
Verify:
claude mcp list
# txlookup python .../mcp/server.py [stdio]
Section
Register with Codex CLI
codex mcp add txlookup --command python --args /absolute/path/to/TXLookup/mcp/server.py
Section
Register with Cursor
In Cursor settings → MCP servers, add a new stdio server:
- Command:
python - Args:
/absolute/path/to/TXLookup/mcp/server.py
Section
Verify it's wired
In any agent runtime, ask:
List the tools the txlookup MCP exposes.
The runtime should report eight tools: ask_data, get_task_status, discover_datasets, get_dataset_schema, fetch_data, create_miro_board, add_to_miro, list_known_tools. Full reference on the tools page.
Section
Troubleshooting
ModuleNotFoundError: agent.tools.data— run from the repo root, or setPYTHONPATHto it. The server inserts the parent directory on import; if you symlink the file, point the symlink target at the repo.fastmcpnot found —pip install -r requirements.txt. The PyPI packagemcpand the localmcp/directory share a name; the server side-steps this by importingfastmcpfirst.- HTTP 429 from Socrata — set
SOCRATA_KEY_IDandSOCRATA_KEY_SECRET.