urban-mcp
Enables fetching OpenStreetMap street networks within a bounding box via the Overpass API when network access is enabled, supporting routing and isochrone analysis.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
urban-mcp
A Model Context Protocol (MCP) server for urban planning, mobility and spatial statistics. It gives AI agents (Claude Desktop, Claude Code and any other MCP client) 24 tools for accessibility (2SFCA, gravity, 15-minute city, PTAL), multi-criteria siting (AHP, TOPSIS, MCLP), space syntax, landscape metrics, seismic screening, slope-aware routing and isochrones, and spatial statistics (Moran's I, LISA, Getis-Ord Gi*, GWR, Huff).
The methods come from three published, tested SDKs; this package is a thin, validated MCP layer over them:
SDK | Import | Used for |
| accessibility, PTAL, MCDA, MCLP, space syntax, landscape metrics, Spacemate, seismic chain | |
| slope/energy-aware routing, isochrones, hiking time, ramp audit, OSM streets | |
| Moran's I, LISA, Gi*, GWR, Huff model |
Generic GIS MCP servers (e.g. gis-mcp, mcp-geo) cover geometry operations and file I/O;
urban-mcp focuses on planning indicators and spatial statistics and returns
analysis-ready summaries.
Installation
pip install urban-mcp # Python >= 3.10
urban-mcp --list-tools # check the installOr run it without installing, with uv:
uvx urban-mcp --list-toolsDependencies: mcp (official Python SDK, 2.x), planx-sdk, zero2route3d-sdk,
geoai2analytics-sdk and NumPy/SciPy. No GDAL, GeoPandas or Shapely is needed.
Related MCP server: arcpy-mcp-server
Connecting a client
Claude Code
claude mcp add urban-mcp -- uvx urban-mcp
# with file output and OpenStreetMap downloads enabled:
claude mcp add urban-mcp -- uvx urban-mcp --output-dir ./urban_outputs --allow-networkClaude Desktop
Add to claude_desktop_config.json (Settings > Developer > Edit Config):
{
"mcpServers": {
"urban-mcp": {
"command": "uvx",
"args": ["urban-mcp"]
}
}
}With a pip install, use "command": "urban-mcp", "args": [] instead. To let the server
save results, add "--output-dir", "/path/to/folder" to args.
Other clients / HTTP
Any MCP client that launches a stdio server can run urban-mcp. For a network service use
streamable HTTP (bound to localhost by default):
urban-mcp --transport streamable-http --host 127.0.0.1 --port 8000 # endpoint: /mcpOptions
Option | Environment variable | Default | Meaning |
|
| none | the only folder |
|
| off | enables |
|
| 500 | features kept in a GeoJSON result (the rest is dropped and flagged |
|
| 2000 | largest layer accepted by the quadratic tools |
|
|
| |
| print the tools and exit |
Tools
Tool | What it does | SDK function |
| 2SFCA / E2SFCA supply-per-head of demand points to facilities, with Gini |
|
| Hansen gravity accessibility |
|
| 2SFCA on your own travel-time matrix |
|
| 0-100 score, per-category coverage, missing categories per origin |
|
| TfL PTAL index and band for a site |
|
| AHP weights and consistency ratio |
|
| TOPSIS ranking (given, AHP or equal weights) |
|
| Maximal covering location (greedy), with existing facilities |
|
| Angular integration (NAIN) and choice (NACH) per street segment |
|
| FRAGSTATS-style class and landscape metrics of a land-cover grid |
|
| FSI/GSI/OSR/L and density typology per block |
|
| ASB2014 PGA, Hazus damage states and casualties per building (screening) |
|
| Slope/energy-aware route for a mobility profile |
|
| Slope-aware isochrone polygons |
|
| DIN 33466, Naismith-Langmuir and Tobler walking times |
|
| ADA ramp slope / rise / landing audit of a 3D path |
|
| The 15 mobility profiles (adult, senior, wheelchair, bicycle ...) |
|
| Global Moran's I with permutation test |
|
| LISA clusters and outliers (FDR-corrected) |
|
| Getis-Ord Gi* hot/cold spots with 99/95/90 % bins |
|
| Geographically weighted regression, local coefficients and R2 |
|
| Huff retail model: probabilities and market shares |
|
| Save a FeatureCollection into | (urban-mcp) |
| OSM streets in a bbox via Overpass (off by default) |
|
Inputs are GeoJSON FeatureCollections (points; polygons are reduced to their area-weighted
centroid), plain arrays and numbers, each described in the tool's JSON schema. Coordinates may
be WGS84 lon/lat or projected metres: coordinate_system="auto" treats a layer as lon/lat
when every coordinate lies within +-180/+-90 and projects it to a local plane in metres.
Pass coordinate_system="projected" for projected data with small coordinate values (e.g. a
local grid in metres near the origin). Routing tools need lon/lat.
Outputs are JSON objects with the SDK function used, a summary (counts, min/mean/max,
class counts, top items) and, where it makes sense, a GeoJSON result that pairs each input
geometry with the computed properties. Results are capped at --max-output-features and
marked truncated: true with total_features.
Distances in the point-based tools (2SFCA, gravity, 15-minute city, MCLP, Huff) are
straight-line. Use route_3d / isochrones_3d, or pass a network travel-time matrix to
accessibility_2sfca_matrix, for network distances.
Resources and prompts
Resource | Content |
| Markdown catalogue of all tools and the SDK functions behind them |
| Index of method notes |
| Formula, interpretation and references: |
| Small WGS84 sample layers: |
| Package versions and the active safety configuration |
Prompt | Arguments | Workflow |
|
| 15-minute score, 2SFCA equity, profile isochrones, optional siting |
|
| Moran's I, sensitivity to weights, LISA and Gi* |
|
| AHP weights with consistency check, TOPSIS ranking, robustness |
Example conversations
You: Here are our neighbourhood centroids with population and the GP clinics with doctor counts (two GeoJSON files). Who is underserved within 1.5 km?
Assistant calls
accessibility_2sfca(demand_points=..., supply_points=..., demand_field="population", supply_field="doctors", cutoff_m=1500)and answers: "Median access is 0.42 doctors per 1 000 residents; 3 of 41 neighbourhoods (6 900 people) have no clinic within 1.5 km - all on the eastern edge. The population-weighted Gini is 0.38."
You: Is the rent level clustered? Use the census tracts layer.
Assistant runs the
hot_spot_analysisprompt:global_moran_i(I = 0.41, p = 0.001), thenlocal_moran_lisaandhotspot_gi_star, and reports 12 high-high tracts around the waterfront and 9 low-low tracts in the north, noting the FDR correction.
You: How much harder is the walk from the station to the hospital for a wheelchair user?
Assistant calls
route_3dtwice (profile="adult"andprofile="wheelchair") on the street network and compares: "The direct route climbs 40 m over a steep hill street; the wheelchair route avoids it, 0.44 km longer (12.5 vs 8.1 min) and ADA-compliant."
You: We have 120 candidate parcels; pick 5 shelter sites that cover most residents within 500 m.
Assistant calls
facility_siting_mclp(k=5, max_distance_m=500, ...), lists the five parcels with marginal coverage, and offerssave_geojsonto export them for QGIS.
Python use
The tool handlers are plain functions and can be called without MCP:
from urban_mcp.tools.accessibility import ptal_score
print(ptal_score([
{"stop_id": "s1", "walk_minutes": 4,
"routes": [{"route_id": "B1", "mode": "bus", "frequency_per_hour": 6},
{"route_id": "B2", "mode": "bus", "frequency_per_hour": 12}]},
{"stop_id": "s2", "walk_minutes": 10,
"routes": [{"route_id": "R1", "mode": "rail", "frequency_per_hour": 4}]},
])["ptal_band"]) # 2urban_mcp.server.build_server(ServerConfig(...)) returns the configured MCPServer, for
embedding or in-process testing with mcp.Client.
Security notes
No arbitrary code execution. Tools only accept data (GeoJSON, arrays, numbers, enums) validated against JSON schemas and again in the handler; nothing is evaluated or imported from user input, and no tool reads files by path.
File writes are opt-in and confined. Only
save_geojsonwrites, only when the server was started with--output-dir, only plain file names inside that folder (no paths, no..), and it never overwrites unlessoverwrite=true. Note: zero2route3d-sdk creates an emptyzero2route3d_cachefolder in the system temp directory when it parses a network; nothing else is written there by the routing tools.No network by default. Only
fetch_osm_street_networkgoes online, only with--allow-network, with a bounded bbox (about 5 x 5 km) and 12 s timeouts; its cache goes to--output-dir/osm_cacheor a temporary folder that is deleted afterwards. The routing tools never fetch elevation online (fetch_online_dem=False).Bounded work. Input layers for the quadratic tools are capped (
--max-input-features, 4 million matrix cells, 1 500 features for GWR), outputs are truncated, and long computations run in a worker thread so the server stays responsive.Errors are tool errors. Invalid input returns an MCP tool result with
isError: trueand a message that says what to fix; the server does not crash.HTTP transport binds to
127.0.0.1by default and has no authentication; put it behind an authenticating proxy before exposing it.Model outputs are screening results. The seismic tool in particular uses uncalibrated design-level mapping (see
urban://methods/seismic-screening).
Development
git clone https://github.com/YusufEminoglu/urban_mcp_sdk
cd urban_mcp_sdk
pip install -e ".[dev]"
python -m pytest --cov=urban_mcp # handler tests + in-process MCP client round trips
python -m ruff check . && python -m ruff format --check src tests
python -m mypy srcCitation
@software{eminoglu_urban_mcp,
author = {Eminoğlu, Yusuf},
title = {urban-mcp},
year = {2026},
version = {0.1.1},
doi = {10.5281/zenodo.24063350},
url = {https://doi.org/10.5281/zenodo.24063350}
}See CITATION.cff. Please also cite the underlying SDKs and the original
method papers listed in the urban://methods/* resources.
License
MIT (c) Yusuf Eminoğlu. OpenStreetMap data fetched by the OSM tool is (c) OpenStreetMap contributors, ODbL 1.0.
This server cannot be deployed
Maintenance
Related MCP Connectors
Geocoding, routing, isochrones, traffic, weather, and place search for AI agents. 19 MCP tools.
Mobility, geocoding and nearby urban services for AI agents.
GIS tools for AI agents: 65 free tools + 8 paid (hazard/site-scouting/GeoJSON export)
Routing, geocoding, places, matrix and map tools for location-aware AI workflows.
Related MCP Servers
AlicenseBqualityCmaintenanceEnables AI agents to become geospatially intelligent assistants with tools for location search, smart routing, round trip planning, reverse geocoding, isochrone analysis, route visualization, geofence management, and interactive map display.817 npm7Apache 2.0- AlicenseNot gradedqualityCmaintenanceEnables AI agents to perform spatial analysis in ArcGIS Pro using natural language by exposing all ArcGIS Pro toolboxes as MCP tools.10MIT

MapSmithofficial
AlicenseAqualityBmaintenanceEnables AI agents to perform professional-grade geoprocessing tasks such as buffers, overlays, reprojections, and terrain analysis with deterministic tools and verifiable provenance.29428 PyPI2AGPL 3.0- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform geospatial analysis, spatial data processing, vector and raster operations, coordinate transformations, spatial statistics, mapping, and access to climate, satellite, and other geospatial data through MCP-compatible clients.MIT