🚄 12306火车票
专注12306火车票一站式国内旅行助手的MCP服务,10个工具覆盖火车票查询、机票比价、酒店预订、景点门票、美食推荐、市内交通、行程规划、万豪酒店查询全场景,飞猪+高德双引擎实时数据直连。
支持自然语言输入(如"明天上海到北京的高铁票""成都住春熙路附近300左右的酒店"),自动调用对应工具返回结构化数据。10个工具覆盖国内旅行全场景:
▸ search_train — 查火车票/高铁票余票票价时刻表,精准区分G字头高铁与D字头动车 ▸ search_flight — 国内机票实时比价,飞猪+途牛双源 ▸ search_hotel — 酒店实时搜索,飞猪+RG双源比价 ▸ search_marriott_hotel — 万豪集团旗下酒店专项搜索 ▸ get_marriott_hotel_info — 万豪酒店详情查询 ▸ search_poi — 景点门票搜索,高德POI数据 ▸ search_food — 美食餐厅推荐,含评分人均消费 ▸ search_transport — 市内交通方案,公交地铁+高德打车 ▸ plan_trip — 智能行程规划,综合推荐 ▸ search_fast — 极速搜索,一个关键词搜全平台
✨ 核心特性
▸ 精准区分车型 — 查火车票时准确区分G字头高铁与D字头动车,不会混淆车型 ▸ 双引擎实时数据 — 飞猪旅行API(火车票/机票/酒店/景点)+ 高德地图API(美食/交通/打车),所有数据直连OTA实时返回 ▸ 互动推荐闭环 — 查完火车票自动推荐酒店/景点/交通,形成查票→住宿→游玩→出行一站式闭环 ▸ 零配置即用 — MCP URL直连即用,无需额外申请Key,配置即接入
🛠 工具
search_train - 火车票查询
查询火车票/高铁票的余票、价格和时刻表。数据源:12306官方接口+飞猪旅行API,返回实时车次、票价、各座席余票数量。精准区分G字头高铁与D字头动车。
参数:
▸ origin(string,✅必填):出发城市,如上海、北京
▸ destination(string,✅必填):到达城市,如北京、成都
▸ date(string,✅必填):出发日期,如明天、2025-06-20
search_flight - 机票查询
查询国内机票实时价格。数据源:飞猪旅行API+途牛API,多平台比价返回最低价及预订链接,直接调用OTA API获取实时数据。
参数:
▸ origin(string,✅必填):出发城市
▸ destination(string,✅必填):到达城市
▸ date(string,✅必填):出发日期
search_hotel - 酒店搜索
搜索酒店实时价格和评分。数据源:飞猪旅行API+RG酒店API,直接调用OTA API返回实时房价+预订链接。
参数:
▸ destination(string,✅必填):目的地城市
▸ checkIn(string,✅必填):入住日期
▸ checkOut(string,✅必填):离店日期
search_marriott_hotel - 万豪酒店搜索
搜索万豪集团旗下酒店实时价格。支持万豪/喜来登/JW/威斯汀/丽思卡尔顿/万怡等品牌。数据源:RG万豪API。
参数:
▸ destination(string,✅必填):目的地城市
▸ checkIn(string,选填):入住日期
▸ checkOut(string,选填):离店日期
get_marriott_hotel_info - 万豪酒店详情
获取万豪酒店详细信息,包括房型、价格、设施和预订链接。数据源:RG万豪API。
参数:
▸ hotelName(string,选填):酒店名称
▸ hotelId(string,选填):酒店ID
search_poi - 景点门票搜索
搜索景点门票和旅游信息。数据源:高德地图POI搜索API,返回景点详情+门票预订链接。
参数:
▸ keyword(string,✅必填):景点关键词
▸ city(string,选填):所在城市
search_food - 美食推荐
搜索附近美食餐厅。数据源:高德地图POI搜索API,返回评分、人均消费和地址。
参数:
▸ location(string,✅必填):位置,如外滩、三里屯
▸ city(string,✅必填):所在城市
▸ keyword(string,选填):菜系筛选,如火锅、日料
search_transport - 市内交通
查询市内交通方案。数据源:高德地图路线规划API,返回公交/地铁路线+高德打车唤端链接+打车费用预估。
参数:
▸ origin(string,✅必填):出发地
▸ destination(string,✅必填):目的地
▸ city(string,✅必填):所在城市
plan_trip - 智能行程规划
根据目的地和天数生成完整旅行攻略。综合调用火车票+机票+酒店+景点+美食数据推荐。
参数:
▸ destination(string,✅必填):目的地,如成都、厦门
▸ days(string,✅必填):旅行天数
search_fast - 极速搜索
一个关键词同时搜索酒店、景点、机票。数据源:飞猪+高德联合查询。
参数:
▸ keyword(string,✅必填):搜索关键词
📝 使用示例
▸ "明天上海到北京的高铁票" → search_train ▸ "北京到成都机票" → search_flight ▸ "成都住春熙路附近300左右的酒店" → search_hotel ▸ "上海外滩附近有什么好吃的" → search_food ▸ "从浦东机场怎么去虹桥火车站" → search_transport ▸ "成都5天行程规划" → plan_trip
变更日志
v2.0.0 (2026-08-26)
- 破坏性变更:所有对外 MCP 参数统一为 camelCase 命名,与其他 MCP 保持产品风格统一
checkin→checkIncheckout→checkOuthotel_name→hotelNamehotel_id→hotelId
- 构建工具从 hatchling 切换为 setuptools
- 返回值内部字段也统一为 camelCase 风格
v1.0.0 (2025-06-16)
- 初始版本发布,10个工具覆盖火车票/机票/酒店/景点/美食/交通/行程规划/万豪酒店全场景
适用场景
- AI编程助手:在Cursor/Windsurf中直接调用火车票查询,为旅行项目提供实时数据
- 旅行智能体:给旅行AI Agent接上12306能力,实现查票→酒店→景点→出行端到端闭环
- 对话式旅行应用:自然语言输入即可获得火车票+酒店+景点推荐
- 与其他旅行MCP联动:搭配酒店/景点MCP服务,构建一站式旅行方案
Metadata
Release files for mcp-train-ticket 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_train_ticket-2.0.0.tar.gz | 11.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_train_ticket-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.0 kB
Release files / mcp_train_ticket-2.0.0.tar.gz
| Download URL | mcp_train_ticket-2.0.0.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57f4278d088675c32197be4f8672700d9b38992347737f888dfb63fb522ffbec
|
|
BLAKE2b-256 checksum How to use checksums |
b8d73c468dbc51678ee5035a33c9f219e4d3051da6febb027141fe5219a537bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / mcp_train_ticket-2.0.0-py3-none-any.whl
| Download URL | mcp_train_ticket-2.0.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f7faafc4506f75648f2bbcfc75b02698b86eaac1898419a0fbf515fc07d3a46
|
|
BLAKE2b-256 checksum How to use checksums |
c16656aa511039af061950ce009eea3e642b396e4548db3fe6b66b28722b0a77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for mcp-train-ticket 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.