mcp-server-gis-helper
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-gis-helper draw a polygon on the map for the flood zone screening"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-gis-helper
An MCP server that lets a user draw GIS geometry on an interactive map and returns clean, validated GeoJSON — ready to hand off to other GIS MCP servers such as FEMA NFHL flood screening or USGS National Map hydrography.
It solves the "how do I generate a complex shape and pass it to the geometry-based tools?" problem: instead of hand-typing coordinates, the user sketches a polygon, line, or point on a Leaflet map and gets back a compact GeoJSON string.
This server does not query flood/waterway services itself. It only produces and validates geometry; the agent passes that geometry to the downstream tools.
Tools
Tool | Purpose |
| Interactive entry point. Returns a Prefab MCP App with a link to a browser drawing map and a "Load drawn geometry" button. Optional |
| Retrieves the shape the user drew and saved on the map for a given |
| Validates/normalizes an arbitrary GeoJSON string you already have (no map needed). Closes polygon rings, checks WGS84 ranges, unwraps Feature/FeatureCollection. |
All geometry is WGS84 decimal degrees in GeoJSON [lon, lat] order. Supported
types: Point, MultiPoint, LineString, MultiLineString, Polygon,
MultiPolygon, plus the BoundingBox shorthand
({"type": "BoundingBox", "bbox": [minLon, minLat, maxLon, maxLat]}) — exactly what
the FEMA/USGS tools accept.
Related MCP server: GISGP GIS Tools
How it works (the map bridge)
Prefab's Embed renders a sandboxed iframe whose content cannot write back into
Prefab state, so the drawing map cannot live purely inside the MCP app. Instead a
small companion HTTP "map bridge" (Starlette) serves the Leaflet + Leaflet.draw
page:
gis_open_mapcreates a draw session and returns a Prefab app with a link to<public_url>/map?session=<id>.The user opens that link in a browser, draws one shape, and clicks Save. The page
POSTs the GeoJSON to<public_url>/session/<id>/geometry, where it's validated and stored in an in-memory session store.gis_get_drawn_geometryreads the stored geometry out of the shared store and returns it as a compact GeoJSON string.The agent passes that string to
nfhl_screen_flood_zone,hydro_find_waterways, etc.
Transports (mirrors the sibling GIS servers)
stdio (local MCP clients like Claude Desktop/Code): MCP runs over stdio and the map bridge is started on a
localhostdaemon thread (default127.0.0.1:8765).HTTP (deployed / containerized): when
PORT(orDATABRICKS_APP_PORT) is set, MCP is served at/mcpand the bridge routes (/map,/session/{id}/geometry,/health) are mounted onto the same port.
Configuration (all optional)
Env var | Default | Purpose |
|
| Bridge bind host (stdio mode) |
|
| Bridge port (stdio mode) |
|
| Origin the browser uses to reach the bridge (set behind a proxy/container) |
| OpenStreetMap | Leaflet basemap tile URL template |
| OSM | Tile attribution string |
| — | If set, selects HTTP transport for MCP |
Copy .env.example to .env for local overrides.
Running
uv sync
# stdio (local MCP client)
uv run python main.py
# HTTP (deployed)
PORT=8080 uv run python main.pyExample workflow
User: I want to screen a project area for FEMA flood zones.
Agent: (calls gis_open_map centered on the site)
User: (draws a polygon on the map, clicks Save, clicks "Load drawn geometry")
Agent: (gis_get_drawn_geometry -> geometry string)
Agent: (passes geometry to nfhl_screen_flood_zone)If the user already has coordinates, skip the map and use gis_validate_geometry
to clean them up before querying downstream.
Project layout
src/gis_helper_mcp/
├── app.py # FastMCP init, instructions, transport, bridge startup
├── models.py # dataclasses (DrawSession, GeometrySummary) + constants
├── utils.py # GeoJSON validation/normalization, summaries, session store, config
├── bridge.py # Starlette map-bridge routes + runners
├── static/
│ └── map.html # Leaflet + Leaflet.draw drawing page (CDN assets)
└── tools/
├── __init__.py # register_tools(mcp)
├── open_map.py # gis_open_map (Prefab app)
├── get_drawn_geometry.py # gis_get_drawn_geometry
└── validate_geometry.py # gis_validate_geometryAvailable Tools
3 toolsgis_get_drawn_geometryGet Geometry Drawn on the MapARead-onlyIdempotent
Retrieve the geometry a user drew and saved on the interactive map.
Call this after gis_open_map once the user has drawn a shape and clicked "Save" on the map page. Geometry stored by the map is already validated and normalized (WGS84, closed rings). The returned "geometry" string can be passed directly to nfhl_screen_flood_zone, hydro_find_waterways, and other geometry-accepting GIS tools.
Use when: "I drew a shape, get it", or wired to the "Load drawn geometry" button inside the gis_open_map app.
session_id handling:
If you know the exact id from the latest gis_open_map result, pass it.
If you don't have it (e.g. a later turn), OMIT session_id entirely and the most recently saved geometry is returned. Never pass a placeholder like "default" — that will fail.
Returns when a shape has been saved: { "ready": true, "session_id": str, # the resolved session id "geometry": str, # compact GeoJSON string, ready to paste downstream "summary": { geo_type, crs_epsg, vertex_count, part_count, bbox, ... } }
Returns when nothing has been saved yet: { "ready": false, "message": "No geometry saved yet ..." }
Error responses:
{"ready": false, "error": "Unknown or expired session ..."} — bad session_id.
Inputs: session_id. Returns: object
gis_open_mapOpen Interactive Map to Draw GeometryARead-only
Open an interactive map so the user can draw GIS geometry, then capture it.
Returns a Prefab app with (1) a link that opens a Leaflet drawing page in the browser and (2) a "Load drawn geometry" button. Workflow:
Call this tool (optionally center it with lat/lon/zoom).
The user clicks "Open drawing map", draws a polygon/line/point, clicks Save.
The user clicks "Load drawn geometry" (or you call gis_get_drawn_geometry with the session_id) to retrieve a compact GeoJSON string.
Pass that GeoJSON to nfhl_screen_flood_zone, hydro_find_waterways, etc.
Use when: "let me draw a shape / area on a map", "I want to sketch a polygon". Don't use when: the user already has coordinates (use gis_validate_geometry).
The returned app also surfaces the session_id in text so the agent can call gis_get_drawn_geometry directly if the user prefers not to click the button.
Inputs: lat, lon, zoom.
gis_validate_geometryValidate & Normalize GeoJSON GeometryARead-onlyIdempotent
Validate and normalize a GeoJSON geometry string for use with GIS servers.
Checks that the geometry is a supported type with valid WGS84 [lon, lat] coordinates, unwraps Feature/FeatureCollection wrappers, and closes any unclosed polygon rings. Returns a compact, single-line GeoJSON string that can be passed directly to the FEMA NFHL (nfhl_screen_flood_zone) or USGS National Map (hydro_find_waterways, etc.) tools.
Use when: you already have coordinates/GeoJSON and want to confirm it's valid and correctly formatted before querying another GIS server. Don't use when: you want to draw a shape interactively (use gis_open_map).
Returns on success: { "valid": true, "geometry": str, # compact GeoJSON string, ready to paste downstream "summary": { # geo_type, crs_epsg, vertex_count, part_count, ... # bbox [minLon,minLat,maxLon,maxLat], approx area/length } }
Error responses:
{"valid": false, "error": "..."} — invalid JSON, unsupported type, out-of-range coordinate (e.g. swapped lat/lon), or malformed BoundingBox.
Inputs: geometry (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct role in the workflow: gis_open_map initiates an interactive drawing session, gis_get_drawn_geometry retrieves the result, and gis_validate_geometry validates an existing GeoJSON string. There is no overlap in purpose, and the 'Use when' conditions clearly separate them.
All tool names follow a consistent 'gis_' prefix followed by a verb_noun pattern: open_map, get_drawn_geometry, validate_geometry. The naming is uniform, snake_case, and each verb clearly indicates the action.
Three tools is well-scoped for a GIS helper that focuses on geometry capture and validation. The count falls within the ideal 3-15 range, and each tool is necessary for the core workflow without redundancy.
The toolset covers the entire lifecycle of preparing user-drawn geometry for downstream GIS servers: open a map to draw, retrieve the drawn geometry, and validate/normalize it. There are no obvious gaps; session handling is gracefully managed by omitting the session ID, and the output is directly usable.
Maintenance
Related MCP Connectors
Ask in plain English, get a rendered, shareable map from live public data. 24 geospatial tools.
FCC public geo/census APIs (geo.fcc.gov) MCP.
Remote MCP for Dutch KLIC-melding utility data, maps, and dig-safe workflows.
Geospatial workspace: manage sources and maps, run spatial analysis, and publish interactive maps
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceBrowser-based geometry processing server that enables AI agents to create geometry, run analysis and operators, inspect results, and take screenshots via MCP.6-
- AlicenseNot gradedqualityDmaintenanceFree remote MCP server for GIS/ArcGIS Online automation — coordinate/EPSG conversion, GeoJSON validation and geometry operations, ArcGIS FeatureServer inspection (feature count/query, schema, health check), and Shapefile/KML/GPX/WKT format conversion. Works with public ArcGIS layers without a token;1MIT
- AlicenseNot gradedqualityBmaintenanceEnables interactive glacier mapping by rendering GeoTIFFs in a browser map where users can draw and edit polygons, while AI agents access and manipulate every vertex through MCP tools. Supports exporting the resulting geometry to shapefile.MIT
- AlicenseNot gradedqualityCmaintenanceEnables desktop agents and clients to access geospatial services via a hosted MCP server, including OpenStreetMap queries, address and business search, POI discovery, routing, matrices, isochrones, map matching, optimization, elevation and terrain, basemap styling, spatial analysis, rendering, usage, and service status.32 npmMIT