city-data-mcp
OfficialAllows querying elected representatives for any US address using the Google Civic Information API.
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., "@city-data-mcp Create a full briefing on Denver"
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.
city-data-mcp
An MCP server that gives Claude deep access to US public data — demographics, economics, crime, employment, weather, housing, transit, schools, budgets, and more across 30+ cities. Built for government intelligence workflows.
What it does
22 tools that let Claude query, compare, and synthesize real public data from 15+ federal and city-level sources:
Core Data Tools
Tool | Source | What it does |
| Socrata | Crime & 311 service requests (5 cities) |
| All | Discover available cities, datasets, and coverage |
| US Census ACS | Population, income, poverty, education, housing, commuting (30 cities) |
| US Census ACS | Side-by-side comparison table for 2-6 cities |
| FRED | Unemployment, housing index, personal income with trends (20 metros) |
| BLS | Metro unemployment rate, employment, labor force (20 metros) |
| FBI UCR | State-level crime stats with multi-year trends |
| NWS | Current conditions and forecasts for any US city |
| AirNow/EPA | Real-time air quality index (AQI) and pollutant levels |
| HUD | Fair market rents, income limits, housing affordability |
| USGS | Water levels, streamflow, and conditions |
| Google Civic | Elected officials at all levels for any address |
| Open311/SeeClickFix | Service request trends and patterns |
| GTFS feeds | Public transit routes, performance, coverage |
| Dept of Education | School district demographics, performance, funding |
| City portals | Building permit activity and trends |
| City portals | Municipal budget and expenditure data |
| City portals | Traffic safety and congestion data |
Intelligence Tools
Tool | What it does |
| Find peer cities by demographic/economic similarity (fast, Census-only) |
| Rich peer cohort using demographics + economics + employment |
| Comprehensive city briefing pulling from all available data sources |
| Map a community issue (e.g., "affordable housing") to relevant data across sources |
| Track how a city's metrics have changed over time |
Related MCP server: socrata-mcp
Quick start
Claude Desktop (local, stdio)
Clone and build:
git clone https://github.com/zencity-product/city-data-mcp.git
cd city-data-mcp
npm install && npm run buildGet free API keys:
Census API (required): https://api.census.gov/data/key_signup.html
FRED API (required): https://fred.stlouisfed.org/docs/api/api_key.html
BLS API (optional, higher rate limits): https://www.bls.gov/developers/home.htm
Add to Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"city-data-mcp": {
"command": "node",
"args": ["/path/to/city-data-mcp/dist/index.js"],
"env": {
"CENSUS_API_KEY": "your-census-key",
"FRED_API_KEY": "your-fred-key"
}
}
}
}Restart Claude Desktop.
Remote (HTTP mode)
Run as an HTTP server for remote access:
PORT=3000 CENSUS_API_KEY=xxx FRED_API_KEY=xxx node dist/index.js --httpMCP endpoint: http://localhost:3000/mcp
Health check: http://localhost:3000/health
REST API
When running in HTTP mode, a REST API is also available at /api/ for non-MCP consumers (dashboards, scripts, other apps):
GET /api/cities → all supported cities
GET /api/census/:city → demographics
GET /api/economics/:city → FRED economic indicators
GET /api/employment/:city → BLS employment data
GET /api/crime/:city → FBI crime stats
GET /api/weather/:city → NWS weather
GET /api/air-quality/:city → EPA air quality
GET /api/housing/:city → HUD housing data
GET /api/water/:city → USGS water conditions
GET /api/representatives/:city → elected officials
GET /api/311/:city → service request trends
GET /api/transit/:city → public transit
GET /api/schools/:city → school district data
GET /api/permits/:city → building permits
GET /api/budget/:city → municipal budget
GET /api/traffic/:city → traffic safety
GET /api/briefing/:city → comprehensive city briefing
GET /api/changes/:city → metrics change trackingExample prompts
"Create a full briefing on Denver"
"Compare demographics for Denver, Austin, and Portland"
"What are the economic indicators for Seattle?"
"Find cities similar to Boston based on housing costs"
"Who are the elected representatives for 123 Main St, Chicago?"
"What's the air quality like in Los Angeles right now?"
"Show me school district data for Houston"
"Map the issue of 'affordable housing crisis' to data for San Francisco"
"Track how Phoenix has changed over the last 5 years"
"What's the transit coverage like in Portland?"
"Show me building permit trends in Austin"
Data sources
Source | Coverage | Freshness | Auth |
30 cities (demographics) | Annual (5-year estimates) | Free key | |
20 metros (economic indicators) | Monthly to annual | Free key | |
20 metros (employment) | Monthly | Optional key | |
All states (crime stats) | Annual (1-2yr lag) | Reuses Census key | |
All US locations (weather) | Real-time | None | |
All US locations (air quality) | Real-time | None | |
All US areas (housing) | Annual | None | |
All US monitoring stations (water) | Real-time | None | |
All US addresses (representatives) | Live | None | |
Participating cities (311) | Near real-time | None | |
5 cities (crime, 311) | Near real-time | None | |
GTFS feeds | Major cities (transit) | Varies | None |
City open data portals | Varies (permits, budgets, traffic) | Varies | None |
Covered cities
Demographics (Census): NYC, Chicago, San Francisco, Los Angeles, Seattle, Houston, Phoenix, Philadelphia, San Antonio, San Diego, Dallas, Austin, Denver, Boston, Nashville, Portland, Baltimore, Atlanta, Miami, Washington D.C., Minneapolis, Detroit, Pittsburgh, Charlotte, Columbus, Indianapolis, Memphis, Milwaukee, Jacksonville, Raleigh
Economics (FRED) & Employment (BLS): NYC, Chicago, San Francisco, Los Angeles, Seattle, Houston, Phoenix, Denver, Boston, Austin, Dallas, Washington D.C., Atlanta, Miami, Portland, Detroit, Minneapolis, Philadelphia, Nashville, Charlotte
Weather, Air Quality, Housing, Water, Representatives: All US locations (national APIs)
311, Transit, Schools, Permits, Budgets, Traffic: City-specific coverage (varies)
Architecture
src/
├── index.ts # Server entry (stdio + HTTP + REST transports)
├── cities.ts # City registry lookup
├── types.ts # Type definitions
└── sources/
├── census.ts # US Census ACS (demographics)
├── fred.ts # FRED (economic indicators)
├── bls.ts # BLS (employment)
├── fbi.ts # FBI UCR (crime statistics)
├── nws.ts # National Weather Service
├── airnow.ts # EPA AirNow (air quality)
├── hud.ts # HUD (housing)
├── usgs.ts # USGS (water)
├── civic.ts # Google Civic (representatives)
├── socrata.ts # Socrata (city-level crime, 311)
├── three11.ts # Open311/SeeClickFix (service requests)
├── transit.ts # GTFS (public transit)
├── schools.ts # School district data
├── permits.ts # Building permits
├── budget.ts # Municipal budgets
├── traffic.ts # Traffic safety & congestion
├── cohort.ts # Census-based peer city cohort builder
├── full-cohort.ts # Multi-source peer city cohort builder
├── briefing.ts # Comprehensive city briefing generator
├── issue-mapper.ts # Community issue → data mapper
├── change-tracker.ts # City metrics change tracking
└── geo-resolver.ts # Geographic coordinate resolutionInternational expansion
Research on extending to UK and Canada data sources is tracked separately. Key findings:
UK: 12/15 US categories have usable equivalents. Strongest: crime (data.police.uk), water (Environment Agency), demographics (ONS/Nomis).
Canada: StatCan WDS covers 6+ categories via one API. MSC GeoMet covers weather + air + water in one API.
License
MIT
Available Tools
28 toolscompare_demographicsCompare City DemographicsA
Compare demographic data across multiple US cities side by side. Works for ANY US city (~30,000 places). Returns population, income, poverty, education, housing, and commuting.
Inputs: cities (required).
create_census_cohortCreate Census Peer Cohort (Fast)A
Find peer cities based on Census demographic data. Fast — uses only Census ACS data across ~75 cities.
Compares: population, income, poverty, education, housing costs, commuting patterns, region.
Criteria: "balanced", "size", "economics", "housing", "education", "commuting", "region".
Use this for quick demographic peer matching. For richer multi-source comparison (economics, crime, employment), use create_full_cohort instead.
Inputs: city (required), criteria, cohortSize.
create_city_briefingCreate Comprehensive City BriefingA
Pull data from ALL available sources and assemble a structured executive briefing for a city in the US, UK, or Canada.
US: 14 data sources (Census, FRED, BLS, FBI, NWS, AirNow, HUD, USGS, Civic, 311, Transit, Schools, Permits, Budget). UK: 11 data sources (ONS demographics/economics/housing, Police crime, Met Office, DEFRA, Environment Agency, DfT, DfE, TWFY, Budget). CA: 9 data sources (StatCan demographics/economics/employment/crime/housing, MSC weather/air/water, Represent).
The "give me everything" tool. Takes 10-20 seconds. Country auto-detected or specify with country parameter.
Inputs: city (required), country.
create_full_cohortCreate Full Peer Cohort (Rich)A
Find peer cities using ALL data sources: Census demographics, FRED economics, BLS employment, and FBI crime data. Richer but slower than create_census_cohort (~50 cities pool).
Compares across 12 dimensions: population, income, poverty, education, home values, rent, housing price trend, unemployment, job growth, per-capita income, violent crime rate, and geographic region.
Criteria options:
"balanced" (default) — even weight across all dimensions
"economics" — prioritize unemployment, job growth, income
"livability" — prioritize crime, education, poverty
"safety" — heavily weight crime rates
"growth" — prioritize job growth, housing trends, employment
"affordability" — prioritize home values, rent, housing costs
Use this for comprehensive benchmarking. Takes longer due to multi-source API calls.
Inputs: city (required), criteria, cohortSize.
list_available_dataList Available City DataA
List all supported cities and the data categories available for each. Use this to discover what data you can query.
Inputs: no named parameters.
map_issue_dataMap Community Issue to DataA
Given a community concern or issue topic, find all relevant hard data for a city. The cross-reference engine — "residents say X, here's what the data shows."
Available topics: Housing Affordability (housing affordability) — Housing costs, rent burden, fair market rents, home values, building permits, Public Safety (public safety) — Crime rates, police budget, 311 safety complaints, Traffic Safety (traffic safety) — Traffic fatalities, pedestrian safety, drunk driving crashes, congestion, Pedestrian & Cyclist Safety (pedestrian safety) — Pedestrian fatalities, cyclist deaths, Vision Zero, walkability, Transportation & Infrastructure (transportation) — Transit ridership, commuting patterns, road conditions, traffic safety, Education & Schools (education) — School enrollment, spending, student-teacher ratios, education levels, Economic Development & Jobs (economic development) — Unemployment, job growth, business permits, income levels, Environment & Sustainability (environment) — Air quality, water quality, parks, green space, Homelessness & Social Services (homelessness) — Poverty rates, housing costs, social spending, related 311 reports, Infrastructure & Utilities (infrastructure) — Water systems, roads, building activity, utility spending, Health & Wellness (health) — Air quality, health spending, poverty as health indicator.
Also accepts free-text issues (matched to closest topic by keywords).
Example: "housing affordability" in Denver → pulls home values, rent, FMR, permits, housing budget allocation.
Inputs: city (required), issue (required).
query_311_trendsQuery 311 Service Request TrendsB
Analyze 311 service request trends for a US city. Returns top complaint categories, request volumes, and monthly trends. US only.
Available cities: [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object].
Great for understanding what residents are actually reporting: potholes, noise, graffiti, homeless encampments, etc.
Inputs: city (required), days.
query_air_qualityQuery Air QualityA
Get air quality data for a city in the US, UK, or Canada.
US: EPA AirNow — AQI (0-500 scale). Requires AIRNOW_API_KEY. UK: DEFRA UK-AIR — DAQI (1-10 scale). No API key needed. CA: MSC — AQHI (1-10+ scale). No API key needed.
Note: Each country uses a different scale. Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_budgetQuery City BudgetB
City government budget data for a city in the US or UK.
US: Published municipal budgets — total budget, per-capita spending, category breakdown (30 cities). UK: Local authority spending — council tax Band D, total spending, category breakdown (11 cities). CA: Not yet available.
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_city_dataQuery City Public DataA
Query publicly available data for a US city by category. US only (Socrata open data portals).
Supported cities: NYC, Chicago, San Francisco, Los Angeles, Seattle Supported categories: crime, 311
Returns recent data with category breakdown and sample records.
Inputs: city (required), category (required), limit, daysBack.
query_cost_of_livingQuery Cost of Living (CPI)B
Consumer Price Index data by metro area from the Bureau of Labor Statistics. Shows overall inflation rate and breakdown by category: food, housing, transportation, medical care, and energy.
17 metros available. Includes year-over-year inflation rates and monthly trend data.
Inputs: city (required).
query_demographicsQuery City DemographicsA
Query demographic data for a city in the US, UK, or Canada.
US: Census ACS — population, income, poverty, education, housing, commuting (~30,000 places). UK: ONS/Nomis — population, households, age distribution. CA: StatCan Census Profile — population, income, households, immigration.
Country is auto-detected or specify with the country parameter. Required for ambiguous cities (London, Birmingham, etc.).
Inputs: city (required), country.
query_economicsQuery City Economic DataA
Query economic indicators for a city in the US, UK, or Canada.
US: FRED — unemployment, employment, housing price index, per capita income (20 major metros). UK: ONS — CPI, GDP, regional GVA, unemployment. CA: StatCan — CPI, GDP, retail trade (national/provincial).
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_employmentQuery City Employment DataA
Query employment statistics for a city in the US, UK, or Canada.
US: BLS — metro unemployment rate, total employment, labor force (20 major metros). UK: ONS/Nomis — regional unemployment rate. CA: StatCan LFS — unemployment, employment, participation rates (13 CMAs).
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_homelessnessQuery Homelessness DataA
HUD Point-in-Time (PIT) homelessness counts for US cities. Returns total homeless, sheltered vs unsheltered, chronic homelessness, veterans, families, unaccompanied youth, per-capita rates, and year-over-year trends.
20 cities available. Data from January 2024 PIT count (AHAR Part 1).
Inputs: city (required).
query_housingQuery Housing DataA
Get housing data for a city in the US, UK, or Canada.
US: HUD — Fair Market Rents, area median income, income limits. No API key needed. UK: ONS/Land Registry — house prices, annual change. No API key needed. CA: StatCan/CREA — average/median price, price change, housing starts.
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_migrationQuery Population Migration & MobilityB
Census geographic mobility data showing population movement patterns. Returns what percentage of a city's population moved in from a different state or abroad in the past year, vs stayed in the same house.
Works for any US city (~30,000 places). Uses ACS 5-Year estimates, Table B07003.
Inputs: city (required).
query_national_crimeQuery Crime StatisticsA
Query crime data for a city in the US, UK, or Canada.
US: FBI UCR — state-level violent/property crime, homicide, robbery, assault, multi-year trends. UK: data.police.uk — street-level crime by category (anti-social behaviour, burglary, robbery, violence, etc.). CA: StatCan UCR — Crime Severity Index, violent/non-violent CSI, homicide rate (CMA level).
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_permitsQuery Building PermitsB
Building permit trends from the Census Bureau's Building Permits Survey. US only. Shows 5-year trend (2020-2024) of permits and housing units authorized at the county level.
52 cities available. Rising permits = development activity; declining = slowdown.
Inputs: city (required).
query_public_healthQuery Public Health DataA
Get public health indicators from CDC PLACES for a US city. Returns 30+ measures including obesity, diabetes, depression, mental health, smoking, binge drinking, insurance coverage, food insecurity, housing insecurity, loneliness, and disability rates.
Data from BRFSS (Behavioral Risk Factor Surveillance System). Covers 500+ US cities. No API key needed.
Great for: understanding community health challenges, anchoring social media health discussions with data.
Inputs: city (required).
query_representativesQuery Elected RepresentativesA
Look up elected officials for a city in the US, UK, or Canada.
US: Google Civic — federal, state, local officials. Requires GOOGLE_CIVIC_API_KEY. UK: TheyWorkForYou — MPs, constituency. Requires TWFY_API_KEY. CA: Represent (Open North) — federal MP, provincial MLA/MPP, municipal councillors. No API key needed.
Country auto-detected or specify with country parameter.
Inputs: address (required), country.
query_schoolsQuery School DataA
School data for a city in the US or UK.
US: NCES — enrollment, student-teacher ratios, finance data (52 cities). UK: DfE GIAS — school counts, types, Ofsted ratings by local authority. CA: Not yet available.
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_trafficQuery Traffic Safety & CongestionB
Traffic safety data from NHTSA FARS and TTI congestion metrics. US only. Returns fatal crash statistics (2019-2022) including pedestrian, cyclist, and alcohol-related breakdowns.
County-level data as primary view with state-level context. Congestion data for 33 metros.
No API key needed. Works for any US city via geo-resolver.
Inputs: city (required).
query_transitQuery Public Transit / TransportA
Public transit and transport data for a city in the US or UK.
US: NTD — ridership by agency and mode, service hours, efficiency (53 cities). UK: DfT — road traffic, bus passengers, rail station usage (8 major cities). CA: Not yet available.
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_waterQuery Water ConditionsB
Get real-time water monitoring data for a city in the US, UK, or Canada.
US: USGS — streamflow, gage height, water temperature. No API key needed. UK: Environment Agency — water levels, flow rates, flood warnings (England only). No API key needed. CA: MSC Hydrometric — water levels, discharge. No API key needed.
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
query_weatherQuery City WeatherA
Get current weather conditions and forecast for a city in the US, UK, or Canada.
US: National Weather Service — conditions, forecast, alerts. No API key needed. UK: Met Office DataHub — hourly forecast. Requires METOFFICE_API_KEY. CA: MSC GeoMet — current conditions and forecast. No API key needed.
Country auto-detected or specify with country parameter.
Inputs: city (required), country.
search_uk_datasetsSearch UK Open DataB
Search the UK government's open data catalogue (data.gov.uk).
Returns dataset titles, publishers, formats, and links. No API key required.
Inputs: query (required), limit.
track_city_changesTrack City Changes Over TimeA
Show how a city is changing — what's improving, declining, or holding steady. Pulls trend data from BLS (unemployment), FRED (economics), FBI (crime), building permits, and 311 complaints.
Returns a directional dashboard: each metric tagged as improving, declining, or stable with supporting data. Great for spotting momentum or emerging problems.
Inputs: city (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 28 tools
Most query_* tools target distinct datasets and domains, and descriptions often clarify when to use alternatives. However, query_city_data overlaps with query_311_trends and query_national_crime, while meta-tools like map_issue_data and create_city_briefing overlap with individual query tools, creating several ambiguous boundaries.
Tool names consistently follow a snake_case verb_noun pattern: query_*, create_*, compare_*, list_*, map_*, track_*, search_*. Minor variations like query_311_trends and query_cost_of_living remain readable and within the same convention.
With 28 tools, the server exceeds the ideal range and falls into the 25+ category, which is heavy for an agent to navigate. While the broad city-data domain explains some breadth, several tools could be parameterized or consolidated instead of exposed individually.
The surface covers a wide range of city data domains, including demographics, crime, economics, housing, transit, schools, health, and government budgets, plus aggregation tools. There are minor gaps in country coverage, such as Canada lacking transit, schools, budget, and traffic tools, but agents can work around these limitations.
Maintenance
Related MCP Connectors
Agent-native MCP server over 49M+ US public and government records, privacy-first, always current.
MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence
Hosted MCP server for live public-data APIs and Skills for AI agents.
This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that gives AI agents clean, token-efficient access to US civic & property data — geocoding, census tracts, Opportunity Zones, ACS demographics, and FEMA flood zones — sourced entirely from free federal open data.51MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives LLM agents typed, cached access to civic open-data portals via Socrata (SODA 2.1 + Discovery API), enabling search, query, profiling, sampling, and CSV export of datasets.6MIT
- FlicenseNot gradedqualityCmaintenanceRemote MCP server exposing US Census (ACS 5-year) and FEMA flood data. Works as a connector in both Claude and ChatGPT.-
- AlicenseNot gradedqualityBmaintenanceAn MCP server that connects to open data portals like CKAN and Socrata, enabling natural language querying of datasets via Claude.MIT