Metadata-Version: 2.4
Name: mcp-tongcheng-travel
Version: 2.0.1
Summary: 同程旅行 MCP Server - 酒店/机票/火车票/汽车票/景点/交通/跟团游/智能问答 (fastmcp)
Author: mako2026
License: MIT
Project-URL: Homepage, https://www.ly.com/
Project-URL: Repository, https://github.com/mako2026/mcp-tongcheng-travel
Keywords: mcp,fastmcp,tongcheng,travel,hotel,flight,train,scenery,deeptrip
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=2.0.0

# 同程旅行 MCP Server v2.0.0

🏨 ✈️ 🚄 🚌 🏞️ 🚀 🧳 🤖

基于 [fastmcp](https://github.com/jlowin/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。

## 安装

```bash
pip install mcp-tongcheng-travel
```

## 使用方式

### 方式一：命令行

```bash
mcp-tongcheng-travel
# 或
python -m mcp_tongcheng_travel
```

### 方式二：代码调用

```python
from mcp_tongcheng_travel import mcp, main

# 直接运行 MCP Server
main()
```

### 方式三：MCP 配置（如 Claude Desktop）

在 `claude_desktop_config.json` 中添加：

```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
