A Model Context Protocol (MCP) server implementation that connects Large Language Models (LLMs) to GIS operations using GIS libraries, enabling AI assistants to perform geospatial operations and transformations.
Configuration
View docs{
"mcpServers": {
"mahdin75-gis-mcp": {
"url": "http://localhost:9010/mcp"
}
}
}GIS MCP Server lets you connect large language models to geospatial libraries, enabling AI assistants to perform GIS operations like geometry creation, coordinate transforms, raster processing, and spatial analyses. It supports HTTP/SSE transport for remote access and STDIO transport for local development, making spatial reasoning an integrated part of your AI workflows.
You connect an MCP-compatible client (such as Claude Desktop or Cursor IDE) to the GIS MCP Server to perform geospatial tasks in your AI conversations. Choose HTTP transport for network deployments or STDIO transport for local development.
In HTTP mode, you send requests to the MCP endpoint at http://host:port/mcp and use the serverโs storage endpoints to upload and download files. In STDIO mode, you start a local process that listens for MCP messages on standard input/output. You can perform operations like calculating distances, transforming coordinates, clipping data, generating buffers, and creating static or interactive maps by issuing tool calls from your assistant.
Practical usage patterns include: setting up a local development session, starting the server in STDIO mode, and then issuing geospatial tool calls from your AI agent. When running remotely, ensure network access to the serverโs HTTP endpoint and use the provided storage endpoints for any file transfers.
Prerequisites you need before installing the GIS MCP Server: Python 3.10 or higher, an MCP-compatible client, and an internet connection for package installation.
Docker Installation. Build and run the server in an isolated container environment.
1) Build the Docker image using the provided Dockerfile.
docker build -t gis-mcp .2) Run the container with HTTP transport enabled by default on port 9010.
docker run -p 9010:9010 gis-mcpDockerfile.local option lets you install from local source files for development or custom builds.
1) Build the local image.
docker build -f Dockerfile.local -t gis-mcp:local .2) Run the container in HTTP mode.
docker run -p 9010:9010 gis-mcp:localpip Installation. Install via Pythonโs package manager and run the server in STDIO or HTTP mode.
1) Install the UV package manager.
pip install uv2) Create a Python virtual environment (Python 3.10+).
uv venv --python=3.103) Activate the environment.
Windows PowerShell: .
venv\Scripts\Activate.ps1
Linux/macOS: source .venv/bin/activate
4) Install the GIS MCP package.
uv pip install gis-mcpInstall with visualization features (optional). Adds interactive map support.
uv pip install gis-mcp[visualize]5) Start the server in STDIO transport mode by default.
gis-mcpTo run in HTTP transport mode, set environment variables and start the server.
export GIS_MCP_TRANSPORT=http
export GIS_MCP_PORT=8080
gis-mcpIf you want to start the server directly using Python for development, you can also run it as a module.
python -m gis_mcpClient configuration hints. When using Claude Desktop or Cursor IDE, configure the MCP server endpoints to point at the running server. Use the HTTP URL for remote deployments or the STDIO command for local development.
HTTP transport endpoints (example). MCP URL for the HTTP transport is http://host:port/mcp. Storage endpoints allow uploading and downloading files.
Ensure your HTTP endpoint is secured if exposed publicly. When using local development, prefer STDIO transport to avoid network exposure. Manage storage access carefully and use least-privilege permissions for any uploaded data.
Start in STDIO mode during development with python -m gis_mcp or gis-mcp if installed via pip. Switch to HTTP transport by exporting GIS_MCP_TRANSPORT and GIS_MCP_PORT before launching in production.
Create a buffer around a geometry with configurable distance and resolution.
Compute the geometric intersection of two geometries.
Combine two geometries into their union.
Transform coordinates between coordinate reference systems.
Retrieve detailed CRS information.
Read a geospatial file into a GeoDataFrame with a preview.
Clip geometries using a polygon or other geometry.
Calculate NDVI from raster data.
Download GADM boundaries as GeoJSON.
Download climate data sets such as ERA5.
Retrieve taxonomic information for a species.
Download a street network for a place and save as GraphML.
Generate a static map from multiple layers with legend and grid options.
Create an interactive web map with layers and controls.
Read raster data and extract band information or statistics.
Clip a raster using a vector shapefile.
Compute distance on the ellipsoid between two points.
Compute local Moran's I for spatial autocorrelation.
Create spatial weights from a shapefile.