drfccv/mcp-server-12306

12306 MCP Server​​ 是一个基于 ​​Model Context Protocol (MCP)​​ 的高性能火车票查询后端系统。它通过标准化接口提供官方 12306 的实时数据服务,包括余票查询、车站信息、列车经停站、中转换乘方案等核心功能。

What it solves

This project provides a way for AI assistants and automated scripts to access real-time Chinese railway data from the 12306 official system. It bridges the gap between LLMs and live train information, allowing AI to help users search for tickets, check prices, and plan travel routes without manual searching.

How it works

It is implemented as a Model Context Protocol (MCP) server. It acts as an intermediary that connects to the official 12306 interfaces and exposes several specialized tools to an AI client. It supports two communication modes: Stdio (for local clients like Claude Desktop or Cursor) and Streamable HTTP (for remote deployments).

Who it’s for

  • Users of AI assistants (like Claude or Cursor) who want to integrate train ticket querying into their workflow.
  • Developers building travel-related AI agents or automation scripts.
  • System administrators deploying remote AI tool services via Docker.

Highlights

  • Comprehensive Querying: Supports ticket availability, pricing, station searches, transfer options, and train stop sequences.
  • Smart Station Search: Fuzzy search across 3,382+ stations using Chinese, Pinyin, or three-letter codes.
  • Flexible Deployment: Can be run locally via Stdio or remotely via HTTP and Docker.
  • Protocol Compatibility: Built on MCP SDK v2 with automatic protocol negotiation for different version handshakes.

Related

  • Project
  • Project
  • Project
  • Project
  • Project