同程旅行 MCP Server v2.0.0
🏨 ✈️ 🚄 🚌 🏞️ 🚀 🧳 🤖
基于 fastmcp 构建的同程旅行 MCP 服务,提供 8 个结构化工具,覆盖酒店、机票、火车票、汽车票、景点、交通、跟团游和智能问答。
数据来源:同程旅行 DeepTrip API(通过 SCF 代理安全调用)。
功能特性
| 工具 | 说明 | 必填参数 |
|---|---|---|
hotelSearch |
酒店搜索 | destination |
flightSearch |
机票查询 | departure, destination |
trainSearch |
火车票查询 | departure, destination |
busSearch |
汽车票查询 | departure, destination |
scenerySearch |
景点门票搜索 | destination |
trafficSearch |
交通出行综合查询 | departure, destination |
travelSearch |
跟团游/度假搜索 | destination |
smartQuery |
DeepTrip 智能问答 | query |
所有工具名和参数名均为 camelCase;调用 SCF 代理时自动转为 snake_case。
安装
pip install mcp-tongcheng-travel
使用方式
方式一:命令行
mcp-tongcheng-travel
# 或
python -m mcp_tongcheng_travel
方式二:代码调用
from mcp_tongcheng_travel import mcp, main
# 直接运行 MCP Server
main()
方式三:MCP 配置(如 Claude Desktop)
在 claude_desktop_config.json 中添加:
{
"mcpServers": {
"tongcheng-travel": {
"command": "mcp-tongcheng-travel"
}
}
}
环境变量
| 变量 | 必填 | 默认值 | 说明 |
|---|---|---|---|
PROXY_URL |
否 | 内置 SCF 代理地址 | SCF 代理服务地址 |
PROXY_TOKEN |
否 | tp_8k2mX9vQ4z |
SCF 代理认证 Token |
DEEPTRIP_URL |
否 | https://dtgw.ly.com/deeptrip/claw/chat |
DeepTrip API 地址 |
DEEPTRIP_API_KEY |
否 | (空) | DeepTrip API Key |
DEEPTRIP_CHANNEL |
否 | clawhub_Intl |
DeepTrip 渠道标识 |
工具示例
酒店搜索
hotelSearch(destination="成都", checkInDate="2026-09-01", checkOutDate="2026-09-03", keyword="春熙路")
机票查询
flightSearch(departure="上海", destination="北京", departureDate="2026-09-01")
智能问答
smartQuery(query="帮我规划三天两晚三亚自由行")
版本历史
- v2.0.0 — 重大升级:基于 fastmcp 重写,从单 query 工具扩展为 8 个结构化工具,对齐 SCF 代理 7 路由 + DeepTrip 智能问答
- v1.x.x — 基于 mcp SDK 的单工具版本
License
MIT
Metadata
Release files for mcp-tongcheng-travel 2.0.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 | |
|---|---|---|---|---|
| mcp_tongcheng_travel-2.0.0.tar.gz | 10.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_tongcheng_travel-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / mcp_tongcheng_travel-2.0.0.tar.gz
| Download URL | mcp_tongcheng_travel-2.0.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
237327d38da12e4764fadf1840e4be539e6e93252797e579abe7ca0a42671d51
|
|
BLAKE2b-256 checksum How to use checksums |
28b7f75db43e4b989afea017e90f97337d508545f7b3347ff6ddf7f7d6a06808
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / mcp_tongcheng_travel-2.0.0-py3-none-any.whl
| Download URL | mcp_tongcheng_travel-2.0.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6aa20f007ef81fc0bf0029847395c175c0f2aa2d8b34165381b326fdb1f1ab1f
|
|
BLAKE2b-256 checksum How to use checksums |
dec77edde7c4c955f5c269173824bde42a9afeed392d5bca531ebb806be70ce7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for mcp-tongcheng-travel 2.0.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.