mcp-geo

v0.3.0
mcp-geo Checked 2 days ago Published 5 months ago

Geospatial MCP server — give AI agents geocoding, routing, spatial ops, and OSM querying via the Model Context Protocol

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

buffer

Buffer a Geometry by a distance in metres. Auto-picks the correct UTM zone, buffers in metre-space, and reprojects back to WGS84 GeoJSON.

ParameterTypeDescription
distance_m *number
geojson *string
quad_segsinteger

distance

Geodesic centroid-to-centroid distance between two GeoJSON geometries.

ParameterTypeDescription
geojson_a *string
geojson_b *string
unitstring

area

Geodesic area of a GeoJSON geometry on the WGS84 ellipsoid.

ParameterTypeDescription
geojson *string
unitstring

length

Geodesic length/perimeter of a GeoJSON geometry on the WGS84 ellipsoid.

ParameterTypeDescription
geojson *string
unitstring

centroid

Return the centroid of a GeoJSON geometry as a GeoJSON Point.

ParameterTypeDescription
geojson *string

simplify

Simplify a GeoJSON geometry using the Douglas-Peucker algorithm.

ParameterTypeDescription
geojson *string
tolerance *number
topologyboolean

convex_hull

Return the convex hull of a GeoJSON geometry.

ParameterTypeDescription
geojson *string

bbox

Return the bounding box [minx, miny, maxx, maxy] of a GeoJSON geometry.

ParameterTypeDescription
geojson *string

spatial_predicate

Check a spatial relationship between two GeoJSON geometries. Supported operations: intersects, within, contains, touches, overlaps, crosses, disjoint, equals.

ParameterTypeDescription
geojson_a *string
geojson_b *string
op *string

transform_crs

Reproject a GeoJSON geometry from one coordinate reference system to another. Uses EPSG codes (e.g., 'EPSG:4326', 'EPSG:3857') or PROJ strings.

ParameterTypeDescription
from_crs *string
geojson *string
to_crs *string

validate_geojson

Validate a GeoJSON geometry and attempt repair if invalid. Returns: {valid, errors?, repaired}

ParameterTypeDescription
geojson *string

geocode

Forward geocode an address or place name to coordinates. Returns a list of matches with name, lat, lon, bounding box, OSM type, and importance score, sorted most relevant first.

ParameterTypeDescription
query *string
countrycodes
limitinteger

reverse_geocode

Reverse geocode coordinates to the nearest address or place. Returns a structured address and display name.

ParameterTypeDescription
lat *number
lon *number
zoominteger

build_overpass_query

Build a safe Overpass QL query string (no network call). area can be: - A bbox: [south, west, north, east] - A place name like "Dhaka, Bangladesh" (resolved via geocoding first) - A GeoJSON polygon string (will be serialized as poly) tags are OSM tag key-value pairs, e.g., {"amenity": "hospital"}. element_types: ["node", "way", "relation"] (default: all three).

ParameterTypeDescription
area *
tags *object
element_types

osm_features

Find OSM features matching tags within an area. area: bbox [s,w,n,e] as JSON string, place name string, or GeoJSON polygon. tags: JSON object of OSM tag key-value pairs, e.g., '{"amenity":"hospital"}'. Returns a GeoJSON FeatureCollection. Features: - Automatic bbox splitting for large areas (avoids Overpass limits) - Shared HTTP retry transport - Result validation and warnings

ParameterTypeDescription
area *string
tags *string
limitinteger

overpass_query

Execute a raw Overpass QL query and return results as a GeoJSON FeatureCollection. Power-user escape hatch — use build_overpass_query for safe query construction.

ParameterTypeDescription
ql_string *string
limitinteger

route

Compute a route between waypoints. coordinates: JSON array of [lon, lat] pairs (at least 2). profile: "driving", "walking", or "cycling". Returns distance (metres), duration (seconds), and the route geometry as GeoJSON.

ParameterTypeDescription
coordinates *
profilestring

route_matrix

Compute a duration/distance matrix between source and destination points. sources: JSON array of [lon, lat] source locations. destinations: JSON array of [lon, lat] destination locations. profile: "driving", "walking", or "cycling". Returns {durations: [[s]], distances: [[m]]}.

ParameterTypeDescription
destinations *
sources *
profilestring

nearest_road

Snap a coordinate to the nearest road. Returns {lat, lon, name} of the nearest road.

ParameterTypeDescription
lat *number
lon *number
profilestring

elevation

Get elevation (metres above sea level) for a coordinate. Uses the Open-Elevation public API (free, no key required). Returns {lat, lon, elevation_m}.

ParameterTypeDescription
lat *number
lon *number

elevation_profile

Get elevation at multiple points along a path. coordinates: JSON array of [lon, lat] pairs. Returns a list of {lat, lon, elevation_m} for each point.

ParameterTypeDescription
coordinates *string

isochrone

Compute an isochrone (reachable area) from a point. Args: lat: Latitude of the starting point. lon: Longitude of the starting point. range_value: Range limit. For time: seconds (default 300 = 5 min). For distance: metres (default 300 m). range_type: "time" (seconds) or "distance" (metres). profile: Routing profile. Options: "driving-car", "driving-hgv", "foot-walking", "foot-hiking", "cycling-regular", "cycling-road", "cycling-mountain", "cycling-electric", "wheelchair". Returns:…

ParameterTypeDescription
lat *number
lon *number
profilestring
range_typestring
range_valuenumber

vector_info

Get metadata about a vector file (Shapefile, GeoJSON, GeoPackage, etc.). Returns: {driver, crs, feature_count, geometry_types, fields, bbox, layers}.

ParameterTypeDescription
path *string

vector_read

Read features from a vector file as a GeoJSON FeatureCollection. Supports optional bounding box and attribute filters.

ParameterTypeDescription
path *string
bbox
layer
limitinteger
where

raster_info

Get metadata about a raster file. Returns: {crs, bands, width, height, bounds, res, nodata, dtype}.

ParameterTypeDescription
path *string

zonal_stats

Compute zonal statistics for polygon zones against a raster. stats: list of stat names, e.g. ["min", "max", "mean", "count"]. Returns a list of dicts, one per zone.

ParameterTypeDescription
raster_path *string
zones_geojson *string
stats

sample_raster

Sample raster values at point locations. points_geojson: GeoJSON Point or MultiPoint geometry. Returns a list of point coordinates and sampled values.

ParameterTypeDescription
path *string
points_geojson *string

build_spatial_index

Build a Shapely STRtree spatial index for a GeoJSON FeatureCollection.

ParameterTypeDescription
geojson_collection *string

spatial_query

Query a GeoJSON FeatureCollection using spatial predicates.

ParameterTypeDescription
geojson_collection *string
query_geojson *string
predicatestring

spatial_join

Join point features to the first polygon that contains each point.

ParameterTypeDescription
points_geojson *string
polygons_geojson *string

cached_geocode

Geocode an address and cache the result in memory for this server process.

ParameterTypeDescription
address *string
limitinteger

batch_geocode

Geocode multiple addresses with cache metadata for each item.

ParameterTypeDescription
addresses *array
limitinteger

nearest_neighbor

Find the nearest features to a query geometry.

ParameterTypeDescription
candidates_geojson *string
query_geojson *string
kinteger

repair_geometry

Repair an invalid geometry using Shapely's zero-width buffer fallback.

ParameterTypeDescription
geojson *string

validate_geometry

Validate a geometry and report issues that a caller can act on.

ParameterTypeDescription
geojson *string

static_map

Render GeoJSON as a base64-encoded PNG.

ParameterTypeDescription
geojson *string
center
heightinteger
stylestring
widthinteger
zoom

save_map

Render GeoJSON and save it as a PNG file.

ParameterTypeDescription
geojson *string
output_path *string
heightinteger
stylestring
widthinteger

workspace_store

Store JSON data for later use in this server process.

ParameterTypeDescription
data *string
name *string
description

workspace_get

Retrieve a stored item by name.

ParameterTypeDescription
name *string

workspace_list

List stored workspace items.

workspace_clear

Clear one stored item, or the entire workspace when no name is provided.

ParameterTypeDescription
name

workspace_rename

Rename a stored workspace item.

ParameterTypeDescription
new_name *string
old_name *string

suggest_tools

Suggest relevant tools for a natural-language geospatial task.

ParameterTypeDescription
task_description *string
context

list_all_tools

Return the full tool catalog grouped by category.