mcp-server-12306 — Claude Code skill: what it does, how to install
Enables AI agents to query China Railway 12306 services. Checks real-time train availability, seat prices, schedules, and transfer routes.
no license 167 installs ★ 9 updated 2026-10-09
npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a claude-codeWhat mcp-server-12306 does
This skill equips coding assistants with tools to interface with the China Railway 12306 booking system through Model Context Protocol. It guides models on formulating requests for train classes like G, D, K, T, and Z, checking remaining seat inventory, and translating station queries supplied in pinyin or Chinese characters.
The server implementation uses FastAPI to handle async queries. Tool definitions cover searching direct connections, planning trips with a single interchange, retrieving stop sequences with layover durations, and computing booking windows under the Asia/Shanghai timezone.
A functioning transport layer is necessary: either configure the stdio command with uvx in your client configuration or keep the HTTP daemon alive on http://localhost:8000/mcp. Without that running backend, the assistant cannot retrieve live schedule data.
What it helps with
- search live train seat availability across Chinese rail stations
- calculate ticket prices in CNY for specific carriage classes
- find one-transfer train combinations between distant cities
- resolve railway station telecodes using pinyin keywords
- inspect complete stop lists and arrival timings for scheduled trains
Example prompts for the agent
- Check available seats on trains from Beijing to Shanghai for 2025-06-15
- Search transfer connections between Beijing and Guilin for adult tickets on 2025-06-20
- Get all scheduled stop stations and timings for train G101
How to install mcp-server-12306
1Skills CLI (Vercel)
npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a claude-code2Manually: put the files in place
~/.claude/skills/mcp-server-12306/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mcp-server-12306/
1Skills CLI (Vercel)
npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a codex2Manually: put the files in place
.agents/skills/mcp-server-12306/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a cursor2Manually: put the files in place
.cursor/skills/mcp-server-12306/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install reason-machines/mcp-skills skills/mcp-server-123062Manually: put the files in place
.github/skills/mcp-server-12306/SKILL.md1Skills CLI (Vercel)
npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a gemini-cli2Platform CLI
gemini skills install https://github.com/reason-machines/mcp-skills --path skills/mcp-server-12306Manually: put the files in place
.devin/skills/mcp-server-12306/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about mcp-server-12306
How to install mcp-server-12306 in Claude Code?
Run npx skills add reason-machines/mcp-skills --skill mcp-server-12306 -a claude-code. The definition will be added to ~/.claude/skills/mcp-server-12306/SKILL.md.
What does mcp-server-12306 do?
It gives your agent access to China Railway 12306 endpoints to search train departures, seat pricing, transit transfers, and station records.
What infrastructure is needed to make queries work?
You must register the backend in your MCP settings via uvx mcp-server-12306 or spin up the Docker container drfccv/mcp-server-12306:latest mapped to port 8000.