GIS MCP Server

Integrations

  • Planned integration with GDAL/OGR for expanded GIS capabilities including raster operations and advanced spatial analysis.

  • Leverages Python GIS libraries (Shapely and PyProj) to provide geometric operations, coordinate transformations, and geodetic calculations for AI assistants.

GIS MCP 服务器

模型上下文协议 (MCP) 服务器实现,使用 GIS 库(当前支持 Shapely 和 PyProj)将大型语言模型 (LLM) 连接到 GIS 操作,使 AI 助手能够执行地理空间操作和转换。

阿尔法

0.2.0(Alpha)版本正在积极开发中。我们欢迎各位贡献代码并加入我们,共同构建这个项目。

🎥 演示

📋 目录

🚀 功能

  • 🔍 全面的几何运算(交集、并集、缓冲等)
  • 🌐 高级坐标变换和投影
  • 📏 精确的距离和面积计算
  • 🗺️ 空间分析和验证
  • 🛠️ 轻松与 MCP 兼容客户端集成

📋 先决条件

  • Python 3.10 或更高版本
  • MCP 兼容客户端(如 Claude Desktop 或 Cursor)
  • 用于软件包安装的互联网连接

🛠️ 安装

选择最适合您需要的安装方法:

📦pip安装

建议大多数用户使用 pip 安装:

  1. 安装 uv 包管理器:
pip install uv
  1. 创建虚拟环境(Python 3.10+):
uv venv --python=3.10
  1. 安装软件包:
uv pip install gis-mcp
  1. 启动服务器:
gis-mcp
pip 配置

要使用 Claude 或 Cursor 的 pip 安装,请添加以下配置:

克劳德桌面:

视窗:

{ "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 (创建.cursor/mcp.json ):

视窗:

{ "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": [] } } }

配置后:

  1. 确保将YourUsername替换为您的实际用户名
  2. 对于开发安装,请将/path/to/gis-mcp替换为项目的实际路径
  3. 重新启动 IDE 以应用更改
  4. 您现在可以通过 Claude 或 Cursor 使用所有 GIS 操作!

🛠️ 开发安装

对于贡献者和开发者:

  1. 安装 uv 包管理器:
pip install uv
  1. 创建虚拟环境:
uv venv --python=3.10
  1. 以开发模式安装包:
uv pip install -e .
  1. 启动服务器:
python -m gis_mcp
开发配置

要使用 Claude 或 Cursor 的开发安装,请添加以下配置:

克劳德桌面:

视窗:

{ "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 (创建.cursor/mcp.json ):

视窗:

{ "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"] } } }

配置后:

  1. 确保将YourUsername替换为您的实际用户名
  2. 对于开发安装,请将/path/to/gis-mcp替换为项目的实际路径
  3. 重新启动 IDE 以应用更改
  4. 您现在可以通过 Claude 或 Cursor 使用所有 GIS 操作!

🛠️ 可用工具

Shapely 操作

基本操作
工具描述
buffer使用可自定义的参数在几何体周围创建缓冲区
intersection查找两个几何体的交集
union组合两个几何体
difference寻找几何图形之间的差异
symmetric_difference查找几何之间的对称差异
几何特性
工具描述
convex_hull计算几何体的凸包
envelope获取几何体的边界框
minimum_rotated_rectangle获取几何体的最小旋转矩形
get_centroid获取几何体的质心
get_bounds获取几何体的边界
get_coordinates获取几何体的坐标
get_geometry_type获取几何体的类型
变换
工具描述
rotate_geometry以指定的角度和原点旋转几何体
scale_geometry使用 x 和 y 因子缩放几何体
translate_geometry使用 x、y 和 z 偏移平移几何体
高级操作
工具描述
triangulate_geometry创建几何体的三角剖分
voronoi根据点创建 Voronoi 图
unary_union_geometries创建多个几何体的联合
测量
工具描述
get_length获取几何的长度
get_area获取几何体的面积
验证和简化
工具描述
is_valid检查几何是否有效
make_valid使几何有效
simplify简化具有指定公差的几何体

PyProj 操作

坐标变换
工具描述
transform_coordinates在 CRS 之间转换坐标
project_geometry在 CRS 之间投影几何体
CRS信息
工具描述
get_crs_info获取有关 CRS 的详细信息
get_available_crs获取所有可用 CRS 的列表
get_utm_zone获取给定坐标的 UTM 区域
get_utm_crs获取给定坐标的 UTM CRS
get_geocentric_crs获取给定坐标的地心 CRS
大地测量计算
工具描述
get_geod_info获取有关大地测量计算的信息
calculate_geodetic_distance计算点之间的大地距离
calculate_geodetic_point计算给定距离和方位角的点
calculate_geodetic_area使用大地测量计算多边形的面积

🛠️ 客户端开发

工具使用示例:

缓冲区操作

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

坐标变换

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

大地距离

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

🔮 计划功能

  • 添加对更多 GIS 库的支持 - GDAL/OGR
  • 实施高级空间索引
  • 添加对光栅操作的支持
  • 实现网络分析功能
  • 添加对 3D 几何体的支持
  • 实施性能优化

🤝 贡献

欢迎您贡献力量!您可以通过以下方式提供帮助:

  1. 分叉存储库
  2. 创建功能分支( git checkout -b feature/AmazingFeature
  3. 提交您的更改( git commit -m 'Add some AmazingFeature'
  4. 推送到分支( git push origin feature/AmazingFeature
  5. 打开拉取请求

请确保您的 PR 描述清晰地描述了问题和解决方案。如适用,请包含相关的问题编号。

📄 许可证

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

🔗 相关项目

📞 支持

如需支持,请在 GitHub 存储库中打开一个问题。

🏆 徽章

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器将 LLM 连接到 GIS 操作,使 AI 助手能够执行精确的地理空间分析,包括几何运算、坐标变换和空间测量。

  1. 🎥 演示
    1. 📋 目录
      1. 🚀 功能
        1. 📋 先决条件
          1. 🛠️ 安装
            1. 📦pip安装
            2. 🛠️ 开发安装
          2. 🛠️ 可用工具
            1. Shapely 操作
            2. PyProj 操作
          3. 🛠️ 客户端开发
            1. 缓冲区操作
            2. 坐标变换
            3. 大地距离
          4. 🔮 计划功能
            1. 🤝 贡献
              1. 📄 许可证
                1. 🔗 相关项目
                  1. 📞 支持
                    1. 🏆 徽章

                      Related MCP Servers

                      • A
                        security
                        A
                        license
                        A
                        quality
                        A Model Context Protocol server that provides LLM Agents with a comprehensive toolset for IP geolocation, network diagnostics, system monitoring, cryptographic operations, and QR code generation.
                        Last updated -
                        16
                        3
                        4
                        TypeScript
                        Apache 2.0
                      • A
                        security
                        A
                        license
                        A
                        quality
                        A Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.
                        Last updated -
                        13
                        2
                        TypeScript
                        MIT License
                      • A
                        security
                        A
                        license
                        A
                        quality
                        A Model Context Protocol server that provides Google Maps API integration, allowing users to search locations, get place details, geocode addresses, calculate distances, obtain directions, and retrieve elevation data through LLM processing capabilities.
                        Last updated -
                        7
                        43
                        15
                        TypeScript
                        MIT License
                      • -
                        security
                        F
                        license
                        -
                        quality
                        A Model Context Protocol server that connects LLMs to the Compiler Explorer API, enabling them to compile code, explore compiler features, and analyze optimizations across different compilers and languages.
                        Last updated -
                        Python

                      View all related MCP servers

                      ID: irl5u9uw6f