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
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.
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.
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
{
"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.
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