Appearance
MCP Server 应用案例
本文档给出几个适合在 Cursor Agent 或其他 MCP 客户端中使用的典型场景。使用前请先完成 快速接入。
1. 出行路线规划
需求描述
text
我明天要从北京南站去首都机场,请帮我规划驾车路线,给出距离、预计耗时,并说明是否适合打车。可能调用的工具
| 步骤 | 工具 | 作用 |
|---|---|---|
| 1 | maps_geo | 将“北京南站”“首都机场”解析为经纬度 |
| 2 | maps_direction_driving | 规划驾车路线 |
| 3 | maps_static_map | 可选,生成路线静态图 |
直接调用示例
json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "maps_direction_driving",
"arguments": {
"origin": "116.379008,39.865042",
"destination": "116.603039,40.080525",
"need_geo": true
}
}
}2. 周边地点推荐
需求描述
text
我在北京国贸附近,帮我找 1000 米内评分适合商务会面的咖啡厅,整理名称、地址和距离。可能调用的工具
| 步骤 | 工具 | 作用 |
|---|---|---|
| 1 | maps_geo | 将“北京国贸”解析为中心点坐标 |
| 2 | maps_place_around | 搜索周边咖啡厅 |
| 3 | maps_search_detail | 按需查询具体 POI 的 AOI 面轮廓 |
直接调用示例
json
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "maps_place_around",
"arguments": {
"location": "116.461841,39.910744",
"keywords": "咖啡厅",
"max_distance": "1000"
}
}
}3. 坐标到地址解释
需求描述
text
帮我看一下坐标 116.397128,39.916527 附近是什么位置,并给出城市、区县和格式化地址。直接调用示例
json
{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "maps_regeocode",
"arguments": {
"location": "116.397128,39.916527"
}
}
}4. 联调检查清单
| 检查项 | 期望结果 |
|---|---|
initialize | 返回 protocolVersion、capabilities、serverInfo |
tools/list | 返回 13 个 MCP 工具 |
tools/call | 返回 result.content[0].text |
| 坐标参数 | 均使用 经度,纬度 格式 |
| 鉴权 | URL query 中包含有效 key |
| 新入口 | 使用 /api/v2/mcp |