Sandbox
@Joooook/12306-mcp

MCP server for 12306 train ticket search

12306-mcp wraps 12306 ticket search behind an MCP server so an agent can query travel options from its tool layer. It supports ticket lookup, train filtering, passing-station queries, and transfer searches. The README shows stdio, HTTP, and Docker ways to run it.

1,253 stars196 forksJavaScriptUpdated 1mo ago
Who it's for

Builders who want an MCP-capable agent to search 12306 train tickets and related routes.

What it delivers

You can ask your agent to look up train tickets and route options without leaving your workflow.

What it does

Ticket search

Searches 12306 ticket availability and trip information through the MCP interface.

Train filtering

Lets the agent filter train results after searching.

Passing-station lookup

Supports queries for trains that pass through a given station.

Transfer search

Finds transfer routes for 12306 trips.

stdio and HTTP runtime

Runs as a local MCP server over stdio or on a port with `--port`.

How to get it

  1. 1Run
    git clone https://github.com/Joooook/12306-mcp.git
    npm i
  2. 2Run
    npx -y 12306-mcp
  3. 3Run
    npx -y 12306-mcp --port [端口号]
  4. 4Run
    docker build . -t 12306-mcp
    docker run --rm -it 12306-mcp npx 12306-mcp
  5. 5Run
    docker build . -t 12306-mcp
    docker run -p [your_port]:8080 -d 12306-mcp npx 12306-mcp --port 8080

README

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

☕️Donate

请我喝杯奶茶吧。

Files in the repo

Repository payload13 top-level entries
  • .github
  • build
  • docs
  • src
  • .gitignore
  • .prettierrc
  • Dockerfile
  • glama.json
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • tsconfig.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k

x64dbg-MCP Server is a native MCP (Model Context Protocol) plugin for x64dbg that exposes the debugger's full functionality over HTTP. Connect any MCP-compatible AI assistant and control x64dbg programmatically: set breakpoints, step through code, read memory, dump registers, and more. Built with Zig — zero dependencies, single-binary output, cros

1.9k