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 geospatial MCP server that gives agents dependable GIS tools: geocoding, routing, OpenStreetMap queries, geometry operations, file inspection, raster sampling, elevation, isochrones, static maps, and workspace storage.

PyPI version CI License: MIT

Why it exists

Geospatial work usually requires several specialized libraries and services. mcp-geo packages common GIS operations behind stable MCP tools so an agent can compose real spatial workflows instead of generating one-off scripts.

Example workflow:

  1. geocode a place such as "Buriganga River, Dhaka".
  2. buffer the returned point by 2 km.
  3. osm_features for {"amenity": "hospital"} inside that area.
  4. distance or nearest_neighbor to rank the results.
  5. static_map or save_map to create a visual preview.

Installation

pip install mcp-geo

For local GIS files:

pip install "mcp-geo[files,raster,visual]"

MCP client config

{
  "mcpServers": {
    "geo": {
      "command": "uvx",
      "args": ["mcp-geo"]
    }
  }
}

The default transport is stdio. HTTP and SSE are also available:

mcp-geo --http --host 127.0.0.1 --port 8000
mcp-geo --sse --host 127.0.0.1 --port 8000

Tools

Geometry

buffer, distance, area, length, centroid, simplify, convex_hull, bbox, spatial_predicate, transform_crs, validate_geojson

Geocoding and OSM

geocode, reverse_geocode, build_overpass_query, osm_features, overpass_query

Routing, elevation, and accessibility

route, route_matrix, nearest_road, elevation, elevation_profile, isochrone

Files and rasters

vector_info, vector_read, raster_info, zonal_stats, sample_raster

Advanced workflows

build_spatial_index, spatial_query, spatial_join, cached_geocode, batch_geocode, nearest_neighbor, repair_geometry, validate_geometry

Workspace and visualization

workspace_store, workspace_get, workspace_list, workspace_clear, workspace_rename, static_map, save_map, suggest_tools, list_all_tools

Configuration

The server works without configuration by using public geospatial services. For production use, self-host high-volume providers where possible.

Variable Default Description
GEO_MCP_NOMINATIM_URL https://nominatim.openstreetmap.org Forward and reverse geocoding
GEO_MCP_OSRM_URL https://router.project-osrm.org Routing and nearest-road lookup
GEO_MCP_OVERPASS_URL https://overpass-api.de/api/interpreter OpenStreetMap feature queries
GEO_MCP_ORS_API_KEY unset OpenRouteService key for isochrones
GEO_MCP_HTTP_RETRIES 3 HTTP retry count

mcp-geo sends a project-specific User-Agent and rate-limits Nominatim calls to one request per second by default.

Development

git clone https://github.com/tabibhasann/geo-mcp.git
cd geo-mcp
uv sync --group dev
uv run ruff check src/ tests/
uv run mypy src/
uv run pytest

Optional GIS dependencies can be tested with:

uv sync --group dev --extra files --extra raster --extra visual
uv run pytest

Docker

docker build -t mcp-geo .
docker run --rm -p 8000:8000 mcp-geo mcp-geo --http --host 0.0.0.0 --port 8000

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.3.0.tar.gz (237.6 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.3.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_geo-0.3.0.tar.gz
  • Upload date:
  • Size: 237.6 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.3.0.tar.gz
Algorithm Hash digest
SHA256 5a3e4481115e7f5c949160126337181efe23e1566ccb2649d4407ffe46753234
MD5 aae6647b89e9eb10735093aa8c46a113
BLAKE2b-256 bebde30ca2d8964a21358636b5761cf60cf4330c93e69596d6281670557d6293

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mcp_geo-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 32.4 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 527568349c1f13283b74afcd2cd93a309693d493eaf288a1a5cff2ced5680d75
MD5 88d02f41644c8a25c8f734fde59a28c7
BLAKE2b-256 4b8e931612da69eb7df4dafc6342d0bf069a6e362147921b5296f94a35c004a0

See more details on using hashes here.

Provenance

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