mcp-map-server
The mcp-map-server provides map and location-based services to LLM clients by integrating Amap (高德/Gaode) and Baidu Maps Web Service APIs. Here's what you can do:
Geocoding (
map_geocode): Convert addresses to coordinates, administrative district info, and adcodes.Reverse Geocoding (
map_reverse_geocode): Convert coordinates back into human-readable addresses.POI Keyword Search (
map_search_poi): Search for points of interest by keyword, optionally scoped to a city, with pagination support.Nearby/Around Search (
map_search_around): Search for POIs within a specified radius around a given location.Route Planning (
map_direction): Plan routes for driving, walking, public transit, or cycling, with distance, duration, and turn-by-turn steps.Distance Measurement (
map_distance): Calculate distance and estimated travel time between two coordinates.Weather Query (
map_weather): Retrieve real-time weather and multi-day forecasts for an administrative region via adcode.IP Geolocation (
map_ip_location): Determine the approximate province/city for a given IP address.Platform Status Check (
map_get_platform_status): Query which map platforms are enabled and have valid API keys configured.
Key features:
Dynamically switch between Amap (GCJ-02) and Baidu Maps (BD-09) coordinate systems per tool call via a
platformparameter.Unified coordinate format: longitude,latitude across all tools.
Two transport modes:
stdio(local) andSSE(remote HTTP).
Provides tools for map services including geocoding, POI search, route planning, weather, and IP location using the Baidu Maps API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-map-serverwhat's the weather in Beijing?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Map Server
为 LLM 大模型提供地图能力的 MCP (Model Context Protocol) Server。支持高德地图与百度地图的 Web 服务 API,涵盖地理编码、逆地理编码、POI 搜索、周边搜索、路径规划、距离测量、天气查询和 IP 定位。部署后可直接被支持 MCP 的大模型客户端(Claude、Cherry Studio、Cline 等)调用。
功能
地理编码 / 逆地理编码(地址 ⇄ 坐标)
关键字 POI 搜索与周边搜索
路径规划:驾车 / 步行 / 公交 / 骑行
距离与耗时测量
天气查询(实时 + 未来预报)
IP 定位
双平台支持:高德(amap)、百度(baidu),可按工具调用动态切换
两种传输模式:
stdio(本地)和sse(远程 HTTP)统一坐标格式
经度,纬度,屏蔽两家 API 的坐标顺序差异
Related MCP server: AMap MCP Server
快速开始
1. 申请 API Key
平台 | 申请地址 | 环境变量 |
高德地图 | https://console.amap.com/dev/key/app (创建「Web 服务」类型 Key) |
|
百度地图 | https://lbsyun.baidu.com/apiconsole/key (创建「服务端」应用,得到 AK) |
|
两个平台至少配置一个即可。未配置的平台会自动标记为不可用。
⚠️ 高德 Key 的服务平台必须选「Web服务」,用 Web端(JS)/Android/iOS 类型的 Key 调用 Web 服务 API 会报
USERKEY_PLAT_NOMATCH。若该 Key 开启了「数字签名」,还需把私钥填入MCP_AMAP_SECRET。
2. 克隆仓库
git clone https://github.com/ganyu123456/mcp-map-server.git
cd mcp-map-server3. 本地开发运行
# 安装依赖
pip install -e ".[sse]"
# 配置环境变量
cp .env.example .env
vim .env # 填入 MCP_AMAP_KEY / MCP_BAIDU_KEY
# stdio 模式(本地 MCP 客户端)
MCP_TRANSPORT=stdio python -m mcp_map_server.server
# SSE 模式(远程 MCP 客户端)
MCP_TRANSPORT=sse python -m mcp_map_server.server部署
Docker Compose
cp .env.example .env
# 编辑 .env:填入 API Key,并设置 MCP_IMAGE 指向你的镜像
docker compose up -dCI/CD 自动构建发布
在仓库 Settings → Secrets and variables → Actions 中添加以下 Secrets(用于推送镜像到 Harbor):
Secret | 示例值 | 说明 |
|
| Harbor 用户名 |
|
| Harbor 密码或访问令牌 |
镜像仓库地址已固定为
harbor.zkjgy.online/library(写死在 workflow 中),无需再配置HARBOR_REGISTRY/HARBOR_PROJECT。
打 tag 触发构建:
git tag v1.0.0
git push origin v1.0.0GitHub Actions 将自动构建 linux/amd64 与 linux/arm64 多架构镜像、推送到 Harbor,并创建带离线镜像的 GitHub Release。
MCP 客户端配置
SSE(远程)
{
"mcpServers": {
"map": {
"url": "http://<your-server-ip>:8091/sse"
}
}
}stdio(本地)
{
"mcpServers": {
"map": {
"command": "python",
"args": ["-m", "mcp_map_server.server"],
"env": {
"MCP_TRANSPORT": "stdio",
"MCP_AMAP_KEY": "your_amap_key",
"MCP_BAIDU_KEY": "your_baidu_ak"
}
}
}
}环境变量
变量 | 默认值 | 说明 |
|
| Docker 镜像地址 |
|
| 传输模式: |
|
| SSE 模式监听地址 |
|
| SSE 模式监听端口 |
|
| 启用的地图平台 |
|
| 工具调用未指定平台时的默认平台 |
| (空) | 高德地图 Web 服务 Key(服务平台须为「Web服务」) |
| (空) | 高德数字签名私钥(仅当 Key 开启「数字签名」时填写) |
| (空) | 百度地图 Web 服务 AK |
|
| 版本标签 |
MCP 工具列表
工具 | 说明 |
| 地理编码:地址 → 坐标(含 adcode,可用于天气) |
| 逆地理编码:坐标 → 地址 |
| 关键字 POI 搜索 |
| 周边搜索(指定中心 + 半径) |
| 路径规划(驾车/步行/公交/骑行) |
| 距离与耗时测量 |
| 天气查询(adcode) |
| IP 定位 |
| 查询平台可用状态 |
每个工具(除状态查询外)都支持 platform 参数(amap 或 baidu),省略时使用 MCP_DEFAULT_PLATFORM。
坐标说明
所有工具的坐标统一使用
经度,纬度格式,如116.481,39.990。坐标与平台绑定:高德返回 GCJ-02,百度返回 BD-09,两者不可跨平台混用。请使用哪个平台产生的坐标,就在哪个平台上继续使用。
工具调用示例
地理编码: map_geocode(address="北京市朝阳区阜通东大街6号")
逆地理编码:map_reverse_geocode(location="116.481,39.990", platform="amap")
POI 搜索: map_search_poi(keyword="星巴克", city="上海", limit=10)
周边搜索: map_search_around(location="116.481,39.990", keyword="地铁站", radius=1000)
路径规划: map_direction(origin="116.481,39.990", destination="116.434,39.909", mode="driving")
天气查询: map_weather(city="110000")典型工作流:先用 map_geocode 把地址转成坐标和 adcode → 再用坐标做路径规划 / 周边搜索,或用 adcode 查天气。
项目结构
mcp-map-server/
├── src/mcp_map_server/
│ ├── server.py # MCP 服务器入口,工具定义与分发
│ └── platforms/
│ ├── base.py # 平台抽象层与统一数据模型
│ ├── amap.py # 高德地图实现
│ └── baidu.py # 百度地图实现
├── Dockerfile
├── docker-compose.yaml
├── .github/workflows/
│ └── build-release.yaml # CI/CD 工作流
├── requirements.txt
├── pyproject.toml
└── .env.exampleLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ganyu123456/mcp-map-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server