12306-mcp README

The project's README from github.com/Joooook/12306-mcp. As one markdown file: README.md.

12306-mcp

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 🚧 计划内

⚙️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

12306-mcp MCP server

MseeP.ai Security Assessment Badge

☕️Donate

请我喝杯奶茶吧。

12306-mcp (Joooook/12306-mcp)

Searching Database…

What is this?12306-mcp is a Model Context Protocol (MCP) server that lets AI models search train tickets on China's 12306 railway booking system through a simple API.
Is this a standalone app or a server I plug into my AI assistant?It is an MCP server: you run it and connect it to an MCP-compatible AI client (like Claude or another LLM tool) which then calls its API to search tickets.
How do I get it running?You can run it directly via CLI in stdio or HTTP mode, or use the provided Docker setup (Docker-stdio or Docker-http), then point your MCP client config at it.
What do I need installed to run it?You need Node.js 18 or newer; running the debug command with MCP Inspector 2.0.0 requires Node.js 22.19.0 or newer.
Is this ready for real ticket purchases, or just for learning?The author states the project is only for learning purposes, not an officially sanctioned or guaranteed production booking tool.
Who would use this?Developers building AI agents or chatbots that need to look up Chinese train schedules and ticket availability without manually browsing the 12306 website.
What kind of ticket queries does it support?It supports standard 12306 ticket search, filtering trains by criteria, querying stops along a route, and transit/interchange route queries.
Do I need a 12306 account or API key to use it?The README doesn't mention needing a 12306 account or API key — it just requires running the server and connecting an MCP client.
Are more features planned?Yes, the README lists additional interfaces as planned ('计划内') and invites users to request features.
Creator
Joooook
Size
0.6 MB
Stars
2.4K
Age
1y
Commits · 90 Days