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 即可。
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | 城市名。当地址有歧义时可指定 | |
| limit | No | 最多返回多少条 | |
| origin | Yes | 起点:地址文本或「经度,纬度」 | |
| target | Yes | 沿途要找的目标,如 加油站 / 商店 / 山姆超市 / 充电站 | |
| distance | No | 沿途搜索半径,单位米 | |
| destination | Yes | 终点:地址文本或「经度,纬度」 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and openWorldHint, yet the description adds real behavioral context: results are deduplicated and sorted by distance from the origin, the corridor is sampled along the polyline, and the Key must be configured first. It does not warn about sampling-induced coverage gaps, rate limits, or cost, which keeps it below a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose is front-loaded, then parameters, then implementation, then the Key prerequisite — a sensible order. The '实现方式' sentence about /v3/direction/driving and /v3/place/around sampling is longer than strictly required for invocation, but it does build justified trust in result quality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description still states the return shape (a list of target POIs sorted by distance from the origin) and covers the three required and three optional parameters. It omits expectations around sparse results or how many sample points are used, which is a modest remaining gap for a 6-parameter tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is already 100%, so the baseline is 3. The description nevertheless adds meaning beyond the schema: distance is defined as a corridor that extends distance meters to each side of the route centerline (with a worked example), and it clarifies that origin/destination accept either address text or 'lng,lat'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence gives a specific verb (搜索), resource (目标 POI) and scope (沿驾车路线), plus the return ordering. The route-corridor scope inherently separates it from the point-based search_nearby sibling, but the description never names that sibling, so the differentiation is implicit rather than explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It supplies concrete selection context (target keyword examples such as 加油站/服务区/充电站) and an explicit operational prerequisite — '需要先配置高德 Key,未配置时调用 set_amap_key 即可' — which routes the agent to a sibling when setup is missing. It never states when NOT to use it or when to prefer search_nearby, so it stops short of full when/when-not coverage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_nearby周边搜索ARead-only
根据输入的位置,查询周边指定类型的商店 / POI,返回具体列表(按距离由近到远)。 location 支持两种写法:地址文本(如「济南市历下区泉城路」),或「经度,纬度」(如 117.120128,36.652069)。 keyword 是高德 POI 关键词,例如:商店、超市、便利店、加油站、山姆超市、餐厅、充电站、停车场、酒店。 需要先配置高德 Key,未配置时调用 set_amap_key 即可。
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | 城市名。当地址有歧义时可指定,如「济南」 | |
| limit | No | 最多返回多少条 | |
| radius | No | 搜索半径,单位米,最大 50000 | |
| keyword | No | 要搜索的 POI 关键词,如 商店 / 超市 / 加油站 / 山姆超市 | 商店 |
| location | Yes | 中心点位置:地址文本,或「经度,纬度」 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so safety and external-network behavior are covered. The description adds real value beyond them: the results come back as a list ordered from nearest to farthest, and the tool depends on an API key being configured first.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the purpose, then location formats, then keyword examples, then the key prerequisite. Every sentence is relevant and there is no filler, though the keyword enumeration is somewhat list-heavy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
All five parameters are documented in the schema, the return ordering is described despite there being no output schema, and the key prerequisite is spelled out. An agent has everything needed to invoke this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents city, limit, radius, keyword, and location with defaults and bounds. The description largely restates the location formats and keyword examples, adding only a concrete coordinate sample. Baseline 3 is appropriate when the schema carries the load.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: query nearby POIs of a given type around an input location, returned sorted by distance. It is clear and concrete, but it does not explicitly contrast itself with the sibling search_along_route, leaving that differentiation to the name alone.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides a concrete prerequisite and routing instruction: an Amap Key must be configured, and if not, call set_amap_key first. That is genuinely useful context. It does not, however, say when to prefer this over search_along_route.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_amap_key配置高德 KeyA
录入并校验高德地图「Web服务」类型的 Key。 会先拿一个测试地址真实调一次高德接口,校验通过才写入本地配置文件,之后所有查询自动使用。 用户提供 Key 后调用本工具即可完成认证,不需要修改客户端配置或重启。
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | 高德开放平台的「Web服务」类型 Key |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Goes well beyond the annotations: it discloses that a real call to the Amap API is made against a test address first, that the write to the local config file is gated on validation passing, and that no restart or client reconfiguration is needed. For a mutating, open-world tool this is exactly the side-effect and sequencing information an agent needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with the action, then validation/write behavior, then the practical consequence for the caller. Each sentence carries distinct information and nothing is repeated from the schema or annotations.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter, no-output-schema tool with annotations covering read-only and open-world status, the description is essentially complete. Minor omissions: what error surface appears if validation fails, and whether a re-run overwrites an existing configured key.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Only one parameter, and the schema already documents it at 100% coverage ('高德开放平台的「Web服务」类型 Key'). The description reinforces the Web-service key type constraint but adds no new format, length, or syntax detail beyond the schema, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb-and-resource pair: 录入并校验高德地图「Web服务」类型的 Key. It also scopes the effect (all later queries use it automatically), which cleanly separates this config tool from the query-oriented siblings search_nearby and search_along_route.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Clearly states the trigger condition — the user provides a Key and calling this tool completes authentication — and explicitly rules out the alternative approaches (editing client config, restarting). It does not name a sibling or fallback tool, but the alternatives it excludes are the relevant ones for a setup step.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
search_along_route - First observed
search_nearby - First observed
set_amap_key
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
MCP server for China Railway 12306 ticket availability: schedules and seats by Chinese station name.
Geo-based flight search MCP server. Find more flights between any two places on earth
Search 77,000+ MCP servers ranked by real adoption data to find the right one for any task.
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for nearby place searches with IP-based location detection.23MIT
- 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.1229 npmMIT