旅游规划智能体 MCP Server
这是一个基于 MCP (Model Context Protocol) 的旅游规划智能体,提供旅游相关的工具和资源。
🎯 功能特性
工具 (Tools)
- calculate_trip_budget - 计算旅行预算
- suggest_attractions - 推荐景点
- create_itinerary - 生成旅行行程
- check_weather_suggestion - 查询最佳旅行时间
- pack_checklist - 生成打包清单
资源 (Resources)
- destination://{city} - 获取目的地信息
- travel-tips://{category} - 获取旅行小贴士
提示 (Prompts)
- plan_trip_prompt - 生成旅行规划提示词
- emergency_help_prompt - 紧急情况帮助
📦 安装方式
方式 1: 从本地安装(开发测试)
# 在项目目录下
uv pip install -e .
方式 2: 发布到 PyPI 后安装
# 构建包
uv build
# 发布到 PyPI (需要 PyPI 账号)
uv publish
# 其他人可以通过 uvx 直接使用
uvx travel-planning-mcp
🚀 使用方式
1. 在 Langflow 中使用
在 Langflow 的 MCP 配置文件中添加:
{
"mcpServers": {
"travel-planning": {
"command": "uvx",
"args": ["travel-planning-mcp"],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
或者如果是本地开发版本:
{
"mcpServers": {
"travel-planning": {
"command": "python",
"args": ["-m", "travel_planning_mcp.server"],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
2. 在 Kiro 中使用
在 .kiro/settings/mcp.json 中添加相同配置。
3. 命令行测试
# 直接运行
python -m travel_planning_mcp.server
# 或使用 uvx (如果已发布)
uvx travel-planning-mcp
4. Web 界面使用
# 启动 Web 界面(直接调用版)
python web_direct.py
# 访问 http://127.0.0.1:5000
🧪 测试
# 测试工具函数
python simple_test.py
# 测试 MCP 连接
python test_server.py
📝 工具使用示例
计算旅行预算
{
"destination": "北京",
"days": 5,
"accommodation_level": "中档",
"include_flights": true
}
推荐景点
{
"city": "成都",
"interests": "美食",
"days": 3
}
生成行程
{
"destination": "上海",
"start_date": "2026-02-01",
"days": 3,
"pace": "轻松"
}
🔧 开发
项目结构
mcp_Server/
├── travel_planning_mcp/ # MCP Server 包
│ ├── __init__.py
│ └── server.py # 主服务器代码
├── templates/ # Web 界面模板
├── web_direct.py # Web 服务(直接调用)
├── web_client.py # Web 服务(MCP 协议)
├── simple_test.py # 简单测试
├── test_server.py # MCP 连接测试
├── pyproject.toml # 项目配置
└── README.md
添加新工具
在 travel_planning_mcp/server.py 中:
@mcp.tool()
def your_new_tool(param1: str, param2: int) -> str:
"""工具描述"""
# 实现逻辑
return result
📄 许可证
MIT License
🤝 贡献
欢迎提交 Issue 和 Pull Request!
Metadata
Release files for travel-planning-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| travel_planning_mcp-0.1.0.tar.gz | 65.9 kB | Without provenance | Details for travel_planning_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| travel_planning_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for travel_planning_mcp-0.1.0-py3-none-any.whl |
Total release size: 74.3 kB
Release files / travel_planning_mcp-0.1.0.tar.gz
| Download URL | travel_planning_mcp-0.1.0.tar.gz |
|---|---|
| Size | 65.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4aa6e4431d5f839c065605c77815e851516d352d254e8c930d16448691095c8
|
|
BLAKE2b-256 checksum How to use checksums |
0490b2e02f9b96492fba0738f409fef076ab79445c3d6268f560e66f81889a51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|
Release files / travel_planning_mcp-0.1.0-py3-none-any.whl
| Download URL | travel_planning_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e1a4aacdaa7754e142594cb36279ff4c46c605a9a036b1a1ad78ae697d7ed96
|
|
BLAKE2b-256 checksum How to use checksums |
84dd3117128e0a91d160f727ab52ec7c246cce873852fc41f521c76357558f99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|
Security for travel-planning-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.