MCP.Market

12306 MCP server

by drfccv·io.github.drfccv/mcp-server-12306·v0.3.1·397 stars

An MCP server that provides 12306 ticket query

A92/100grade A
What users say
No reviews yet
Be the first
Safety scan
A92/100

full report

Adoption
Established

397 stars417 downloads/wk

Reviews

Write one

Nobody has reviewed 12306 yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

12306 tools (7, 1 write)

write = sends, deletes, buys or posts

Read from the package source without running it. The installed server may list more.

  • get-current-time

    获取当前日期和时间信息,支持相对日期计算。返回当前日期、时间,以及常用的相对日期。

  • get-train-no-by-train-code

    车次号转官方唯一编号(train_no),支持三字码/全名。常用于经停站查询前置转换。

  • get-train-route-stations

    列车经停站全表查询。支持输入车次号或官方编号,返回所有经停站、到发时刻、停留时间。

  • query-ticket-price

    查询火车票价信息。输入出发站、到达站、日期,返回各车次的票价详情。支持指定车次号过滤。 【智能筛选指南】返回结果通常包含出发/到达城市的所有相关车站(如北京/北京西/北京南)。请根据用户输入语境灵活处理: 1. 用户仅输入城市名(如'九江'):请展示所有相关站点的车次,不要过滤。 2. 用户指定具体车站(如'九江站'):优先展示匹配车站的车次,但若其他同城车站有更优方案(如时间更短、有票),也应作为补充选项提供。 请避免机械地仅通过字符串匹配过滤车次,以免遗漏用户可能感兴趣的出行方案。

  • query-tickets

    官方12306余票/车次/座席/时刻一站式查询。输入出发站、到达站、日期,返回所有可购车次、时刻、历时、各席别余票等详细信息。支持中文名、三字码。 【智能筛选指南】返回结果通常包含出发/到达城市的所有相关车站(如北京/北京西/北京南)。请根据用户输入语境灵活处理: 1. 用户仅输入城市名(如'九江'):请展示所有相关站点的车次,不要过滤。 2. 用户指定具体车站(如'九江站'):优先展示匹配车站的车次,但若其他同城车站有更优方案(如时间更短、有票),也应作为补充选项提供。 请避免机械地仅通过字符串匹配过滤车次,以免遗漏用户可能感兴趣的出行方案。

  • query-transferwrite action

    官方中转换乘方案查询。输入出发站、到达站、日期,可选中转站/无座/学生票,自动分页抓取全部中转方案。

  • search-stations

    智能车站搜索。支持中文名、拼音、简拼、三字码(Code)。可用于模糊搜索(如“北京”),也可用于精确获取车站代码(如输入“BJP”返回北京站信息)。

Public scan report

scanner v0.1.10 · 2026-09-28 · same rubric, same numbers if you re-run it

no findings
  • Code scan11 source files scanned25/25
  • –Live reliabilityno gateway calls yet and no remote to proben/a
  • –Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 2 days ago15/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Overall 92/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

How 12306 compares

Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.

Safety score
92/100
higher than 95% of 48,255 servers
Tools
7
the typical server has 7
Tools that change things
14%
typical: 0%. Fewer write tools means less an agent can break
GitHub stars
397
more than 95% of 28,688 servers
Downloads a week
417
more than 86% of 12,191 servers with a package

What its tools let an agent do: 6 read · 1 change

Install 12306 in Claude Code, Cursor or VS Code

claude mcp add mcp-server-12306 -- uvx mcp-server-12306
Add to Cursor

What the publisher says

From the 12306 repository's README, as published. We do not edit it. Read it on GitHub

🚄 MCP Server 12306

基于 Model Context Protocol (MCP) 的 12306 火车票查询服务

支持 余票 / 票价 / 车站 / 经停 / 换乘 / 时间 六大查询能力,开箱即用,适配 AI 助手、自动化脚本、智能终端等场景。

📑 目录

  • ✨ 功能特性
  • 🚀 快速开始
  • 环境要求
  • 方式一:Stdio 模式(本地客户端推荐)
  • 方式二:Streamable HTTP 模式(远程部署)
  • 方式三:Docker 部署
  • 🛠️ 工具一览
  • ⚙️ 配置项
  • 🏗️ 项目结构
  • 🧑‍💻 开发指南
  • 📚 详细文档
  • ⚠️ 免责声明

✨ 功能特性

🚀 快速开始

环境要求

💡 推荐使用 uv:环境隔离、安装快、锁文件管理依赖版本。

方式一:Stdio 模式(本地客户端推荐)

MCP Server 通过标准输入/输出与客户端通信,不占用网络端口,适合 Claude Desktop、Cursor 等本地 MCP 客户端。

安装:

# uvx(推荐,环境隔离)
uvx mcp-server-12306

# 或 pip / pipx
pip install mcp-server-12306

客户端配置(如 claudedesktopconfig.json):

{
  "mcpServers": {
    "12306": {
      "command": "uvx",
      "args": ["mcp-server-12306"]
    }
  }
}

其他安装方式(点击展开)

pipx:

{
  "mcpServers": {
    "12306": {
      "command": "pipx",
      "args": ["run", "--no-cache", "mcp-server-12306"]
    }
  }
}

本地源码(开发者调试):

git clone https://github.com/drfccv/mcp-server-12306.git
cd mcp-server-12306
uv sync
{
  "mcpServers": {
    "12306": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-server-12306", "run", "mcp-server-12306"]
    }
  }
}

方式二:Streamable HTTP 模式(远程部署)

Server 启动 Web 服务(默认 8000 端口),通过 MCP Streamable HTTP 协议通信:POST 发送 JSON-RPC、GET 订阅流式响应、DELETE 结束会话。

启动:

# 安装后直接启动
mcp-12306

# 或本地源码启动
uv run python scripts/start_server.py

客户端配置:

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

12306: common questions

Is 12306 MCP server safe?
Yes, by our scan: it is graded A (92/100). Read the 12306 safety report
How do I install 12306?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does 12306 need an API key?
Not as far as the registry entry and our scan can tell: no credentials are declared or required.
Is 12306 maintained?
The last commit was 39 days ago (2026-09-26). The latest release is v0.3.1.
How does 12306 compare with other MCP servers?
safety score 92/100 (higher than 95% of 48,255 servers); tools 7 (the typical server has 7); tools that change things 14% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.