Data as of

12306 MCP for Claude Desktop: Setup & Config

12306 MCP lets Claude Desktop search Chinese railway ticket availability and train routes.

What you can do with 12306 in Claude Desktop

A focused 12306 search interface with station resolution, transfer queries, and stop-by-stop details.

  • Find direct train-ticket availability for a travel request.
  • Compare available transfer itineraries.

Before you start: 12306 in Claude Desktop

  • Node.js and npx
  • An MCP-compatible client

Uses the README's CLI-stdio example. HTTP operation is documented with a --port argument, and Docker build/run examples cover both modes. No required environment variables or minimum Node.js version are stated.

12306 Claude Desktop configuration

  1. Choose Claude Desktop configuration scope

    For 12306 MCP, open macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json. Merge under mcpServers via Settings → Developer → Edit Config when available.

  2. Add 12306 MCP to Claude Desktop

    Use the 12306-mcp entry below in mcpServers. Keep 12306 MCP's documented stdio connection fields and your other Claude Desktop entries.

  3. Check 12306 MCP in Claude Desktop

    12306 MCP: Fully quit and reopen Claude Desktop; check developer diagnostics.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

JSON
{
  "mcpServers": {
    "12306-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "12306-mcp"
      ],
      "env": {}
    }
  }
}

12306 tools available to Claude Desktop

12306's stored tool list documents 8 tools; compare it with Claude Desktop's connected tool list, because the stored list is not a live check.

get-current-date

When Claude Desktop requests get-current-date from 12306, review the action before approving it.

Return the current Shanghai-time date for resolving relative travel dates.

get-stations-code-in-city

When Claude Desktop requests get-stations-code-in-city from 12306, review the action before approving it.

List all train stations and their codes for a Chinese city name.

get-station-code-of-citys

When Claude Desktop requests get-station-code-of-citys from 12306, review the action before approving it.

Resolve Chinese city names to representative station codes.

get-station-code-by-names

When Claude Desktop requests get-station-code-by-names from 12306, review the action before approving it.

Resolve specific Chinese station names into station names and codes.

get-station-by-telecode

When Claude Desktop requests get-station-by-telecode from 12306, review the action before approving it.

get-tickets

When Claude Desktop requests get-tickets from 12306, review the action before approving it.

get-interline-tickets

When Claude Desktop requests get-interline-tickets from 12306, review the action before approving it.

get-train-route-stations

When Claude Desktop requests get-train-route-stations from 12306, review the action before approving it.

12306: full stored tool descriptions

Troubleshooting 12306 in Claude Desktop

  • Fully quit and reopen Claude Desktop for 12306 MCP. If npx 12306-mcp (Node.js/npm) is missing, check the desktop process's PATH, which may differ from your terminal.
  • 12306 MCP uses stdio here: Claude Desktop must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
  • Known limitation: The transfer query is limited to the first ten results.
  • Known limitation: Booking and payment operations are not documented.
  • Known limitation: The README frames the project as a learning tool.
  • General Claude Desktop troubleshooting lives in the /clients/claude-desktop guide.

12306 MCP — details. Claude Desktop guide

Frequently asked questions

Claude Desktop loads 12306 MCP from claude_desktop_config.json: ~/Library/Application Support/Claude/ on macOS, or %APPDATA%\Claude\ on Windows. Open it via Settings → Developer → Edit Config when available.

Claude Desktop's 12306-mcp example uses stdio.

12306 MCP's Claude Desktop configuration invokes npx 12306-mcp (Node.js/npm).

12306 MCP's stored list contains 8 tools, including get-current-date, get-stations-code-in-city, get-station-code-of-citys. Compare those names with Claude Desktop's connected tool list; the stored list is not a live check.

The supplied README and tools describe searches and timetable lookups, not ticket booking or payment.

Yes. get-interline-tickets searches transfer availability, with a documented limit of the first ten results.