Utilized for local data analytics and entity resolution within the building permit data processing pipeline.
Provides tools for searching and analyzing millions of building permit records, entity relationships, and plan review routing data stored in a PostgreSQL database.
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., "@SF Permits MCP ServerShow me recent building permits in the Mission District"
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.
SF Permits MCP Server
MCP server + web application for San Francisco building permit data, entity network analysis, AI-powered permit guidance, and AI vision plan analysis. Built with FastMCP, Flask + HTMX, and deployed on Railway.
Live: https://sfpermits-ai-production.up.railway.app
Tools (21 MCP Tools)
Phase | Tool | Description |
1 — SODA API |
| Search building permits by neighborhood, type, status, cost, date, address |
| Full details for a specific permit by number | |
| Aggregate statistics grouped by neighborhood, type, status, month, year | |
| Search registered business locations | |
| Property assessments by address or block/lot | |
| DBI complaint records | |
| Notices of violation | |
| Building inspection records | |
2 — Entity/Network |
| Find entities by name across 1M+ resolved records |
| N-hop network traversal for entity relationships | |
| Anomaly detection across entity networks | |
2.75 — Knowledge |
| Predict required permits via decision tree walk |
| Timeline estimates from historical percentiles | |
| Fee calculation from structured fee tables | |
| Document checklist assembly | |
| Revision probability from cost/code analysis | |
3.5 — Facilitation |
| Land use consultant recommendations |
| Quick permit lookup by number, address, or parcel — exact matching, historical lot discovery, parcel-level merge | |
4 — Vision |
| AI vision analysis of architectural drawings |
| EPR compliance checking via Claude Vision | |
5 — Addenda |
| Search 3.9M+ plan review routing records by permit, station, reviewer, date |
Data Sources
All data from DataSF via the Socrata SODA API. 22 datasets cataloged, 13.3M records:
Permits: Building (1.3M), Plumbing (513K), Electrical (344K), Boiler (152K), Street-Use (1.2M)
Contacts: Building (1M), Electrical (340K), Plumbing (503K) — resolved into 1M+ entities
Violations: Inspections (671K), Complaints (326K), Notices of Violation (509K)
Enrichment: Business Locations (354K), Property Tax Rolls (3.7M), Development Pipeline, Housing Production
See datasets/CATALOG.md for the full catalog.
Architecture
Key Numbers
Metric | Value |
MCP tools | 21 |
SODA datasets | 23 (17.2M records) |
Entities | 1M+ (resolved from 1.8M contacts) |
Relationship edges | 576K |
Addenda routing records | 3.9M |
Knowledge base | 39 tier1 JSON files, ~86 semantic concepts |
RAG chunks | 3,682 (pgvector embeddings) |
Tests | 1,075+ |
PostgreSQL tables | 21 |
Setup
Project Phases
Phase 1: MCP server + SODA API tools + dataset catalog + benchmarks
Phase 2: DuckDB local analytics, entity resolution, co-occurrence graph
Phase 2.75: Knowledge base, decision tree, permit guidance tools
Phase 3: Web UI (Flask + HTMX), auth, morning briefs, feedback
Phase 3.5: Railway deployment, PostgreSQL migration, regulatory watch, consultant recommendations
Phase 4 (partial): AI Vision plan analysis, EPR compliance checking
Phase 4 (remaining): RAG activation, nightly refresh
Documentation
Document | Purpose |
Primary reference — project structure, Railway infra, deploy instructions | |
Data flow, schemas, module details | |
Architecture decision log | |
Backup strategy and recovery playbook | |
Session-by-session build log | |
Knowledge base inventory |