High-performance Python MCP server for 12306 — real-time tickets, prices, station search, train routes, and transfer planning.
mcp-server-12306 is a FastAPI-based MCP server providing real-time data from China's 12306 railway system. It offers 7 tools for ticket queries, price lookups, station search (Chinese/pinyin/abbreviation), train route stops, transfer planning, and time utilities. Supports both stdio (Claude Desktop) and Streamable HTTP modes, with Docker deployment and sub-second response times.
claude mcp add mcp-server-12306-2 -- TODO 'See README: https://github.com/drfccv/mcp-server-12306'
ワンライナー。claude mcp list で確認、claude mcp remove で削除。
ユースケース
実用的な使い方: mcp-server-12306
How to compare train ticket prices for a journey with mcp-server-12306
👤 Budget-conscious travelers in China⏱ ~5 minbeginner
使うタイミング: You want to find the cheapest option for your train journey.
前提条件
mcp-server-12306 running — uvx mcp-server-12306 or Docker: docker run -p 8000:8000 drfccv/mcp-server-12306:latest
フロー
Search tickets with prices
Query tickets from Beijing to Guangzhou for tomorrow. Show all available trains with prices for each seat class.✓ コピーしました
→ Table of trains with departure times, durations, and prices per seat class
Get detailed pricing
Show me the detailed pricing for train G79, including all seat types.✓ コピーしました
→ Complete fare breakdown for the specific train
結果: Clear price comparison to choose the best value train.
注意点
Prices may vary by date and availability — Check availability alongside prices — cheap seats sell out first
Plan a multi-city train trip across China
👤 Tourists planning a scenic route through multiple Chinese cities⏱ ~15 minbeginner
使うタイミング: You want to visit several cities and need to plan the train connections.
前提条件
mcp-server-12306 running — uvx mcp-server-12306
フロー
Search stations
Search for the main train stations in Shanghai, Hangzhou, and Suzhou. Show me the station codes.✓ コピーしました
→ Station names and codes for each city
Plan the route
Find the fastest train connections for: Shanghai → Hangzhou → Suzhou → back to Shanghai, spending one day in each city. Show departure times and durations.✓ コピーしました
→ Complete itinerary with train numbers and times
結果: A multi-city itinerary with all train connections planned.
注意点
Small cities may only have one station — Use the station search to confirm available stations before planning