Skip to main content
MCP server CX Codex

12306 Ticket Search Server — Claude Code MCP

12306 Ticket Search Server — an MCP server that connects AI agents to China's 12306 rail network. Search for direct routes, transfer options, and train schedules in real time.

no license 1,829 installs updated 2025-07-07

Install into Claude Code · Platform CLI: remote server All methods and platforms ↓
claude mcp add --transport http rail https://rail--deniselewis200081.run.tools
Open on GitHub

What 12306 Ticket Search Server does

The server exposes eight tools for querying rail data. You can fetch the current date to parse relative dates, look up stations by city name or specific station name, resolve station codes for origin and destination, then search available tickets as direct journeys or routes with transfers. A separate tool queries route details: which stations a train stops at, arrival and departure times, and layover duration.

One built-in constraint: transfer search returns a maximum of ten results. On busy routes with many connection options, this may not cover all viable alternatives.

The server runs at https://rail--deniselewis200081.run.tools and integrates with Claude Code, Codex, Cursor, GitHub Copilot, Windsurf, Cline, Zed, and Gemini CLI.

What it helps with

  • search for available trains between two cities or specific stations
  • find connections and alternative routes with transfers
  • retrieve detailed stop information for a particular train
  • convert city names to railway station codes

Example prompts for the agent

  • Find tickets from Beijing to Shanghai for tomorrow
  • What transfer options exist from Guangzhou to Chengdu next Monday?
  • Which stations does train D2718 stop at between Beijing and Shanghai?

How to install 12306 Ticket Search Server

Platform CLI: remote server

claude mcp add --transport http rail https://rail--deniselewis200081.run.tools

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about 12306 Ticket Search Server

How do I install 12306 Ticket Search Server?

Installation steps depend on your tool. For Claude Code, run claude mcp add --transport http rail https://rail--deniselewis200081.run.tools or claude mcp add --transport http 12306-ticket-search-server https://rail--deniselewis200081.run.tools. For Codex: codex mcp add 12306-ticket-search-server --url https://rail--deniselewis200081.run.tools. Cursor and GitHub Copilot require a configuration entry with the server URL. For Gemini CLI: gemini mcp add -t http 12306-ticket-search-server https://rail--deniselewis200081.run.tools.

What does this server do?

It gives AI agents access to live 12306 ticket availability, schedules, and route information. You can query trains by city or station name, retrieve direct and transfer options, and check which stops a specific train makes.

Are there limits on search results?

Yes. Transfer queries return a maximum of ten results, which may be insufficient on high-traffic routes with many connection possibilities.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open