What it takes off you is the lookup: turn a city into the station codes the timetable actually uses, ask what is left on the day you mean, and read a train's stops and times back — including the connecting itineraries you would otherwise have to construct yourself.
A query layer over 12306, China Railway's own ticketing site. At startup it pulls the national station list from 12306 and indexes it by city, station name and code; every answer after that is a live lookup — seat availability, transfers, and a train's calling pattern.
- The station code for a Chinese city, or every station that city has, or the code for a station you can name exactly
- A station's full record from its code — name, pinyin and the city it belongs to
- Remaining tickets for a date and a route, filtered by train type and capped by the arguments you pass
- Transfer itineraries where no direct train runs, with a specific interchange station if you name one — the first ten of them
- A train's stops over a stretch of its route, with arrival, departure and dwell time at each one
- Today's date in Shanghai time, so "tomorrow" becomes a date the other calls accept
Node.js 18 or newer and npx on your PATH; `npx -y 12306-mcp --port` runs it over HTTP instead of stdio, and a Dockerfile is in the repository. Everything it answers comes from 12306 at request time, so it needs network access, and the station and train names it takes and returns are the Chinese ones. Ticket queries are rejected for a date earlier than today, which is what the date call is there to settle.
One command — npx -y 12306-mcp
