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.1.tar.gz (22.2 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.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_geo-0.2.1.tar.gz.

File metadata

  • Download URL: mcp_geo-0.2.1.tar.gz
  • Upload date:
  • Size: 22.2 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.1.tar.gz
Algorithm Hash digest
SHA256 ab7eb2cdd1024d66dfa68297fd5407bbb444e5fbc2dbfceace2cf44ce603ecdc
MD5 a1bb210ecdaa07714340cd82db855c11
BLAKE2b-256 44155606d5b6cdb22f64d95018f117ed83c020777581c802a984b60a0e3e51a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_geo-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_geo-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 edcc311165265cc855398607f22cf40622b19a847144946fd8e02349c0973c24
MD5 3fd49680dc36ff3e5842d18963ace274
BLAKE2b-256 726410f1a322b533b79a65b5cd8d78976c292a7dfc65242c7239131e4f344cfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_geo-0.2.1-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