GeoSource-MCP

面向全球 GIS 空间服务与图层目录的 MCP 数据检索接口,收录 2,198+ 空间端点(WMS、WMTS、XYZ、ArcGIS REST、STAC),支持智能搜索与一键加载上图

Documentation

GeoSource MCP 🌍

A Model Context Protocol (MCP) Server for Global GIS Services & Spatial Layers
面向全球 GIS 空间服务与图层目录的 MCP 标准数据检索接口

English • 中文说明

MCP Glama Approved Python License Services Verified Layers


🌐 English

Overview

GeoSource MCP is an open-source Model Context Protocol (MCP) server providing structured access to an indexed catalog of 2,198 global GIS spatial services and 1,561 sub-layers.

When developers build maps, spatial analysis pipelines, or GIS crawlers using AI assistants (Claude Desktop, Cursor, Windsurf, etc.), large language models frequently struggle to locate real-world endpoints or generate non-functional URLs. GeoSource MCP connects AI environments directly to an indexed local SQLite database (gis_services.db), enabling low-latency, multi-criteria discovery of verified spatial services across OGC WMS, WFS, WMTS, XYZ Tiles, ArcGIS REST, STAC, and Open Data APIs.

Key Engineering Features

  • Structured Discovery: Helps AI models locate existing, functional endpoints rather than guessing URLs.
  • Low-Overhead Retrieval: Fetches only matching records (typically 200 ~ 500 tokens per search) on demand, avoiding the cost and latency of loading megabytes of raw files into prompts.
  • Transparent Verification: Tracks explicit availability statuses:
    • 1,495 Verified Active (68.0%): Confirmed accessible via automated connectivity checks or authoritative official documentation.
    • 649 Pending / Unverified (29.5%): Cataloged entries awaiting further verification or restricted by network boundaries.
    • 54 Deprecated / Inactive (2.5%): Documented legacy services retained for reference.
  • Two-Way Maintenance: Supports Excel synchronization and provides tools for AI agents to report status updates and new endpoints.

Catalog Contents & Protocols

CategoryProtocols SupportedNotable Data Sources
Open Data Portals (1,190)CKAN, Socrata, DKAN, ArcGIS Hub, REST APIData.gov, Eurostat, Open Data DC, regional open data hubs
OGC Standard Services (147)WMS 1.1.1/1.3.0, WFS 1.0/2.0, WMTS 1.0.0PDOK (Netherlands), geo.admin.ch (Switzerland), MML (Finland)
Transit & Routing (151)GTFS, GTFS-RT, OSRM, REST APIOpenRouteService, Transitland, city transit agencies
Basemap Tiles (65)XYZ Slippy Maps, WMTS, Vector TilesOpenStreetMap, Carto, Stadia, OpenTopoMap, MapTiler
ArcGIS Platforms (100)ArcGIS Server REST, FeatureServer, MapServerEsri Living Atlas, federal & municipal ArcGIS REST endpoints
Remote Sensing / STAC (67)STAC API 1.0, OGC API Records, COGEarth Search, Microsoft Planetary Computer, USGS Landsat
3D Geospatial (31)3D Tiles, CityGML, I3SCesium ion open assets, municipal 3D building models

Available MCP Tools

ToolParametersPurpose
search_gis_serviceskeyword, country, protocol, category, is_free, need_no_key, limitSearches services based on multiple criteria with case-insensitive matching.
get_service_detailservice_idRetrieves full metadata (50+ fields) and child layers for a specific service ID (case-insensitive).
list_categories_and_stats(None)Returns summary statistics of categories, protocols, countries, and verification statuses.
query_gis_sqlqueryExecutes safe, read-only SELECT queries against the SQLite database (capped at 100 rows).
update_service_statusservice_id, new_url, status, notesUpdates service availability, URLs, or notes with validated status enums.

Getting Started

1. Requirements & Installation

Requires Python 3.10+:

git clone https://github.com/Wukeeeeee/GeoSource-MCP.git
cd GeoSource-MCP
pip install -r requirements.txt

2. Run Self-Test

Verify that the database and all MCP tools function as expected:

python server.py --test

You should see: [TEST] All tests passed! Ready for MCP clients.

3. Client Configuration

Claude Desktop

Add to your claude_desktop_config.json:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "geosource": {
      "command": "python",
      "args": ["<FULL_PATH_TO_GEOSOURCE>/server.py"]
    }
  }
}
Cursor / IDEs

In your IDE's MCP settings, add a new stdio server:

  • Command: python
  • Args: <FULL_PATH_TO_GEOSOURCE>/server.py

🇨🇳 中文说明

项目简介

GeoSource MCP 是一个基于 Model Context Protocol (MCP) 标准的开源数据服务程序。它为各类 AI 编程与分析助手(Claude Desktop、Cursor、Windsurf 等)提供对本地结构化索引的 2,198 个全球真实 GIS 空间服务 与 1,561 个地图图层 的检索工具。

在开发地图应用或编写空间数据处理脚本时,大模型通常无法准确掌握全球各机构公开的实时服务接口,容易推断出不可用的链接。GeoSource MCP 直接连接本地 SQLite 数据库(gis_services.db),帮助 AI 快速检索真实的可用服务与图层参数。

工程特性与设计原则

  • 结构化发现,降低幻觉:提供经过结构化收录的真实服务端点,辅助 AI 编写准确的地图调用代码。
  • 按需低开销检索:每次仅检索返回匹配的 35 条记录(约 200500 Tokens),避免将数兆字节的原始表格强行填入上下文窗口。
  • 透明的可用性状态:
    • 已验证(1,495 条,占比 68.0%):经自动化连通性探测或官方文档确认为可用。
    • 未验证(649 条,占比 29.5%):已整理归类,待进一步探测或受跨国网络连通性限制。
    • 已停止(54 条,占比 2.5%):已下线或历史归档服务,保留供查阅追溯。
  • 双向维护支持:支持与 Excel 表格双向数据同步,并提供更新接口供 AI 助手汇报失效链接与新地址。

数据分类与协议支持

分类协议类型典型代表
开放数据门户 (1,190 条)CKAN, Socrata, DKAN, ArcGIS Hub, REST APIData.gov、欧盟数据门户、开放广东、各级城市开放数据中心
OGC 标准服务 (147 条)OGC WMS (1.1.1/1.3.0), WFS, WMTS荷兰 PDOK、瑞士联邦地图、芬兰测绘局等国家级测绘局
交通与路网 (151 条)GTFS, GTFS-RT, OSRM, REST APIOpenRouteService、Transitland、各地铁公交调度 API
底图瓦片 (65 条)XYZ 栅格瓦片, WMTS, 矢量瓦片OpenStreetMap, Carto, Stadia Maps, OpenTopoMap
ArcGIS 平台 (100 条)ArcGIS REST (MapServer, FeatureServer)Esri Living Atlas、各国政府与水务气象机构 REST 服务
遥感时空资产 (67 条)STAC API 1.0, OGC API Records, COGEarth Search、行星计算机、USGS Landsat 卫星时空目录
三维空间数据 (31 条)3D Tiles, CityGML, I3SCesium ion 开放资产、城市级白模与倾斜摄影服务

MCP 工具一览

工具名称输入参数功能说明
search_gis_serviceskeyword, country, protocol, category, is_free, need_no_key, limit多条件筛选查询空间服务(支持大小写无关模糊匹配)。
get_service_detailservice_id获取该服务的 50 余项详细元数据与关联子图层列表。
list_categories_and_stats无获取数据库总体量、各大类、协议分布及验证状态统计。
query_gis_sqlquery对 SQLite 数据库执行只读 SELECT SQL 查询(内置上限 100 行保护)。
update_service_statusservice_id, new_url, status, notes经枚举校验后更新服务的可用状态、新 URL 或备注信息。

快速开始

1. 安装依赖

git clone https://github.com/Wukeeeeee/GeoSource-MCP.git
cd GeoSource-MCP
pip install -r requirements.txt

2. 本地快速自测

python server.py --test

3. 配置客户端连接

Claude Desktop

编辑配置文件(Windows: %APPDATA%\Claude\claude_desktop_config.json,macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "geosource": {
      "command": "python",
      "args": ["E:/my_repo/GeoSource/server.py"]
    }
  }
}
Cursor / 其他 IDE

在 MCP 配置页面添加 stdio 服务:

  • Command: python
  • Args: E:/my_repo/GeoSource/server.py

📁 数据库表结构 (Database Schema)

  • master:主服务表(主键 service_id,包含服务名、提供方、国家、协议、服务地址、格式、认证方式、验证状态等 54 个字段,建有 9 个核心索引)。
  • layers:子图层表(联合主键 (service_id, layer_idx),记录服务所属图层名称)。
  • ecosystem:开源 GIS 软件库、SDK 与数据库工具链表。

📄 License

MIT License © 2026 GeoSource Authors