Easy Search Along The Way
Click on "Deploy 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., "@Easy Search Along The Way 济南泉城路附近1公里内有哪些便利店?"
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.
Easy Search Along The Way
一个最小可用的 MCP Server,只做两件事:
周边搜索 —— 给一个位置,查周边有哪些商店 / POI。
沿途搜索 —— 给起点、终点、沿途半径、目标类型,查这条路线沿途的目标。
底层调用高德地图 Web 服务 API。为方便发布后试用,内置了一个高德 Key 录入与校验工具。
一、两个工具
1. search_nearby —— 周边搜索
参数 | 类型 | 必填 | 默认 | 说明 |
| string | ✅ | - | 中心点。地址文本( |
| string |
| 搜索关键词:商店 / 超市 / 加油站 / 山姆超市 / 便利店 / 充电站 … | |
| number |
| 搜索半径,单位米,最大 50000 | |
| number |
| 最多返回条数,最大 50 | |
| string | - | 城市名,地址有歧义时指定 |
返回:{ summary, center, keyword, count, items[] },items 按距离由近到远排序,每条含 name / address / distance / tel / type / location。
2. search_along_route —— 沿途搜索
参数 | 类型 | 必填 | 默认 | 说明 |
| string | ✅ | - | 起点。地址文本或坐标 |
| string | ✅ | - | 终点。地址文本或坐标 |
| number |
| 沿途搜索半径,单位米。以驾车路线为中心线,向两侧各扩 | |
| string | ✅ | - | 沿途要找的目标:加油站 / 商店 / 山姆超市 / 服务区 / 充电站 … |
| number |
| 最多返回条数,最大 100 | |
| string | - | 城市名,地址有歧义时指定 |
返回:{ summary, route, target, corridorRadius, count, items[] }
route:起终点、驾车总里程、耗时、采样点数量、采样间隔items:按alongRouteDistance(沿路线距起点的路程) 从近到远排序,每条含:name/address/tel/type/locationalongRouteDistance:沿驾车路线从起点到该目标的里程distanceToRoute:该目标到路线的垂直距离(把目标投影到路线折线上计算)
结果已经过滤:超出 distance 范围的目标会被丢弃。
3. set_amap_key —— 录入高德 Key(认证)
参数 | 类型 | 必填 | 说明 |
| string | ✅ | 高德开放平台「Web服务」类型的 Key |
会先真实调用一次高德接口做校验,通过才写入本地配置文件。写完后不需要重启客户端,直接就能查询。
Related MCP server: MCP Location Server
二、5 分钟跑起来
第 1 步:申请高德 Key
注册 / 登录 → 控制台 → 应用管理 → 我的应用 → 创建新应用
添加 Key,服务平台务必选「Web服务」(不是「Web端(JS API)」,也不是「iOS/Android」)
复制生成的 32 位 Key
免费额度:个人开发者 Web 服务接口每天有免费调用量,日常测试完全够用。具体额度以高德控制台为准。
第 2 步:配置到 MCP 客户端
方式 A:通过 env 传入(推荐)
在你的 MCP 客户端配置里加上:
{
"mcpServers": {
"easy-search-along-the-way": {
"command": "npx",
"args": ["-y", "github:KevinWangKaiYu/Easy-search-along-the-way"],
"env": {
"AMAP_KEY": "你的高德Web服务Key"
}
}
}
}方式 B:不填 env,由工具录入
配置里只写 command / args,然后对 AI 说「把我的高德 Key 设置成 xxx」,AI 会调用 set_amap_key 完成校验与保存。
两种方式的优先级:env 变量 > 本地配置文件。
方式 C:网络受限时改用压缩包直链
github:owner/repo 这种写法要求客户端能访问 github.com。在公司内网、透明代理等环境下 github.com 常被拦截(表现为 502 Bad Gateway 或 fetch failed),但 codeload.github.com 往往仍可访问。此时把 args 换成压缩包直链即可:
{
"mcpServers": {
"easy-search-along-the-way": {
"command": "npx",
"args": [
"-y",
"https://codeload.github.com/KevinWangKaiYu/Easy-search-along-the-way/tar.gz/refs/tags/v1.0.0"
],
"env": { "AMAP_KEY": "你的高德Web服务Key" }
}
}
}这条直链指向 v1.0.0 标签,内容固定不变,比指向 main 分支更稳定(分支会变、标签不会)。
第 3 步:验证
直接问 AI:
济南泉城路周边 1 公里内有哪些商店?从济南泉城路开到泰安泰山大街,沿途 2 公里内的加油站有哪些?三、本地开发
git clone https://github.com/KevinWangKaiYu/Easy-search-along-the-way.git
cd Easy-search-along-the-way
npm install
# 冒烟测试(会真实走一遍 MCP 协议,依次调用三个工具)
AMAP_KEY=你的key npm run smoke
# 或直接启动(stdio 模式,通常由客户端拉起来,手跑会一直挂着)
npm start四、目录结构
.
├── src/
│ ├── index.js # MCP Server 入口:工具注册 + 业务编排
│ ├── amap.js # 高德 Web 服务 API 封装(geocode / place/around / direction/driving)
│ ├── geo.js # 几何计算:球面距离、折线累计里程、沿线采样
│ └── config.js # 高德 Key 的读取与持久化
├── scripts/
│ └── smoke-test.js # 端到端冒烟测试(真实 MCP 协议)
├── mcp.example.json # MCP 客户端配置示例
└── package.json五、实现原理
周边搜索
location ──► /v3/geocode/geo ──► 经纬度
│
└──► /v3/place/around (radius) ──► POI 列表沿途搜索
origin/destination ──► /v3/geocode/geo ──► 经纬度
│
└──► /v3/direction/driving ──► 路线折线 + 总里程
│
沿折线按 interval 取采样点 ──┤
│
每个采样点 ► /v3/place/around (radius = distance)
│
按 POI id / 坐标去重
│
把每个 POI 投影到折线(点到线段最近点)──► 离路线多远、沿路线走到哪
│
剔除超出 distance 的 → 按 alongRouteDistance 排序采样间隔 interval 默认取你传入的 distance(但最小 500 米);当路线很长导致采样点超过 60 个时,会自动拉大间隔,以保证对高德 API 的调用次数可控。
六、已知限制
限制 | 说明 |
路线很长时可能漏点 | 采样上限 60 个点。若路线特别长且 |
投影用平面近似 |
|
高德关键词匹配 | 搜不到就真没有。例如高德基本没有「司机之家」这类数据 |
坐标系 | 全部使用高德坐标系(GCJ-02),与 GPS 原始坐标(WGS-84)有偏移 |
配额 | 受高德账号的 QPS 与日调用量限制,沿途搜索一次会产生多次 API 调用 |
并发 | 对高德的并发请求限制为 5 |
七、License
MIT
Available Tools
3 toolssearch_along_route沿途搜索ARead-only
沿驾车路线搜索目标 POI,返回沿途范围内的目标列表(按距起点的路程从近到远排序)。 origin 起点、destination 终点:都支持地址文本或「经度,纬度」。 distance 是沿途搜索半径(单位米):以驾车路线为中心线,向两侧各扩 distance 米的范围。例如 distance=2000 表示搜沿途左右各 2 公里。 target 是目标关键词,例如:加油站、商店、超市、山姆超市、服务区、充电站、餐厅。 实现方式:先用 /v3/direction/driving 拿到路线折线,再沿折线按间隔取采样点,对每个采样点做 /v3/place/around 周边搜索,最后按 POI 去重并排序。 需要先配置高德 Key,未配置时调用 set_amap_key 即可。
Inputs: origin (required), target (required), destination (required), city, +2 more.
search_nearby周边搜索ARead-only
根据输入的位置,查询周边指定类型的商店 / POI,返回具体列表(按距离由近到远)。 location 支持两种写法:地址文本(如「济南市历下区泉城路」),或「经度,纬度」(如 117.120128,36.652069)。 keyword 是高德 POI 关键词,例如:商店、超市、便利店、加油站、山姆超市、餐厅、充电站、停车场、酒店。 需要先配置高德 Key,未配置时调用 set_amap_key 即可。
Inputs: location (required), city, limit, radius, +1 more.
set_amap_key配置高德 KeyA
录入并校验高德地图「Web服务」类型的 Key。 会先拿一个测试地址真实调一次高德接口,校验通过才写入本地配置文件,之后所有查询自动使用。 用户提供 Key 后调用本工具即可完成认证,不需要修改客户端配置或重启。
Inputs: key (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The two search tools have clearly distinct purposes: one searches around a point, the other along a route. The configuration tool is unrelated to searching. No ambiguity between tools.
All tool names follow the same snake_case verb_noun pattern: search_nearby, search_along_route, set_amap_key. Consistent and predictable.
Three tools is well-scoped for a location search server: one for nearby POI, one for route-based POI, and one for API key configuration. Each tool has a clear role.
The tool surface covers the core use case of searching for POIs both around a location and along a route, plus necessary setup. No obvious missing operations for the stated purpose.
Maintenance
Related MCP Connectors
Search 100,000+ MCP servers ranked by real adoption data to find the right one for any task.
MCP server for China domestic fuel prices (92/95/98 gasoline, diesel) across 31 provinces with
MCP server for China Railway 12306 ticket availability: schedules and seats by Chinese station name.
MCP server for China Railway 12306 ticket availability: schedules and seats by Chinese station name.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for nearby place searches with IP-based location detection.22MIT
- FlicenseNot gradedqualityDmaintenanceA MCP server that uses Amap API to provide location-based services, allowing users to get geographic information based on IP addresses and search for nearby points of interest.30-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides real-time weather information, 4-day forecasts, and city search functionality for Chinese cities via the AMap API. It enables users to query weather data using city names or administrative codes through natural language interactions.1MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that wraps the Amap (高德地图) Web Service APIs, giving AI assistants like Claude Code 9 map tools: geocoding, route planning (driving/transit/walking/cycling), POI search, nearby search, distance measurement, and IP location.1226 npm1MIT