MCP Catalogs
Home

mcp-server-12306

by drfccv·327·Score 50

A high-performance 12306 train ticket query system that provides real-time data via MCP protocol.

ai-llmtraveldeveloper-tools
55
Forks
1
Open issues
1 mo ago
Last commit
2d ago
Indexed

Overview

The MCP Server 12306 is a Python-based backend that integrates with China's official 12306 railway booking system through the Model Context Protocol. It provides comprehensive train ticket information including seat availability, station details, transfer options, and pricing. The server supports both stdio and HTTP modes for flexible deployment, with FastAPI ensuring high performance and quick response times. It's designed specifically for AI assistants and automation systems that need access to railway data.

Try asking AI

After installing, here are 3 things you can ask your AI assistant:

you:AI assistants helping travelers find and compare train options
you:Automated travel booking systems requiring real-time 12306 data
you:Applications that need to display live railway schedules and availability

When to choose this

Choose this MCP server for AI applications needing real-time Chinese train ticket information, especially when integrating with Claude Desktop or requiring low-latency access to 12306 data.

When NOT to choose this

Avoid if you need commercial use, international train data beyond China, or require write capabilities to modify train schedules or bookings.

Tools this server exposes

7 tools extracted from the README
  • query_tickets

    余票/车次/座席/时刻一站式查询

  • query_ticket_price

    实时查询各车次票价信息

  • search_stations

    车站模糊搜索,支持中文/拼音/简拼

  • get_station_info

    获取车站详情(名称、代码、地理等)

  • query_transfer

    一次中转换乘方案,自动拼接最优中转

  • get_train_route_stations

    查询指定列车经停站及时刻表

  • get_current_time

    获取当前时间与相对日期,帮助用户准确选择出行日期

Comparable tools

train-mcprailway-api-serverchinatrain-mcp

Installation

Installation

Mode 1: Stdio Mode (Recommended for Claude Desktop)

Using uvx:

{
  "mcpServers": {
    "12306": {
      "command": "uvx",
      "args": ["mcp-server-12306"]
    }
  }
}

Using pipx:

{
  "mcpServers": {
    "12306": {
      "command": "pipx",
      "args": ["run", "--no-cache", "mcp-server-12306"]
    }
  }
}

Mode 2: HTTP Mode

git clone https://github.com/drfccv/mcp-server-12306.git
cd mcp-server-12306
uv sync
uv run python scripts/start_server.py

Client configuration:

{
  "mcpServers": {
    "12306": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Compare mcp-server-12306 with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.