mcpField
1
12306 Mcp

12306 Mcp

Local
github.com/JoooookMaps & Travel2.4kUpdated 13w ago

About 12306 Mcp

12306-mcp is an MCP server for searching 12306 train tickets, letting language models query ticket availability through a simple API. It supports filtering trains, stop-station lookups and transfer searches, and is aimed at developers and AI assistants that need Chinese rail ticket data.

Key features

  1. 01Search 12306 ticket availability
  2. 02Filter train information by conditions
  3. 03Stop-station query
  4. 04Transfer route query
  5. 05Runs over stdio or HTTP

Use cases

  1. 01Letting an AI assistant check tickets for a given date and route
  2. 02Filtering trains that match specific criteria
  3. 03Looking up intermediate stops and transfer options

MCP support

This project is an MCP server that exposes 12306 ticket search functions to language models and MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"12306": {
"command": "npx",
"args": [
"-y",
"12306-mcp"
]
}
}
}
Run commandnpx -y 12306-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm12306-mcp

Tools

8

Saved tool list · updated 3w ago

This tool takes no parameters.

Details

From the project README

12306-mcp

README image README image README image README image README image README image

A 12306 ticket search server based on the Model Context Protocol (MCP). The server provides a simple API interface that allows users to search for 12306 tickets.

基于 Model Context Protocol (MCP) 的12306购票搜索服务器。提供了简单的API接口,允许大模型利用接口搜索12306购票信息。

如需Skill -> https://github.com/Joooook/12306-skill

🚩Features

功能描述状态
查询12306购票信息✅ 已完成
过滤列车信息✅ 已完成
过站查询✅ 已完成
中转查询✅ 已完成
其余接口,欢迎提feature🚧 计划内
README image
README image

⚙️Installation

git clone https://github.com/Joooook/12306-mcp.git
npm i

▶️Quick Start

CLI-stdio
npx -y 12306-mcp
CLI-http
npx -y 12306-mcp --port [端口号]
Runtime requirements

The server requires Node.js 18 or newer. The npm run debug command uses MCP Inspector 2.0.0, which requires Node.js 22.19.0 or newer.

MCP sever configuration
{
    "mcpServers": {
        "12306-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "12306-mcp"
            ]
        }
    }
}

Docker-stdio
docker build . -t 12306-mcp
docker run --rm -it 12306-mcp npx 12306-mcp
Docker-http
docker build . -t 12306-mcp
docker run -p [your_port]:8080 -d 12306-mcp npx 12306-mcp --port 8080

📚Documentation

👉️Reference

💭Murmurs

本项目仅用于学习,欢迎催更。

🎫Badges

☕️Donate

请我喝杯奶茶吧。

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.