Skip to main content
Glama
12306-MCP

12306-MCP

12306购票搜索服务器

基于 Model Context Protocol (MCP) 的12306购票搜索服务器。提供了简单的API接口,允许大模型利用接口搜索12306购票信息。 12306 ticket purchase search server based on Model Context Protocol (MCP). It provides a simple API interface, allowing large models to search for 12306 ticket purchasing information through the interface.## 工具列表 Tool List

本MCP服务封装下列工具,可让模型通过标准化接口调用以下功能。 本MCP服务封装下列工具,可让模型通过标准化接口调用以下功能。

工具 Tool

描述 Description

get-current-date

获取当前日期,以上海时区(Asia/Shanghai, UTC+8)为准,返回格式为 "yyyy-MM-dd"。主要用于解析用户提到的相对日期(如“明天”、“下周三”),提供准确的日期输入。

get-stations-code-in-city

通过中文城市名查询该城市 所有 火车站的名称及其对应的 station_code,结果是一个包含多个车站信息的列表。

get-station-code-of-citys

通过中文城市名查询代表该城市的 station_code。此接口主要用于在用户提供城市名作为出发地或到达地时,为接口准备 station_code 参数。

get-station-code-by-names

通过具体的中文车站名查询其 station_code 和车站名。此接口主要用于在用户提供具体车站名作为出发地或到达地时,为接口准备 station_code 参数。

get-station-by-telecode

通过车站的 station_telecode 查询车站的详细信息,包括名称、拼音、所属城市等。此接口主要用于在已知 telecode 的情况下获取更完整的车站数据,或用于特殊查询及调试目的。一般用户对话流程中较少直接触发。

get-tickets

查询12306余票信息。

get-interline-tickets

查询12306中转余票信息。尚且只支持查询前十条。

get-train-route-stations

查询特定列车车次在指定区间内的途径车站、到站时间、出发时间及停留时间等详细经停信息。当用户询问某趟具体列车的经停站时使用此接口。

检查服务 ## Inspector

工具在线测试: https://mcp.xiaobenyang.com/inspector/1777316659202051

Online Tool test https://mcp.xiaobenyang.com/inspector/1777316659202051

Related MCP server: 12306-MCP

服务配置 MCP Server Config

如何获取 XBY-APIKEY ? How to get XBY-APIKEY ?

访问小笨羊科技网站 https://xiaobenyang.com,注册用户即可获得APIKEY Visit XiaoBenYang website https://xiaobenyang.com, register and get the APIKEY.

SSE

{
  "mcpServers": {
    "12306购票搜索服务器": {
      "headers": {
        "XBY-APIKEY": "<YOUR_XBY_APIKEY>"
      },
      "type": "sse",
      "url": "https://mcp.xiaobenyang.com/1777316659202051/sse"
    }
  }
}

STREAMABLE HTTP

{
  "mcpServers": {
    "12306购票搜索服务器": {
      "headers": {
        "XBY-APIKEY": "<YOUR_XBY_APIKEY>"
      },
      "type": "streamable_http",
      "url": "https://mcp.xiaobenyang.com/1777316659202051/mcp"
    }
  }
}

STDIO

{
    "mcpServers": {
        "12306购票搜索服务器": {
          "command": "npx",
          "args": [
            "-y",
            "xiaobenyang-mcp"
          ],
          "env": {
            "XBY_APIKEY": "<YOUR_XBY_APIKEY>",
            "mcpId": "1777316659202051",
          },
          "transport": "stdio"
        }
      }
}

Available Tools

8 tools
get-current-dateget-current-dateA

获取当前日期,以上海时区(Asia/Shanghai, UTC+8)为准,返回格式为 "yyyy-MM-dd"。主要用于解析用户提到的相对日期(如“明天”、“下周三”),提供准确的日期输入。

Inputs: no named parameters.

get-interline-ticketsget-interline-ticketsC

查询12306中转余票信息。尚且只支持查询前十条。

Inputs: date (required), fromStation (required), toStation (required), middleStation, +8 more.

get-station-by-telecodeget-station-by-telecodeA

通过车站的 station_telecode 查询车站的详细信息,包括名称、拼音、所属城市等。此接口主要用于在已知 telecode 的情况下获取更完整的车站数据,或用于特殊查询及调试目的。一般用户对话流程中较少直接触发。

Inputs: stationTelecode (required).

get-station-code-by-namesget-station-code-by-namesA

通过具体的中文车站名查询其 station_code 和车站名。此接口主要用于在用户提供具体车站名作为出发地或到达地时,为接口准备 station_code 参数。

Inputs: stationNames (required).

get-station-code-of-citysget-station-code-of-citysB

通过中文城市名查询代表该城市的 station_code。此接口主要用于在用户提供城市名作为出发地或到达地时,为接口准备 station_code 参数。

Inputs: citys (required).

get-stations-code-in-cityget-stations-code-in-cityA

通过中文城市名查询该城市 所有 火车站的名称及其对应的 station_code,结果是一个包含多个车站信息的列表。

Inputs: city (required).

get-ticketsget-ticketsC

查询12306余票信息。

Inputs: date (required), fromStation (required), toStation (required), trainFilterFlags, +6 more.

get-train-route-stationsget-train-route-stationsC

查询特定列车车次在指定区间内的途径车站、到站时间、出发时间及停留时间等详细经停信息。当用户询问某趟具体列车的经停站时使用此接口。

Inputs: trainCode (required), departDate (required), format.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as get-tickets for ticket queries and get-train-route-stations for route details, but there is some overlap between get-station-code-by-names, get-station-code-of-citys, and get-stations-code-in-city, which all involve mapping names to station codes and could cause confusion in selection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with kebab-case (e.g., get-current-date, get-interline-tickets), making them predictable and easy to understand across the set.

    Tool Count5/5

    With 8 tools, the server is well-scoped for railway-related queries, covering key operations like ticket searches, station lookups, and route details without being overly complex or too sparse.

    Completeness4/5

    The tool set covers core functionalities such as ticket queries, station information, and route details, but there are minor gaps, such as the lack of tools for booking tickets or managing user accounts, which are common in railway systems.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      The server provides a simple API interface that allows users to search for 12306 tickets.
      8
      13,273 npm
      2,429
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that allows large language models to search for and analyze Chinese railway (12306) tickets through a simple API interface.
      8
      13,273 npm
      19
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A high-performance FastAPI backend for train ticket queries in China, supporting real-time ticket availability, station information, transfers, and train schedules through the Model Context Protocol for AI assistants and automation.
      7
      421
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      RollingGo MCP is a high-performance hotel search and recommendation service built on the MCP (Model Context Protocol) standard. It connects large language models with a massive database of domestic and international hotel data, providing real-time structured hotel search capabilities for AI assistants, agents, travel planning tools, or IDE plugins like Cursor/Windsurf.
      10
      MIT