mcp-server-12306
by drfccv·★ 327·Score 50
A high-performance 12306 train ticket query system that provides real-time data via MCP protocol.
Overview
The MCP Server 12306 is a Python-based backend that integrates with China's official 12306 railway booking system through the Model Context Protocol. It provides comprehensive train ticket information including seat availability, station details, transfer options, and pricing. The server supports both stdio and HTTP modes for flexible deployment, with FastAPI ensuring high performance and quick response times. It's designed specifically for AI assistants and automation systems that need access to railway data.
Try asking AI
After installing, here are 3 things you can ask your AI assistant:
When to choose this
Choose this MCP server for AI applications needing real-time Chinese train ticket information, especially when integrating with Claude Desktop or requiring low-latency access to 12306 data.
When NOT to choose this
Avoid if you need commercial use, international train data beyond China, or require write capabilities to modify train schedules or bookings.
Tools this server exposes
7 tools extracted from the READMEquery_tickets余票/车次/座席/时刻一站式查询
query_ticket_price实时查询各车次票价信息
search_stations车站模糊搜索,支持中文/拼音/简拼
get_station_info获取车站详情(名称、代码、地理等)
query_transfer一次中转换乘方案,自动拼接最优中转
get_train_route_stations查询指定列车经停站及时刻表
get_current_time获取当前时间与相对日期,帮助用户准确选择出行日期
Comparable tools
Installation
Installation
Mode 1: Stdio Mode (Recommended for Claude Desktop)
Using uvx:
{
"mcpServers": {
"12306": {
"command": "uvx",
"args": ["mcp-server-12306"]
}
}
}Using pipx:
{
"mcpServers": {
"12306": {
"command": "pipx",
"args": ["run", "--no-cache", "mcp-server-12306"]
}
}
}Mode 2: HTTP Mode
git clone https://github.com/drfccv/mcp-server-12306.git
cd mcp-server-12306
uv sync
uv run python scripts/start_server.pyClient configuration:
{
"mcpServers": {
"12306": {
"url": "http://localhost:8000/mcp"
}
}
}Compare mcp-server-12306 with
Last updated · Auto-generated from public README + GitHub signals.