WG Tickets MCP - 航班查询MCP服务
Project description
WG Tickets MCP
航班查询与预定MCP服务,将GDS API桥接到MCP协议,让AI Agent可以直接调用航班查询、价格查询和预定操作。
安装
pip install wgtickets-mcp
# 或
uvx wgtickets-mcp
配置
环境变量(必须配置)
| 变量名 | 说明 | 必填 |
|---|---|---|
| GDS_BASE_URL | API 基础地址 | 是 |
| GDS_DEFAULT_USERID | 默认用户ID | 是 |
| MCP_TRANSPORT | 传输模式: stdio/sse | 否 |
| MCP_HOST | SSE模式监听地址 | 否 |
| MCP_PORT | SSE模式端口 | 否 |
Claude Desktop 配置
{
"mcpServers": {
"wgtickets-mcp": {
"command": "uvx",
"args": ["wgtickets-mcp"],
"env": {
"GDS_BASE_URL": "https://your-api-url",
"GDS_DEFAULT_USERID": "your-user-id"
}
}
}
}
阿里百炼 配置
{
"mcpServers": {
"wgtickets-mcp": {
"command": "uvx",
"args": ["wgtickets-mcp"],
"env": {
"GDS_BASE_URL": "https://your-api-url",
"GDS_DEFAULT_USERID": "your-user-id"
}
}
}
}
Docker 部署
docker build -t wgtickets-mcp .
docker run -d -p 8080:8080 \
-e GDS_BASE_URL=https://your-api-url \
-e GDS_DEFAULT_USERID=your-user-id \
-e MCP_TRANSPORT=sse \
wgtickets-mcp
可用工具
gds_search_flight - 航班搜索
搜索航班并获取航班列表。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| flights | array | 是 | 航程列表 |
| passengers | array | 是 | 乘客类型 ["ADT"] |
| tripType | int | 否 | 0=单程, 1=往返, 2=多程 |
| transfer | bool | 否 | 是否允许转机 |
| carriers | array | 否 | 指定航司代码 |
gds_search_flight_price - 价格查询
查询航班详细价格。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| flightKey | string | 是 | 行程Key |
| flightFareKey | string | 是 | 方案报价Key |
| batchCode | string | 否 | 批次号 |
| passengers | array | 是 | 乘客类型 |
gds_create_pnr - 创建预定
创建PNR预定记录。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| flightKey | string | 是 | 行程Key |
| flightFareKey | string | 是 | 方案报价Key |
| travelers | array | 是 | 乘机人信息 |
gds_query_pnr - 查询预定
查询PNR预定详情。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pnr | string | 是 | PNR号 |
| gds | string | 否 | GDS类型 |
gds_cancel_pnr - 取消预定
取消PNR预定(仅限未出票)。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pnr | string | 是 | PNR号 |
gds_issue_ticket - 出票
为PNR出票。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pnr | string | 是 | PNR号 |
| gds | string | 是 | GDS类型 |
| flightKey | string | 是 | 行程Key |
| flightFareKey | string | 是 | 方案报价Key |
| travelers | array | 是 | 乘机人列表 |
使用流程
1. gds_search_flight → 搜索航班,获取 flightKey/flightFareKey/batchCode
2. gds_search_flight_price → 查询价格详情
3. gds_create_pnr → 创建预定,获取 PNR号
4. gds_query_pnr → 查询预定状态(可选)
5. gds_issue_ticket → 出票
示例
搜索东京到武汉的航班
{
"flights": [
{
"fromAirportCode": "NRT",
"toAirportCode": "WUH",
"deptDate": "2025-04-15"
}
],
"passengers": ["ADT"],
"transfer": true
}
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wgtickets_mcp-0.2.0.tar.gz
(4.1 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wgtickets_mcp-0.2.0.tar.gz.
File metadata
- Download URL: wgtickets_mcp-0.2.0.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58d81478988264fac9236e9888c4794426c76e9c9a95826131f6cf5c0ee6c768
|
|
| MD5 |
a33fd8fd44318d4ff0cdc0fc77dd7d7a
|
|
| BLAKE2b-256 |
63b4e292f70835b82ec1070d84f6d2b819b4b823a1f59178600956f30495c203
|
File details
Details for the file wgtickets_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: wgtickets_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d23e589553bc591d2711ef3c264f1f26faafe287fe52b46b9b47f0a9fe44493
|
|
| MD5 |
081438bc35c000acd9d8cffe7439b996
|
|
| BLAKE2b-256 |
11497141ec4fe4b3a6264362112207c4cb03afcbf1068abb20ac3debf81366f1
|