Data as of

12306 MCP for Windsurf: Setup & Config

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

What you can do with 12306 in Windsurf

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

  • Compare available transfer itineraries.
  • Inspect a train's intermediate stops and timetable details.

Before you start: 12306 in Windsurf

  • 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 Windsurf configuration

  1. Choose Windsurf configuration scope

    For 12306 MCP, open macOS/Linux: ~/.codeium/windsurf/mcp_config.json Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json. Merge into mcpServers; remote endpoints use serverUrl.

  2. Add 12306 MCP to Windsurf

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

  3. Check 12306 MCP in Windsurf

    12306 MCP: Refresh MCP in Windsurf settings and inspect Cascade’s tools.

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

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

12306 tools available to Windsurf

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

get-current-date

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-current-date.

get-stations-code-in-city

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-stations-code-in-city.

get-station-code-of-citys

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-station-code-of-citys.

Resolve Chinese city names to representative station codes.

get-station-code-by-names

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-station-code-by-names.

Resolve specific Chinese station names into station names and codes.

get-station-by-telecode

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-station-by-telecode.

get-tickets

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-tickets.

get-interline-tickets

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-interline-tickets.

Query transfer-ticket availability, currently limited to the first ten results.

get-train-route-stations

After refreshing 12306 in Windsurf settings, check Cascade's tool list for get-train-route-stations.

Inspect a train's stops, arrival and departure times, and dwell durations within an interval.

12306: full stored tool descriptions

Troubleshooting 12306 in Windsurf

  • Check npx 12306-mcp (Node.js/npm) on the machine running Windsurf's MCP integration for 12306 MCP; refresh MCP and inspect Cascade's tools.
  • 12306 MCP uses stdio here: Windsurf 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 Windsurf troubleshooting lives in the /clients/windsurf guide.

12306 MCP — details. Windsurf guide

Frequently asked questions

Windsurf reads 12306 MCP under mcpServers in ~/.codeium/windsurf/mcp_config.json on macOS/Linux; Windows uses %USERPROFILE%\.codeium\windsurf\mcp_config.json.

Windsurf's 12306-mcp example uses stdio.

12306 MCP's Windsurf 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 Windsurf's connected tool list; the stored list is not a live check.

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

Yes. The route-station tool returns stops and arrival, departure, and dwell information for a selected interval.