# 12306 Ticket Search Server

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · 1829 installs
- Author: DeniseLewis200081
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://smithery.ai/server/DeniseLewis200081/rail
- Updated: 2025-07-07
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/12306-ticket-search-server

## What it 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.

## Requirements
- Remote server: `https://rail--deniselewis200081.run.tools`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http rail https://rail--deniselewis200081.run.tools
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add 12306-ticket-search-server --url https://rail--deniselewis200081.run.tools
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "12306-ticket-search-server": {
            "url": "https://rail--deniselewis200081.run.tools"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "12306-ticket-search-server": {
            "type": "http",
            "url": "https://rail--deniselewis200081.run.tools"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http 12306-ticket-search-server https://rail--deniselewis200081.run.tools
```

## When to use it
- 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
- 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?

## Similar
- [upstash-search-js](https://affpapa.org/en/nevibecode/skills/upstash-search-js.md) — skill · 1400 installs
- [headless-intelligent-search](https://affpapa.org/en/nevibecode/skills/headless-intelligent-search.md) — skill · 1100 installs
- [Chinaready China Market-Entry Search](https://affpapa.org/en/nevibecode/mcp/chinaready-china-market-entry-search.md) — MCP server
- [mongodb-search-and-ai](https://affpapa.org/en/nevibecode/skills/mongodb-search-and-ai.md) — skill · 6300 installs
- [tavily-search](https://affpapa.org/en/nevibecode/skills/veithly-tavily-search.md) — skill · 3700 installs
- [mapbox-search-integration](https://affpapa.org/en/nevibecode/skills/mapbox-search-integration.md) — skill · 2000 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
