Skip to content
MCP Shelf

Searches China Railway 12306 for trains, seats, stops and transfers.

  • Started in our test
  • ★ 2.4K GitHub stars
  • 4.3K downloads a week
  • Last commit 31 Jul 2026

At a glance

12306 is the official booking site for China Railway. This server by Joooook lets an assistant look up trains between two stations on a date, filter them by train type or departure time, see which seats are left, list every stop a train makes, and find journeys with a change of train. It reads the same public data the 12306 website shows, so no account or key is needed.

It only searches. It cannot book or pay for tickets, so you still buy them on 12306 or its app. The author describes it as a learning project, and the tool descriptions and station names are in Chinese.

Made by
Joooook (community project)
Licence
MIT
Latest version
0.3.10 (30 Jul 2026)
npm package
12306-mcp
GitHub stars
2.4K
Downloads
4.3K a week
Last commit
31 Jul 2026
Tools
8
Runs on
Your computer

Our check: We ran this exact config on 22 Oct 2026: it started and answered with 8 tools.

What's in the pod: its tools

We found 8 tools in its source code on 27 Oct 2026. Every one of them only reads, so nothing changes unless you act on what it finds.

How we tested it: Tool list read from the source of 12306-mcp 0.3.10. The server downloads its station list from 12306.cn as it starts, which our current sandbox cannot reach.

Only reads8 tools · Looks things up and changes nothing.

ToolWhat it is for
get-current-dateReturns today's date in China time, so the model can work out dates such as tomorrow or next Wednesday.
get-interline-ticketsFinds journeys with one change of train, returning the first ten.
get-station-by-telecodeReturns the details of a station from its three-letter code.
get-station-code-by-namesLooks up station codes from exact Chinese station names, such as 北京南.
get-station-code-of-citysReturns the main station code for one or more cities.
get-stations-code-in-cityLists every station in a city, by its Chinese name, with their station codes.
get-ticketsSearches trains between two stations on a date, with seats left, filters by train type and departure time, and sorting.
get-train-route-stationsLists every stop on a train's route with arrival, departure and stop times.

Grouped and described by us. The README on GitHub lists the inputs each tool takes.

Set it up

Pick your app for the exact snippet and where it goes.

Where it goes: claude_desktop_config.json (Settings → Developer → Edit Config)

Claude Desktop
{
  "mcpServers": {
    "12306": {
      "command": "npx",
      "args": [
        "-y",
        "12306-mcp"
      ]
    }
  }
}

Add "--port", "8080" to the args to serve it over HTTP instead of stdio.

New to this? See the setup guides for Claude Code, Cursor, Claude Desktop and ChatGPT.

Settings

Names are exactly as the project spells them. Required ones are marked.

SettingWhat it does
--portCommand line flagServes it over HTTP (streamable HTTP and SSE) on this port instead of stdio.--port 8080
--hostCommand line flagThe address to listen on in HTTP mode. Defaults to localhost.--host 0.0.0.0

What it can touch

It can read

  • Public timetable and seat availability data from 12306.cn

It can change

    Safer setup: It only reads public data. It cannot log in, book or pay.

    Before you start

    • Node.js 18 or newer

    If it does not work

    It quits as soon as it starts
    It downloads the station list from 12306.cn on start. Check that the machine can reach 12306.cn, which can be slow or blocked from some networks.
    A station is not found
    Use the Chinese station name, such as 上海虹桥, or look up the code with get-station-code-by-names first.
    Dates come out wrong
    Ask the model to call get-current-date first; it works in China time.

    Peas in a pod: similar servers

    How 12306 MCP lines up against other knowledge and work apps servers on the shelf.

    ServerToolsRuns onLicenceStars
    12306 MCP8Your computerMIT2.4K
    Notion24Your computer or hostedMIT4.7K
    MCP Atlassian (Jira and Confluence)98Your computer–6K
    Basic Memory27Your computerAGPL-3.0-or-later4.4K
    LinkedIn MCP Server20Your computerApache-2.04K

    Questions

    Can it buy tickets?

    No. It only searches, so book on 12306 or its app.

    Does it need a 12306 account?

    No. It reads the same public data the website shows before you sign in.

    Does it work in English?

    You can ask in English, but tool descriptions and station names are in Chinese, so models that read Chinese do best.

    Is it affiliated with China Railway?

    No. It is a personal learning project by its author.

    Full docs on GitHubJoooook/12306-mcp

    Something wrong on this page? Tell us.

    More in Knowledge and work apps