Geospatial MCP server — give AI agents geocoding, routing, spatial ops, and OSM querying via the Model Context Protocol
Project description
mcp-geo
A batteries-included geospatial server for the Model Context Protocol.
It gives AI agents real access to geocoding, routing, OpenStreetMap querying,
and spatial geometry operations — all returning clean GeoJSON.
Quickstart
No configuration required — it runs out of the box with public OSM services.
pip install mcp-geo
Add it to your MCP client:
{
"mcpServers": {
"geo": { "command": "uvx", "args": ["mcp-geo"] }
}
}
That is it. Your AI agent now has 20+ geospatial tools available.
Tools
Local geometry (no network)
buffer · distance · area · length · centroid · simplify · convex_hull · bbox · spatial_predicate · transform_crs · validate_geojson
Geocoding & reverse geocoding (Nominatim)
geocode · reverse_geocode
OpenStreetMap querying (Overpass)
build_overpass_query · osm_features · overpass_query
Routing (OSRM)
route · route_matrix · nearest_road
File inspection (optional extras)
vector_info · vector_read (pip install mcp-geo[files])
raster_info · zonal_stats · sample_raster (pip install mcp-geo[raster])
All network tools respect rate limits and use a proper User-Agent header.
Example: an agent answering a real spatial question
"Find hospitals within 2 km of the Buriganga river in Dhaka"
The agent composes four tools:
geocode("Buriganga River, Dhaka")→ coordinatesbuffer(river, 2000)→ 2 km polygonosm_features(buffer, {"amenity": "hospital"})→ GeoJSON of hospitalsdistance→ sort by proximity
The agent handles the reasoning — mcp-geo handles the execution reliably.
Configuration
Everything works without any setup. If you need to point at self-hosted services (higher rate limits, air-gapped environments), set these environment variables:
| Variable | Default |
|---|---|
GEO_MCP_NOMINATIM_URL |
https://nominatim.openstreetmap.org |
GEO_MCP_OSRM_URL |
https://router.project-osrm.org |
GEO_MCP_OVERPASS_URL |
https://overpass-api.de/api/interpreter |
Rate limiting is enforced client-side — 1 request per second to Nominatim by default. For production use, consider running your own Nominatim, OSRM, and Overpass instances.
Development
pip install -e ".[dev]"
ruff check src/ tests/
mypy src/
pytest --cov=geo_mcp tests/ -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_geo-0.2.0.tar.gz.
File metadata
- Download URL: mcp_geo-0.2.0.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
690ed658033613efe5e9125ba899f4b9c365a5d2dfc398e8b5c05642d9c7981c
|
|
| MD5 |
9ec0e83f4cf4a7d1a0c592dea4dde896
|
|
| BLAKE2b-256 |
da7c86bc4222e1d77a0074b344cf7898dc9f5cc8f421ecd106dfd10e74cbd5d6
|
Provenance
The following attestation bundles were made for mcp_geo-0.2.0.tar.gz:
Publisher:
publish.yml on tabibhasann/geo-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_geo-0.2.0.tar.gz -
Subject digest:
690ed658033613efe5e9125ba899f4b9c365a5d2dfc398e8b5c05642d9c7981c - Sigstore transparency entry: 1689563177
- Sigstore integration time:
-
Permalink:
tabibhasann/geo-mcp@891afc19e53d0db6dfea3fa167632dff35d7b3d2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tabibhasann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@891afc19e53d0db6dfea3fa167632dff35d7b3d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_geo-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_geo-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbe9ed20de1d95f5de2e27fe55e9a54edbe0a56d8c6f641f24c2bb5c609ee7cd
|
|
| MD5 |
a78640c8f231d5de7dbbe809a1626d09
|
|
| BLAKE2b-256 |
f753f24a5dbb2e407fba77bffa00ef956e709ee613d369edf9787bb74a13d551
|
Provenance
The following attestation bundles were made for mcp_geo-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on tabibhasann/geo-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_geo-0.2.0-py3-none-any.whl -
Subject digest:
dbe9ed20de1d95f5de2e27fe55e9a54edbe0a56d8c6f641f24c2bb5c609ee7cd - Sigstore transparency entry: 1689563191
- Sigstore integration time:
-
Permalink:
tabibhasann/geo-mcp@891afc19e53d0db6dfea3fa167632dff35d7b3d2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tabibhasann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@891afc19e53d0db6dfea3fa167632dff35d7b3d2 -
Trigger Event:
push
-
Statement type: