Skip to main content

同程旅行 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-tongcheng-travel 2.0.1
File Size Uploaded Provenance
mcp_tongcheng_travel-2.0.1.tar.gz 10.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-tongcheng-travel 2.0.1
File Interpreter ABI Platform
mcp_tongcheng_travel-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / mcp_tongcheng_travel-2.0.1.tar.gz

Download URL mcp_tongcheng_travel-2.0.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1d9c03095637b5082364dfef6d20aa1524761c450687f50abd4b66c3cd1c5289
BLAKE2b-256 checksum
How to use checksums
2b1ca82271e92c8d85c40346759bd5ade6840c390a374f857257d2c41f772432
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.1-py3-none-any.whl

Download URL mcp_tongcheng_travel-2.0.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79e35269051eef739509630c70c09c1d6d44a6b4069bf0814a01d1bbbe64da79
BLAKE2b-256 checksum
How to use checksums
af5ff2e904d978fac7062abe02ed5196def73cc56f72be3620b37eac7d38fb7c
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.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page