icon for mcp server

GIS

STDIO

MCP server connecting LLMs to GIS operations for spatial analysis and transformations

GIS MCP Server

✨ Want to perform accurate geospatial analysis in your chatbot? ✨

Install GIS-MCP and transform your AI's spatial capabilities!


GIS MCP Server Logo

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.

Alpha

Version 0.3.0 (Alpha) is under active development. We welcome contributions and developers to join us in building this project.

🎥 Demo

GIS MCP Server Demo

Rasterio Demo

📋 Table of Contents

🚀 Features

  • 🔍 Comprehensive geometric operations (intersection, union, buffer, etc.)
  • 🌐 Advanced coordinate transformations and projections
  • 📏 Precise distance and area calculations
  • 🗺️ Spatial analysis and validation
  • 🛠️ Easy integration with MCP-compatible clients

📋 Prerequisites

  • Python 3.10 or higher
  • MCP-compatible client (like Claude Desktop or Cursor)
  • Internet connection for package installation

🛠️ Installation

Choose the installation method that best suits your needs:

Installing via Smithery

To install GIS MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @mahdin75/gis-mcp --client claude

📦 pip Installation

The pip installation is recommended for most users:

  1. Install uv package manager:
pip install uv
  1. Create the Virtual Environment (Python 3.10+):
uv venv --python=3.10
  1. Install the package:
uv pip install gis-mcp
  1. Start the server:
gis-mcp

pip Configuration

To use the pip installation with Claude or Cursor, add the following configuration:

Claude Desktop:

Windows:

{ "mcpServers": { "gis-mcp": { "command": "C:\\Users\\YourUsername\\.venv\\Scripts\\gis-mcp", "args": [] } } }

Linux/Mac:

{ "mcpServers": { "gis-mcp": { "command": "/home/YourUsername/.venv/bin/gis-mcp", "args": [] } } }

Cursor IDE (create .cursor/mcp.json):

Windows:

{ "mcpServers": { "gis-mcp": { "command": "C:\\Users\\YourUsername\\.venv\\Scripts\\gis-mcp", "args": [] } } }

Linux/Mac:

{ "mcpServers": { "gis-mcp": { "command": "/home/YourUsername/.venv/bin/gis-mcp", "args": [] } } }

After configuration:

  1. Make sure to replace YourUsername with your actual username
  2. For development installation, replace /path/to/gis-mcp with the actual path to your project
  3. Restart your IDE to apply the changes
  4. You can now use all GIS operations through Claude or Cursor!

🛠️ Development Installation

For contributors and developers:

  1. Install uv package manager:
pip install uv
  1. Create the Virtual Environment:
uv venv --python=3.10
  1. Install the package in development mode:
uv pip install -e .
  1. Start the server:
python -m gis_mcp

Development Configuration

To use the development installation with Claude or Cursor, add the following configuration:

Claude Desktop:

Windows:

{ "mcpServers": { "gis-mcp": { "command": "C:\\path\\to\\gis-mcp\\.venv\\Scripts\\python", "args": ["-m", "gis_mcp"] } } }

Linux/Mac:

{ "mcpServers": { "gis-mcp": { "command": "/path/to/gis-mcp/.venv/bin/python", "args": ["-m", "gis_mcp"] } } }

Cursor IDE (create .cursor/mcp.json):

Windows:

{ "mcpServers": { "gis-mcp": { "command": "C:\\path\\to\\gis-mcp\\.venv\\Scripts\\python", "args": ["-m", "gis_mcp"] } } }

Linux/Mac:

{ "mcpServers": { "gis-mcp": { "command": "/path/to/gis-mcp/.venv/bin/python", "args": ["-m", "gis_mcp"] } } }

After configuration:

  1. Make sure to replace YourUsername with your actual username
  2. For development installation, replace /path/to/gis-mcp with the actual path to your project
  3. Restart your IDE to apply the changes
  4. You can now use all GIS operations through Claude or Cursor!

🛠️ Available Tools

Shapely Operations

Basic Operations

ToolDescription
bufferCreate a buffer around geometries with customizable parameters
intersectionFind intersection of two geometries
unionCombine two geometries
differenceFind difference between geometries
symmetric_differenceFind symmetric difference between geometries

Geometric Properties

ToolDescription
convex_hullCalculate convex hull of a geometry
envelopeGet bounding box of a geometry
minimum_rotated_rectangleGet minimum rotated rectangle of a geometry
get_centroidGet the centroid of a geometry
get_boundsGet the bounds of a geometry
get_coordinatesGet the coordinates of a geometry
get_geometry_typeGet the type of a geometry

Transformations

ToolDescription
rotate_geometryRotate a geometry with specified angle and origin
scale_geometryScale a geometry with x and y factors
translate_geometryTranslate a geometry with x, y, and z offsets

Advanced Operations

ToolDescription
triangulate_geometryCreate a triangulation of a geometry
voronoiCreate a Voronoi diagram from points
unary_union_geometriesCreate a union of multiple geometries

Measurements

ToolDescription
get_lengthGet the length of a geometry
get_areaGet the area of a geometry

Validation and Simplification

ToolDescription
is_validCheck if a geometry is valid
make_validMake a geometry valid
simplifySimplify a geometry with specified tolerance

PyProj Operations

Coordinate Transformations

ToolDescription
transform_coordinatesTransform coordinates between CRS
project_geometryProject a geometry between CRS

CRS Information

ToolDescription
get_crs_infoGet detailed information about a CRS
get_available_crsGet list of all available CRS
get_utm_zoneGet UTM zone for given coordinates
get_utm_crsGet UTM CRS for given coordinates
get_geocentric_crsGet geocentric CRS for given coordinates

Geodetic Calculations

ToolDescription
get_geod_infoGet information about a geodetic calculation
calculate_geodetic_distanceCalculate geodetic distance between points
calculate_geodetic_pointCalculate point at given distance and azimuth
calculate_geodetic_areaCalculate area of a polygon using geodetic calculations

GeoPandas Operations

I/O Operations

ToolDescription
read_file_gpdRead a geospatial file and return stats and data preview
to_file_gpdWrite a GeoDataFrame to a file

Join Operations

ToolDescription
append_gpdConcatenate two GeoDataFrames vertically
merge_gpdPerform database-style joins between GeoDataFrames

Rasterio Operations

Basic Raster Operations

ToolDescription
metadata_rasterGet metadata from a raster dataset
get_raster_crsRetrieve the CRS of a raster dataset
extract_bandExtract a specific band from a multi-band raster
raster_band_statisticsCalculate statistics (min, max, mean, std) for each band
raster_histogramCompute histogram of pixel values for each band

Raster Processing

ToolDescription
clip_raster_with_shapefileClip a raster using polygons from a shapefile
resample_rasterResample a raster by a scale factor
reproject_rasterReproject a raster to a new CRS
tile_rasterSplit a raster into square tiles

Raster Analysis

ToolDescription
compute_ndviCalculate Normalized Difference Vegetation Index
raster_algebraPerform algebraic operations on raster bands
concat_bandsCombine multiple single-band rasters into one multi-band raster
weighted_band_sumCompute weighted sum of all bands in a raster

🛠️ Client Development

Example usage of the tools:

Buffer Operation

Tool: buffer Parameters: { "geometry": "POINT(0 0)", "distance": 10, "resolution": 16, "join_style": 1, "mitre_limit": 5.0, "single_sided": false }

Coordinate Transformation

Tool: transform_coordinates Parameters: { "coordinates": [0, 0], "source_crs": "EPSG:4326", "target_crs": "EPSG:3857" }

Geodetic Distance

Tool: calculate_geodetic_distance Parameters: { "point1": [0, 0], "point2": [10, 10], "ellps": "WGS84" }

🔮 Planned Features

  • Add support for more GIS libraries - GDAL/OGR
  • Implement advanced spatial indexing
  • Add support for raster operations
  • Implement network analysis capabilities
  • Add support for 3D geometries
  • Implement performance optimizations

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please ensure your PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Related Projects

  • Model Context Protocol - The core MCP implementation
  • Shapely - Python package for manipulation and analysis of geometric objects
  • PyProj - Python interface to PROJ library
  • GeoPandas - Python package for working with geospatial data
  • Rasterio - Python package for reading and writing geospatial raster data

📞 Support

For support, please open an issue in the GitHub repository.

💬 Community

Join our Discord community for discussions, updates, and support:

Join our Discord

👥 Contributors

Made with contrib.rocks.


🏆 Badges

Be the First to Experience MCP Now