Skip to main content
Glama

glacier-mcp

MCP server for interactive glacier mapping.

Renders a GeoTIFF in OpenLayers, lets you draw and edit polygons with the mouse, and exposes every vertex to an AI agent via MCP tools (get / move / add / delete). Exports the final geometry to a shapefile with a correct .prj.

Why

Existing GIS tools (ArcGIS Pro, QGIS) can be automated via MCP, but none of them give an AI agent direct, per-vertex control over geometry while you edit the same geometry with your mouse. This project fills that gap: the map and the agent share the same polygon state.

Related MCP server: lunar

Architecture

+----------------+     WebSocket      +-------------------+     MCP      +-------+
|  OpenLayers UI | <----------------> |  FastAPI backend  | <----------> | Agent |
|  (your mouse)  |                    |  (state + geom)   |              | (LLM) |
+----------------+                    +-------------------+              +-------+
  • Backend: Python 3.11, FastAPI, mcp SDK, uvicorn, shapely, pyproj.

  • Frontend: OpenLayers 10, vanilla JS.

  • I/O: rasterio (GeoTIFF), geopandas (shapefile).

  • Bridge: WebSocket (frontend <-> backend), MCP streamable-http (agent <-> backend).

Two ports, one process:

  • http://localhost:8765 - interactive map (open in browser)

  • http://localhost:8766 - MCP endpoint (connect your MCP client here)

Both share one PolygonState instance, so a vertex moved by the agent appears in the browser and vice versa.

Quick start

pip install -r requirements.txt
python -m glacier_mcp

Then:

  1. Open http://localhost:8765

  2. Draw a polygon with the mouse (OpenLayers Draw interaction)

  3. Drag a vertex (OpenLayers Modify interaction)

  4. Connect your MCP client (Claude Desktop / Cursor / DeepSeek++ / etc.) to http://localhost:8766

  5. Ask the agent: "move the western boundary 50 meters east"

The polygon in the browser updates as the agent edits.

MCP tools

Tool

What it does

get_polygon

Return current polygon as GeoJSON

get_vertices

Return vertex list with indices

move_vertex

Move a vertex by index and offset (dx, dy)

add_vertex

Insert a vertex at a position

delete_vertex

Remove a vertex by index

translate_polygon

Move the whole polygon by (dx, dy)

smooth_polygon

Apply smoothing to the boundary

undo / redo

Step through the edit history

export_shapefile

Save to .shp + .shx + .dbf + .prj + .cpg (commit 5)

Status

  • Commit 1: skeleton, README, LICENSE, pyproject, CI

  • Commit 2: geometry + state (shapely, undo/redo)

  • Commit 3: MCP server with 9 tools

  • Commit 4: FastAPI map server + WebSocket bridge + OpenLayers UI

  • Commit 5: GeoTIFF loading, shapefile export with .prj

License

MIT - see LICENSE.

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    A
    maintenance
    An MCP server that enables AI assistants to directly control QGIS for tasks like layer management, feature editing, and map rendering. It provides a suite of 50 tools to execute processing algorithms and manage GIS projects through natural language commands.
    125
    380
    GPL 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Browser-based geometry processing server that enables AI agents to create geometry, run analysis and operators, inspect results, and take screenshots via MCP.
    12 npm
    6
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    MCP server that enables LLMs to create and control interactive MapLibre maps by placing markers, drawing paths, and rendering polygons directly in Claude Desktop.
    1
    -
  • F
    license
    A
    quality
    D
    maintenance
    Enables users to draw GIS geometry on an interactive map and get clean, validated GeoJSON to hand off to other GIS MCP servers such as FEMA flood screening and USGS hydrography.
    3
    -