基于 Cooragent 和 MCP 服务,我们可以快速构建智能旅游规划服务:
- MCP 服务中台:以高德地图 API、民航实时数据接口、语义搜索算法、文档生成引擎为基石,打造旅游行业数据基建;
- Cooragent 智能体生态:运用 Cooragent 独有的任务编排算法,让四大智能体如交响乐团般默契配合 —— 交通规划结果实时触发行程调整,消费数据动态反哺路线优化,最终在 60 秒内生成兼具创新性与可行性的 “旅游数字孪生方案”。
项目地址 https://github.com/LeapLabTHU/cooragent
一、MCP 服务器搭建
-
AMAP(高德导航)
- 登录高德开放平台:
https://lbs.amap.com/
- 创建
api_key
- 可用工具:
https://lbs.amap.com/api/mcp-server/summary
- 登录高德开放平台:
-
excel(Excel 文件操作)
- 无额外配置
- 开源地址:
https://github.com/negokaz/excel-mcp-server
-
filesystem(文件系统操作)
- 配置允许访问的路径
- 开源地址:
https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem
-
word(Word 文档操作)
cd cooragent/src/tools git clone git@github.com:MeterLong/MCP-Doc.git
- 在
server.py
地址填入args
中 - 项目地址:
https://github.com/MeterLong/MCP-Doc#
- 在
-
image-downloader(图像下载工具)
cd cooragent/src/tools git clone https://github.com/qpd-v/mcp-image-downloader.git cd mcp-image-downloader npm install npm run build
- 在
index.js
地址填入args
中 - 项目地址:
https://github.com/qpd-v/mcp-image-downloader
- 在
-
variflight-mcp(中国民航信息获取)
- 获取
api_key
:
https://mcp.variflight.com/
- 在 ModelScope 上创建 MCP SSE 服务:
https://www.modelscope.cn/mcp/servers/@variflight-ai/variflight-mcp
- 将服务 URL 填写到配置中
- 文档地址:
https://bcnucz2nnop8.feishu.cn/wiki/SDFDwQIaAiM3hxk6uyhcJxSkn2b
- 获取
二、配置 Cooragent MCP 工具
在项目根目录下的 ./config/mcp.json
中进行配置,示例:
{
"mcpServers": {
"AMAP": {
"url": "https://mcp.amap.com/sse",
"env": {
"AMAP_MAPS_API_KEY": "your_amap_maps_api_key"
}
},
"excel": {
"command": "npx",
"args": ["--yes", "@negokaz/excel-mcp-server"],
"env": {
"EXCEL_MCP_PAGING_CELLS_LIMIT": "4000"
}
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
},
"word": {
"command": "python",
"args": ["/path/to/MCP-Doc/server.py"]
},
"image-downloader": {
"command": "node",
"args": ["/path/to/mcp-image-downloader/build/index.js"]
},
"variflight-mcp": {
"type": "sse",
"url": "your_modelscope_variflight_mcp_url"
}
}
}
详细配置参考:
https://github.com/LeapLabTHU/cooragent
三、构建旅游智能体
通过 CLI 构建四个专用智能体,每个智能体均采用 agent_workflow
任务类型。
-
交通规划智能体
run --debug --user-id test --task-type agent_workflow \ --message "创建交通规划智能体:根据行程或其他智能体输出,安排出发/到达时间、路线、票价等,输出详尽交通计划。"
-
行程设计智能体
run --debug --user-id test --task-type agent_workflow \ --message "创建行程设计智能体:根据目的地和用户偏好,推荐景点、给出理由及照片 URL,并设计详细日程。"
-
费用计算智能体
run --debug --user-id test --task-type agent_workflow \ --message "创建费用计算智能体:统计交通、住宿、门票、餐饮等所有花销,输出预算明细与总花费。"
-
结果整合智能体
run --debug --user-id test --task-type agent_workflow \ --message "创建报告整合智能体:汇总上述三个智能体结果,生成含文字、表格、景点图片的 Word 文档,并保存本地。"
四、多智能体协同规划
run --debug --user-id test --task-type agent_workflow \
--message "我计划于 2025-05-22 至 2025-05-26,从上海出发前往北京游玩五天。请生成包含往返低价航班、食宿、景点推荐与预算等的详细旅游规划,最终以 Word 文档形式保存至桌面。"
五、结果展示
使用 Cooragent 构建多智能体旅游规划服务