Skip to main content

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.

PyPI version License: MIT CI

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:

  1. geocode("Buriganga River, Dhaka") → coordinates
  2. buffer(river, 2000) → 2 km polygon
  3. osm_features(buffer, {"amenity": "hospital"}) → GeoJSON of hospitals
  4. distance → 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_geo-0.2.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_geo-0.2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

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

Hashes for mcp_geo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 690ed658033613efe5e9125ba899f4b9c365a5d2dfc398e8b5c05642d9c7981c
MD5 9ec0e83f4cf4a7d1a0c592dea4dde896
BLAKE2b-256 da7c86bc4222e1d77a0074b344cf7898dc9f5cc8f421ecd106dfd10e74cbd5d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_geo-0.2.0.tar.gz:

Publisher: publish.yml on tabibhasann/geo-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mcp_geo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbe9ed20de1d95f5de2e27fe55e9a54edbe0a56d8c6f641f24c2bb5c609ee7cd
MD5 a78640c8f231d5de7dbbe809a1626d09
BLAKE2b-256 f753f24a5dbb2e407fba77bffa00ef956e709ee613d369edf9787bb74a13d551

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_geo-0.2.0-py3-none-any.whl:

Publisher: publish.yml on tabibhasann/geo-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page