← 12306 MCP Server

12306 MCP Server 0.5.0.post20260822

pypi · mcp-server-12306 · current release

7
Tools
0
Resources
0
Templates
0
Prompts

Observation

Observed 2026-09-04T08:47:29.089Z using mcpSecurity-inventory. Status: succeeded. Negotiated protocol: 2025-06-18.

Server capabilities
{
  "experimental": {},
  "tools": {
    "listChanged": false
  }
}

Tools 7

ToolCategoryAnnotationsRisk
get-current-time获取当前日期和时间信息,支持相对日期计算。返回当前日期、时间,以及常用的相对日期(明天、后天等),方便用户在查询火车票时选择正确的日期。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "timezone": {
      "type": "string",
      "title": "时区",
      "description": "时区设置,默认为中国时区",
      "default": "Asia/Shanghai"
    },
    "format": {
      "type": "string",
      "title": "日期格式",
      "description": "返回的日期格式,默认为YYYY-MM-DD",
      "default": "YYYY-MM-DD"
    }
  },
  "type": "object",
  "title": "获取当前时间参数",
  "description": "获取当前时间和日期信息",
  "additionalProperties": false
}
— · —
get-train-no-by-train-code车次号转官方唯一编号(train_no),支持三字码/全名。常用于经停站查询前置转换。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "train_code": {
      "type": "string",
      "title": "车次号",
      "minLength": 1
    },
    "from_station": {
      "type": "string",
      "title": "出发站id或全名",
      "minLength": 1
    },
    "to_station": {
      "type": "string",
      "title": "到达站id或全名",
      "minLength": 1
    },
    "train_date": {
      "type": "string",
      "title": "出发日期",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "train_code",
    "from_station",
    "to_station",
    "train_date"
  ],
  "type": "object",
  "title": "车次号转编号参数",
  "additionalProperties": false
}
— · —
get-train-route-stations列车经停站全表查询。支持输入车次号或官方编号,自动转换,返回所有经停站、到发时刻、停留时间。支持三字码/全名。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "train_no": {
      "type": "string",
      "title": "车次编码",
      "minLength": 1
    },
    "from_station": {
      "type": "string",
      "title": "出发站id",
      "minLength": 1
    },
    "to_station": {
      "type": "string",
      "title": "到达站id",
      "minLength": 1
    },
    "train_date": {
      "type": "string",
      "title": "出发日期",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "train_no",
    "from_station",
    "to_station",
    "train_date"
  ],
  "type": "object",
  "title": "列车经停站查询参数",
  "additionalProperties": false
}
— · —
query-ticket-price查询火车票价信息。输入出发站、到达站、日期,返回各车次的票价详情。支持指定车次号过滤。 【智能筛选指南】返回结果通常包含出发/到达城市的所有相关车站(如北京/北京西/北京南)。请根据用户输入语境灵活处理: 1. 用户仅输入城市名(如'九江'):请展示所有相关站点的车次,不要过滤。 2. 用户指定具体车站(如'九江站'):优先展示匹配车站的车次,但若其他同城车站有更优方案(如时间更短、有票),也应作为补充选项提供。 请避免机械地仅通过字符串匹配过滤车次,以免遗漏用户可能感兴趣的出行方案。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "from_station": {
      "type": "string",
      "title": "出发站",
      "minLength": 1
    },
    "to_station": {
      "type": "string",
      "title": "到达站",
      "minLength": 1
    },
    "train_date": {
      "type": "string",
      "title": "出发日期",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "train_code": {
      "type": "string",
      "title": "车次号(可选)",
      "description": "指定车次号(如G123),若提供则只返回该车次信息"
    },
    "purpose_codes": {
      "type": "string",
      "title": "乘客类型",
      "description": "ADULT=成人, 0X=学生",
      "default": "ADULT"
    }
  },
  "required": [
    "from_station",
    "to_station",
    "train_date"
  ],
  "type": "object",
  "title": "票价查询参数",
  "additionalProperties": false
}
— · —
query-tickets官方12306余票/车次/座席/时刻一站式查询。输入出发站、到达站、日期,返回所有可购车次、时刻、历时、各席别余票等详细信息。支持中文名、三字码。 【智能筛选指南】返回结果通常包含出发/到达城市的所有相关车站(如北京/北京西/北京南)。请根据用户输入语境灵活处理: 1. 用户仅输入城市名(如'九江'):请展示所有相关站点的车次,不要过滤。 2. 用户指定具体车站(如'九江站'):优先展示匹配车站的车次,但若其他同城车站有更优方案(如时间更短、有票),也应作为补充选项提供。 请避免机械地仅通过字符串匹配过滤车次,以免遗漏用户可能感兴趣的出行方案。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "from_station": {
      "type": "string",
      "title": "出发站",
      "description": "出发车站名称,例如:北京、上海、广州",
      "minLength": 1
    },
    "to_station": {
      "type": "string",
      "title": "到达站",
      "description": "到达车站名称,例如:北京、上海、广州",
      "minLength": 1
    },
    "train_date": {
      "type": "string",
      "title": "出发日期",
      "description": "出发日期,格式:YYYY-MM-DD",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "from_station",
    "to_station",
    "train_date"
  ],
  "type": "object",
  "title": "车票查询参数",
  "description": "查询火车票所需的参数",
  "additionalProperties": false
}
— · —
query-transfer官方中转换乘方案查询。输入出发站、到达站、日期,可选中转站/无座/学生票,自动分页抓取全部中转方案,输出每段车次、时刻、余票、等候时间、总历时等详细信息。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "from_station": {
      "type": "string",
      "title": "出发站"
    },
    "to_station": {
      "type": "string",
      "title": "到达站"
    },
    "train_date": {
      "type": "string",
      "title": "出发日期",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "middle_station": {
      "type": "string",
      "title": "中转站(可选)",
      "description": "指定中转站名称或三字码,可选"
    },
    "isShowWZ": {
      "type": "string",
      "title": "是否显示无座车次(Y/N)",
      "description": "Y=显示无座车次,N=不显示,默认N",
      "default": "N"
    },
    "purpose_codes": {
      "type": "string",
      "title": "乘客类型(00=普通,0X=学生)",
      "description": "00为普通,0X为学生,默认00"
    }
  },
  "required": [
    "from_station",
    "to_station",
    "train_date"
  ],
  "type": "object",
  "title": "中转查询参数",
  "description": "查询A到B的中转换乘(含一次换乘)",
  "additionalProperties": false
}
— · —
search-stations智能车站搜索。支持中文名、拼音、简拼、三字码(Code)。可用于模糊搜索(如'北京'),也可用于精确获取车站代码(如输入'BJP'返回北京站信息)。
Input schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "query": {
      "type": "string",
      "title": "搜索关键词",
      "description": "车站搜索关键词,支持:车站名称、拼音、简拼等",
      "minLength": 1,
      "maxLength": 20
    },
    "limit": {
      "type": "integer",
      "title": "结果数量限制",
      "description": "返回结果的最大数量",
      "minimum": 1,
      "maximum": 50,
      "default": 10
    }
  },
  "required": [
    "query"
  ],
  "type": "object",
  "title": "车站搜索参数",
  "description": "搜索火车站所需的参数",
  "additionalProperties": false
}
— · —

Resources 0

Resource templates 0

Prompts 0

Let’s talk about MCP security.

Share your details and our security team will contact you.