Token导航 LogoToken导航

MCP Server · 地图位置

gaode MCP

基于高德地图API的地理信息服务集成,提供地理编码、路线规划、POI搜索等功能,专为AI智能体和LLM应用设计。

stdio官方级别未说明来源级核验工具 15
地理编码PythonClaudeClaude DesktopCursor

快速开始

作者 / 组织
qiao101660
提供方
qiao101660

工具数量

15

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

2

仓库热度

收录来源

2 个

MCP World

选型结论

gaode MCP 属于地图位置类 MCP Server,公开资料标注 15 个工具,通过stdio 本地进程接入,适配 Claude Desktop、Claude、Cursor,有可以直接复制的安装命令;接入前要先准备 API Key。

分类

地图位置

传输方式

stdio

认证方式

API Key

部署方式

支持远程部署

安装与配置

安装命令

pip install -r requirements.txt

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 对应的运行时,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 15 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

🌐 Amap MCP Server

🗺️ 高德地图 MCP (Model Context Protocol) 服务器 - 为 AI 智能体提供完整的地理信息服务和路线规划功能

基于 Model Context Protocol (MCP) 协议的高德地图服务集成,支持地理编码、路线规划、POI搜索等核心功能,专为 AI 智能体和 LLM 应用设计。

✨ 核心特性

功能模块描述工具数量
🗺️ 地理编码地址与坐标相互转换2
🚗 路线规划驾车/步行/骑行/公交/地铁6
🔍 POI搜索关键字/周边/多边形/详情查询4
🏛️ 行政区划城市区域层级查询1
🌐 IP定位基于IP的地理位置1
📍 AOI边界兴趣区域边界查询1

总计:15+ 个专业工具


🚀 快速开始

1️⃣ 安装依赖

# 使用 pip
pip install -r requirements.txt

# 使用 uv (推荐,更快)
uv pip install -r requirements.txt

2️⃣ 配置环境变量

方式一:复制配置文件(推荐)

# 复制环境变量模板
cp .env.example .env
# 编辑 .env 文件,填入您的 API Key

方式二:直接创建 .env 文件

创建 .env 文件并配置高德 API 密钥:

# ========== 必需配置 ==========
# 高德地图 Web 服务 API Key
# 获取地址:https://lbs.amap.com/dev/
AMAP_API_KEY=your_amap_api_key_here

# ========== API 地址配置(可选,使用默认值) ==========
# 地理编码
AMAP_GEO_URL=https://restapi.amap.com/v3/geocode/geo
AMAP_REGEO_URL=https://restapi.amap.com/v3/geocode/regeo

# 路线规划
AMAP_DRIVING_URL=https://restapi.amap.com/v5/direction/driving
AMAP_WALKING_URL=https://restapi.amap.com/v5/direction/walking
AMAP_BICYCLING_URL=https://restapi.amap.com/v5/direction/bicycling
AMAP_EBIKE_URL=https://restapi.amap.com/v5/direction/electrobike
AMAP_BUS_URL=https://restapi.amap.com/v5/direction/transit/integrated
AMAP_SUBWAY_TRANSIT=https://restapi.amap.com/v5/direction/transit/integrated

# POI 搜索
AMAP_SEARCH_POI_URL=https://restapi.amap.com/v5/place/text
AMAP_SEARCH_POI_AROUND_URL=https://restapi.amap.com/v5/place/around
AMAP_SEARCH_POI_POLYGON_URL=https://restapi.amap.com/v5/place/polygon
AMAP_SEARCH_POI_DETAIL_URL=https://restapi.amap.com/v5/place/detail
AMAP_AOI_POLYLINE_URL=https://restapi.amap.com/v5/aoi/polyline

# 行政区划 & IP
AMAP_REGION_QUERY_URL=https://restapi.amap.com/v3/config/district
AMAP_IP_URL=https://restapi.amap.com/v3/ip

# ========== 日志配置(可选) ==========
# 日志级别: DEBUG, INFO, WARNING, ERROR, CRITICAL
# AMAP_LOG_LEVEL=INFO
# 日志文件路径
# AMAP_LOG_FILE=amap_mcp.log

3️⃣ 获取 API 密钥

  1. 访问 高德开放平台
  2. 注册/登录账号
  3. 创建应用 → 选择「Web服务」
  4. 获取 API Key

4️⃣ 启动服务

# 方式1: 直接运行 MCP 服务器
python amap_mcp.py

# 方式2: 使用 MCP CLI
mcp run amap_mcp.py

🔧 MCP Server 集成配置

Claude Desktop / Cursor 等 MCP 客户端

在 MCP 客户端配置文件中添加:

{
  "mcpServers": {
    "amap-mcp-server": {
      "transport": "stdio",
      "command": "python",
      "args": ["D:\\mycode\\travelagent\\amap_mcp\\amap_mcp.py"],
      "env": {
        "AMAP_API_KEY": "your_amap_api_key_here"
      }
    }
  }
}

环境变量配置(推荐)

{
  "mcpServers": {
    "amap-mcp-server": {
      "transport": "stdio",
      "command": "python",
      "args": ["D:\\mycode\\travelagent\\amap_mcp\\amap_mcp.py"]
    }
  }
}

配合 .env 文件使用:

AMAP_API_KEY=your_amap_api_key_here

Linux/macOS 路径示例

{
  "mcpServers": {
    "amap-mcp-server": {
      "transport": "stdio",
      "command": "python",
      "args": ["/home/user/travelagent/amap_mcp/amap_mcp.py"]
    }
  }
}

📚 API 工具列表

📍 地理编码

工具名称功能描述输入示例
geocoding地址转坐标{"address": "北京市朝阳区阜通东大街6号"}
reverse_geocoding坐标转地址{"location": "116.481488,39.990464"}

🚗 路线规划

工具名称功能描述策略选项
driving_route_planning驾车路线速度优先/费用最低/距离最短/推荐路线
walking_route_planning步行路线室内外路线规划
bicycling_route_planning骑行路线自行车专用路线
elect_bike_route_planning电动车路线续航/充电站优化
public_transit_route_planning公交路线地铁/公交/换乘方案
amap_route_subway地铁路线城市地铁换乘

🔍 POI 搜索

工具名称功能描述
search_poi关键字搜索 POI
search_poi_around周边 POI 搜索
search_poi_polygon多边形区域 POI 搜索
search_poi_detailPOI 详情查询
search_aoi_boundaryAOI 边界查询

🏛️ 行政区划 & IP

工具名称功能描述
administrative_region_query行政区划查询
ip_positioningIP 定位

💡 使用示例

Python 示例

import asyncio
from amap_mcp import geocoding, driving_route_planning

async def travel_planner():
    """智能行程规划示例"""
    
    # 1️⃣ 地址转坐标
    address_result = await geocoding({
        "address": "北京市朝阳区望京soho",
        "city": "北京"
    })
    origin = address_result["data"]["location"]
    
    # 2️⃣ 获取目的地坐标
    dest_result = await geocoding({
        "address": "上海浦东新区陆家嘴",
        "city": "上海"
    })
    destination = dest_result["data"]["location"]
    
    # 3️⃣ 规划驾车路线
    route = await driving_route_planning({
        "origin": origin,
        "destination": destination,
        "strategy": 32,  # 推荐路线
        "show_fields": "cost,navi"
    })
    
    # 4️⃣ 输出路线信息
    print(f"总距离: {route['data']['summary']['distance']}米")
    print(f"预计时间: {route['data']['summary']['duration']}秒")
    
    return route

# 运行
asyncio.run(travel_planner())

MCP Client 示例

from mcp import Client

async def use_amap_mcp():
    async with Client("amap_mcp.py") as client:
        # 地理编码
        result = await client.call_tool(
            "geocoding",
            {"address": "杭州市西湖区"}
        )
        print(result)
        
        # POI搜索
        pois = await client.call_tool(
            "search_poi",
            {"keywords": "美食", "page_size": 5}
        )
        return pois

⚙️ 环境配置

完整环境变量

# ========== 必需 ==========
AMAP_API_KEY=your_api_key_here

# ========== 地理编码 ==========
AMAP_GEO_URL=https://restapi.amap.com/v3/geocode/geo
AMAP_REGEO_URL=https://restapi.amap.com/v3/geocode/regeo

# ========== 路线规划 ==========
AMAP_DRIVING_URL=https://restapi.amap.com/v5/direction/driving
AMAP_WALKING_URL=https://restapi.amap.com/v5/direction/walking
AMAP_BICYCLING_URL=https://restapi.amap.com/v5/direction/bicycling
AMAP_EBIKE_URL=https://restapi.amap.com/v5/direction/electrobike
AMAP_BUS_URL=https://restapi.amap.com/v5/direction/transit/integrated
AMAP_SUBWAY_TRANSIT=https://restapi.amap.com/v5/direction/transit/integrated

# ========== POI搜索 ==========
AMAP_SEARCH_POI_URL=https://restapi.amap.com/v3/place/text
AMAP_SEARCH_POI_AROUND_URL=https://restapi.amap.com/v5/place/around
AMAP_SEARCH_POI_POLYGON_URL=https://restapi.amap.com/v5/place/polygon
AMAP_SEARCH_POI_DETAIL_URL=https://restapi.amap.com/v5/place/detail
AMAP_AOI_POLYLINE_URL=https://restapi.amap.com/v5/aoi/polyline

# ========== 行政区划 & IP ==========
AMAP_REGION_QUERY_URL=https://restapi.amap.com/v3/config/district
AMAP_IP_URL=https://restapi.amap.com/v3/ip

🛠️ 开发指南

项目结构

amap_mcp/
├── amap_mcp.py          # MCP 服务器主入口
├── models.py            # 数据模型定义
├── config.py            # 配置和工具函数
├── output.py           # 响应格式化处理
├── main.py             # IP 查询服务入口
├── amap_enum.py        # API 地址枚举
├── config_log.py       # 日志配置
├── requirements.txt    # 依赖列表
├── pyproject.toml      # 项目配置
├── README.md           # 项目文档
└── utils/              # 工具函数

添加新工具

from mcp.server.fastmcp import FastMCP
from config import get_api_key, validate_location_format

mcp = FastMCP(name="amap-mcp")

@mcp.tool(name="custom_tool")
async def custom_function(param: str) -> dict:
    """
    自定义工具描述
    
    Args:
        param: 参数描述
        
    Returns:
        标准化响应
    """
    # 1. 获取 API Key
    api_key = get_api_key()
    
    # 2. 构建请求参数
    params = {"key": api_key, "param": param}
    
    # 3. 发起请求(使用 httpx)
    # 4. 处理响应
    
    return {"status": 1, "data": {...}}

运行测试

# 运行所有测试
pytest test_amap_mcp.py -v

# 运行特定测试
pytest test_amap_mcp.py::test_geocoding -v

# 生成覆盖率报告
pytest --cov=amap_mcp test_amap_mcp.py

📊 响应格式

所有 API 返回统一格式:

{
  "status": 1,
  "data": {...},
  "error": null,
  "info": "OK"
}

错误响应:

{
  "status": 0,
  "data": null,
  "error": "详细错误信息",
  "info": "请求失败"
}

🧪 测试覆盖

本项目包含完整的测试用例:

# 地理编码测试
pytest test_amap_mcp.py -k "geocoding"

# 路线规划测试
pytest test_amap_mcp.py -k "route"

# POI搜索测试
pytest test_amap_mcp.py -k "poi"

# 完整测试套件
pytest test_amap_mcp.py -v --tb=short

🤝 贡献指南

  1. Fork 本项目
  2. 创建特性分支:git checkout -b feature/amazing-feature
  3. 提交更改:git commit -m 'Add amazing feature'
  4. 推送分支:git push origin feature/amazing-feature
  5. 创建 Pull Request

开发规范

  • 使用 black 格式化代码
  • 运行 mypy 进行类型检查
  • 添加必要的测试用例
  • 更新相关文档

📚 相关文档

资源链接
高德开放平台https://lbs.amap.com/
地理编码 APIhttps://lbs.amap.com/api/webservice/guide/api/geocode
路线规划 APIhttps://lbs.amap.com/api/webservice/guide/api/newroute
POI 搜索 APIhttps://lbs.amap.com/api/webservice/guide/api/search
MCP 协议文档https://modelcontextprotocol.io/
FastMCP 框架https://github.com/modelcontextprotocol/servers/tree/main/src/fastmcp

📄 许可证

本项目基于 MIT 许可证 开源。


🙏 致谢


❓ 常见问题

Q: API 调用频率限制?

A: 高德地图 Web 服务 API 免费用户:30万次/天

Q: 坐标系说明?

A: 高德地图使用 GCJ-02 坐标系(国测局坐标)

Q: 如何获取高德 POI 类型代码?

A: 参考 POI 分类代码表

⭐ 如果这个项目对您有帮助,请给它一个 Star!

工具与能力

工具数量

15

资源数量

0

提示词数量

0

能力标签

地理编码Python本地部署路线规划POI搜索行政区划查询IP定位

支持客户端

Claude DesktopClaudeCursor

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

地址与坐标转换

把地址转成经纬度,或按坐标反查位置。

路线与距离

算行程时间、规划多点路线。

天气与出行

查天气和预警,按条件安排行程。

选择建议

值得选的地方

  • 工具数量 15 个,一次接入能覆盖的操作比单点工具更全。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 运行环境,换机器要重新装一遍。
  • 需要自备API Key,没有凭据没法直接试。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。

更适合

  • 需要在地图位置场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到API Key的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
gaode MCP

MCP World · 本页

15stdio有2 个2026-05-17
Baidu Maps

MCP World

10stdio有1 个2026-05-17
MCP Server C2f246e3

MCP World

20stdio有1 个2026-05-17
OpenStreetMap MCP Server

MCP.so

12stdio有3 个2026-05-17
Google Maps (google-maps-aa2563d3)

MCP World

7未说明未标注1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

gaode MCP 怎么安装?

公开资料给出的安装命令是 pip install -r requirements.txt,运行环境为 未标注。装完后按客户端要求写进 MCP 配置,重启客户端生效。

gaode MCP 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

gaode MCP 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

gaode MCP 需要 API Key 吗?

公开资料标注的认证方式是API Key,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

gaode MCP 支持哪些客户端?

公开资料标注支持 Claude Desktop、Claude、Cursor;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP