12306-MCP
A Model Context Protocol server that allows large language models to search for and analyze Chinese railway (12306) tickets through a simple API interface.
README
<p align="center"><img src= "https://cdn.canghecode.com/blog/12306-mcp-logo.png" alt="MaxKB" width="300" /></p>
<h3 align="center">一个基于MCP的12306购票搜索服务器</h3>
<p align="center">
<a href="https://opensource.org/license/MIT"><img src="https://img.shields.io/github/license/freestylefly/12306-mcp?color=rgb(25%2C%20121%2C%20255)" alt="The MIT License"></a>
<a href=""><img src="https://img.shields.io/github/forks/freestylefly/12306-mcp?color=green" alt="Forks"></a>
<a href="https://canghecode.com/"><img src="https://img.shields.io/badge/介绍-%E5%AE%98%E7%BD%91-green" alt="Official"></a>
<a href="https://mp.weixin.qq.com/s/j6c_GjV7nqNTsCpRXMw5tw"><img src="https://img.shields.io/github/stars/freestylefly/12306-mcp?style=flat-square&color=rgb(25%2C%20121%2C%20255)" alt="Stars"></a>
<a href="https://mp.weixin.qq.com/s/j6c_GjV7nqNTsCpRXMw5tw"><img src="https://img.shields.io/badge/12306 MCP-教程-blue" alt="Experience"></a>
</p>
<hr/>
A 12306 ticket search server based on the Model Context Protocol (MCP). The server provides a simple API interface that allows users to search for 12306 tickets.
基于 Model Context Protocol (MCP) 的12306购票搜索服务器。提供了简单的API接口,允许大模型利用接口搜索12306购票信息。
<div align="center">🔥应用</div>
1、在 Cursor 中使用
可以智能选票还能生成途径站点可视化地图!
教程:Cursor + 12306 MCP,实现AI智能选票还能生成精美网站

在yb.html中可直接用浏览器打开

2、用阿里云百炼做智能体
教程:阿里百炼+12306 MCP,打造AI智能选票智能体,超酷的!

我在后天想从西安出发去往郑州,请推荐出合理的车票,并推荐三天后返程的车票,

还能对比各个列车票价,做个图表,更直观了。

同样能让他生成列车停靠站点地图:

还能生成途径站点的旅行攻略。这里我的逻辑是先让他去网上搜,搜不到就调用文生图模型,由 AI 生成图片。

阿里自带的这个生图 MCP 感觉能力还是挺强的。

感觉跟真的也差不多啊,哈哈哈。

说实话,在火车上看着自己坐的这一趟列车途径的城市,看着这些景点,心中难免有一丝丝的冲动。

<div align="center">🚩Features</div>
<div align="center">
| 功能描述 | 状态 |
|---|---|
| 查询12306购票信息 | ✅ 已完成 |
| 过滤列车信息 | ✅ 已完成 |
| 过站查询 | ✅ 已完成 |
| 中转查询 | ✅ 已完成 |
| 其余接口,欢迎提feature | 🚧 计划内 |
</div> <div align="center"> <img src="https://cdn.canghecode.com/blog/20250526112720.png" width=800px/> </div> <div align="center"> <img src="https://cdn.canghecode.com/blog/20250526113041.png" width=800px/> </div>
<div align="center">⚙️Installation</div>
git clone https://github.com/freestylefly/12306-mcp.git
npm i
<div align="center">▶️Quick Start</div>
CLI
npm run build
node ./build/index.js
MCP sever configuration
{
"mcpServers": {
"12306-mcp": {
"command": "npx",
"args": [
"-y",
"12306-mcp"
]
}
}
}
<div align="center">👉️Reference</div>
<div align="center">💭Murmurs</div>
本项目原自12306-MCP ,感谢作者,本项目仅用于学习,欢迎催更。
<div align="center">👉️友情链接</div>
- mcp-server-weread :🚀基于 Model Context Protocol (MCP) 的12306购票搜索服务器。提供了简单的API接口,允许大模型利用接口搜索12306购票信息。
- 12306-MCP :🚀一个为微信读书提供MCP(Model Context Protocol)服务的工具,支持将微信读书的书籍、笔记和划线数据提供给支持MCP的大语言模型客户端,如Claude Desktop。
- CodeCanvas :📚本代码仓库是作者苍何多年从事一线互联网Java开发的学习历程技术汇总,旨在为大家提供一个清晰详细的学习教程,侧重点更倾向编写Java核心内容。💪🏻
- PmHub :🔥PmHub 是一套基于 SpringCloud & LLM 的微服务智能项目管理系统,这个项目旨在帮助小伙伴们快速掌握微服务/分布式项目的架构设计和开发流程,如果想在校招或者社招中拿到一个满意的 offer,PmHub 将是一个非常 nice 的选择。
star 趋势图
公众号
微信搜 苍何 或扫描下方二维码关注苍何的原创公众号,回复 AI 即可和 5000+ 好友一同探讨AI,一同学习MCP。

开源协议
MIT License (MIT)<hr/> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Copyright (c) 2025-2026 12306-MCP
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。