12306-mcp
The 12306-mcp server provides functionalities for searching and filtering train ticket information:
Query tickets: Search for train tickets between stations on a specific date
Filter results: Filter by train types (G, D, Z, T, K, O, F, S) or specific flags (high-speed, smart trains)
Station information: Retrieve station codes for cities, query all stations within a city, or find codes for specific station names
Advanced routing: Perform intermediate station queries and transfer queries
Used as a donation platform where users can buy the developer a milk tea.
Linked to the developer's Bilibili profile, though no specific integration capabilities are described.
Referenced as the project repository platform, but not described as a service the MCP server integrates with.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@12306-mcpsearch for train tickets from Beijing to Shanghai tomorrow"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 | 🚧 计划内 |
Related MCP server: 12306 Train Ticket Search MCP Server
⚙️Installation
git clone https://github.com/Joooook/12306-mcp.git
npm i▶️Quick Start
CLI-stdio
npx -y 12306-mcpCLI-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-mcpDocker-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
请我喝杯奶茶吧。
Available Tools
8 toolsget-current-dateA
获取当前日期,以上海时区(Asia/Shanghai, UTC+8)为准,返回格式为 "yyyy-MM-dd"。主要用于解析用户提到的相对日期(如“明天”、“下周三”),提供准确的日期输入。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description fully discloses the timezone (Asia/Shanghai, UTC+8), date format (yyyy-MM-dd), and primary use case. With no annotations provided, the description effectively conveys all necessary behavioral traits for a read-only, deterministic tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise—two sentences that immediately state the purpose, timezone, format, and use case. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters, no output schema), the description covers all relevant context: timezone, format, and intended usage. Nothing is missing for an agent to correctly invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the input schema is complete. The description adds no parameter-specific info, which is acceptable as there are none. Baseline 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the tool's function: get current date in Shanghai timezone with a specific format. It also explains its utility in parsing relative dates, making the purpose very clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a specific usage context (parsing relative dates like 'tomorrow', 'next Wednesday'), guiding when to use this tool. While no explicit alternatives or exclusions are given, the simplicity of the tool makes this sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-interline-ticketsA
查询12306中转余票信息。尚且只支持查询前十条。
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | 查询日期,格式为 "yyyy-MM-dd"。如果用户提供的是相对日期(如“明天”),请务必先调用 `get-current-date` 接口获取当前日期,并计算出目标日期。 | |
| format | No | 返回结果格式,默认为text,建议使用text。可选标志:[text, json] | text |
| showWZ | No | 是否显示无座车,默认不显示无座车。 | |
| sortFlag | No | 排序方式,默认为空,即不排序。仅支持单一标识。可选标志:[startTime(出发时间从早到晚), arriveTime(抵达时间从早到晚), duration(历时从短到长)] | |
| toStation | Yes | 到达地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到) | |
| limitedNum | No | 返回的中转余票数量限制,默认为10。 | |
| fromStation | Yes | 出发地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到) | |
| sortReverse | No | 是否逆向排序结果,默认为false。仅在设置了sortFlag时生效。 | |
| middleStation | No | 中转地的中文或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)。该参数可选。 | |
| latestStartTime | No | 最迟出发时间(0-24),默认为24。 | |
| trainFilterFlags | No | 车次筛选条件,默认为空。从以下标志中选取多个条件组合[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)] | |
| earliestStartTime | No | 最早出发时间(0-24),默认为0。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses the limitation of returning only the first ten results, but does not mention other behavioral traits like error handling, performance, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no waste, front-loaded with purpose. Efficient and clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having 12 parameters and no output schema, the description is too brief. It does not explain return structure, error states, or any post-processing steps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the description adds minimal extra meaning beyond the schema. The statement about only supporting top ten conflates with limitedNum parameter but does not provide new insight into parameter usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it queries 12306 transfer ticket information, and distinguishes itself from sibling tools like get-tickets by specifying 'interline' (中转). The limitation of top 10 results is also mentioned.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use (for transfer tickets) but does not explicitly mention when not to use or alternatives. The sibling tool get-tickets suggests direct tickets, but no direct comparison is made.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-station-by-telecodeA
通过车站的 station_telecode 查询车站的详细信息,包括名称、拼音、所属城市等。此接口主要用于在已知 telecode 的情况下获取更完整的车站数据,或用于特殊查询及调试目的。一般用户对话流程中较少直接触发。
| Name | Required | Description | Default |
|---|---|---|---|
| stationTelecode | Yes | 车站的 `station_telecode` (3位字母编码) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must cover behavioral traits. It describes a simple query with no side effects, but lacks details on authorization, rate limits, or error handling. Adequate but minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences, no fluff, and the essential purpose and usage context are front-loaded. Highly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity (1 param, no output schema), the description covers purpose and context well. It could mention the return format or limitations, but overall it is sufficient for an agent to understand when and how to use the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description mentions 'station_telecode' as a 3-letter code, which matches the schema, but adds no further semantic value beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool queries station details by telecode, including name, pinyin, and city. It differentiates from sibling tools like get-station-code-by-names by specifying the input is a telecode.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says this is for known telecodes and special/debugging purposes, and that it is rarely triggered in normal user conversations. It implies alternatives exist but does not name them.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-station-code-by-namesA
通过具体的中文车站名查询其 station_code 和车站名。
| Name | Required | Description | Default |
|---|---|---|---|
| stationNames | Yes | 具体的中文车站名称,例如:"北京南", "上海虹桥"。若要查询多个站点,请用|分割,比如"北京南|上海虹桥"。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description only mentions returning station_code and station name. It does not disclose any behavioral traits like read-only nature or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that efficiently conveys the tool's function without unnecessary words. It is front-loaded and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of the tool and no output schema, the description adequately covers the input and output. However, it could mention the output structure or provide more context about the station_code format.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage, and the description adds value by explaining the '|' separator and giving concrete examples, which aids understanding beyond the schema's description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: query station_code and station name using specific Chinese station names. It distinguishes from sibling tools that use telecode or city-based queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains how to input station names (separator '|' for multiple) but does not explicitly state when to use this tool over alternatives or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-station-code-of-citysC
通过中文城市名查询代表该城市的 station_code。
| Name | Required | Description | Default |
|---|---|---|---|
| citys | Yes | 要查询的城市,比如"北京"。若要查询多个城市,请用|分割,比如"北京|上海"。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description implies a read operation but does not disclose any behavioral traits such as data freshness, error handling, or rate limits. No annotations provided to fill the gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence is concise but somewhat minimal; it restates the tool's function without extra value. Could be more structured but not verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter query tool, description is adequate. However, it lacks explanation of output format or return value, which would be helpful given no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and already explains the 'citys' parameter format. Description adds no additional meaning beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb '查询' (query) and resource 'station_code' for Chinese city names. However, it does not differentiate from sibling tools like 'get-station-code-by-names' or 'get-stations-code-in-city'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. Description lacks context for appropriate usage or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-stations-code-in-cityB
通过中文城市名查询该城市 所有 火车站的名称及其对应的 station_code,结果是一个包含多个车站信息的列表。
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes | 中文城市名称,例如:"北京", "上海" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries full burden. It discloses that the result is a list containing station names and codes, but lacks details on error handling, performance, or side effects. Adequate for a simple query tool but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence in Chinese that is front-loaded and conveys the core purpose without extraneous information. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description provides enough context: it returns a list with names and codes. Missing details like error behavior are not critical for basic usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a description for 'city'. The tool's description repeats that it uses Chinese city names, but adds no new meaning beyond the schema examples. Baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool queries all station names and their station codes for a given Chinese city. It uses specific verb and resource, and scope 'all' is explicit. However, it does not differentiate from the sibling tool 'get-station-code-of-citys', which may cause confusion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives like 'get-station-code-of-citys'. The usage is implied for one Chinese city, but without comparisons or exclusions, an AI agent may struggle to select correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-ticketsB
查询12306余票信息。
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | 查询日期,格式为 "yyyy-MM-dd"。如果用户提供的是相对日期(如“明天”),请务必先调用 `get-current-date` 接口获取当前日期,并计算出目标日期。 | |
| format | No | 返回结果格式,默认为text,建议使用text与csv。可选标志:[text, csv, json] | text |
| sortFlag | No | 排序方式,默认为空,即不排序。仅支持单一标识。可选标志:[startTime(出发时间从早到晚), arriveTime(抵达时间从早到晚), duration(历时从短到长)] | |
| toStation | Yes | 到达地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到) | |
| limitedNum | No | 返回的余票数量限制,默认为0,即不限制。 | |
| fromStation | Yes | 出发地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到) | |
| sortReverse | No | 是否逆向排序结果,默认为false。仅在设置了sortFlag时生效。 | |
| latestStartTime | No | 最迟出发时间(0-24),默认为24。 | |
| trainFilterFlags | No | 车次筛选条件,默认为空,即不筛选。支持多个标志同时筛选。例如用户说“高铁票”,则应使用 "G"。可选标志:[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)] | |
| earliestStartTime | No | 最早出发时间(0-24),默认为0。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It only states 'query remaining tickets' without disclosing any behavioral traits like read-only nature, rate limits, or side effects. Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that efficiently states the tool's purpose with no wasted words. It is appropriately sized for the information conveyed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool complexity (10 parameters, no output schema), the description is minimal. It covers the basic purpose but lacks details on return values, pagination, or limitations. However, the thorough schema descriptions partially compensate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no parameter meaning beyond what the schema provides. The schema descriptions are detailed, but the tool description itself does not compensate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool queries remaining ticket info from 12306, with a specific verb and resource. However, it does not differentiate from sibling tools like get-interline-tickets, lacking explicit distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or context. The schema parameters offer some implicit guidance, but the description itself is silent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-train-route-stationsA
查询特定列车车次在指定区间内的途径车站、到站时间、出发时间及停留时间等详细经停信息。当用户询问某趟具体列车的经停站时使用此接口。
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | 返回结果格式,默认为text,建议使用text。可选标志:[text, json] | text |
| trainCode | Yes | 要查询的车次 `train_code`,例如"G1033"。 | |
| departDate | Yes | 列车出发的日期 (格式: yyyy-MM-dd)。如果用户提供的是相对日期,请务必先调用 `get-current-date` 解析。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It describes the output (stations, times, durations) but lacks details on error handling, authentication, rate limits, or what happens if the train does not exist. The description is functional but not fully transparent about behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that efficiently conveys the tool's purpose and usage context. Every part of the sentence adds value, and there is no redundant information. It is appropriately front-loaded and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description mentions querying stops within a 'specified interval,' but the input schema does not include an interval parameter, causing a slight mismatch. Without an output schema, the description lists some return fields but omits the full structure. The tool is moderately complex with three parameters, and the description could be more complete by clarifying the interval concept.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already has 100% description coverage, so the description adds limited semantic value beyond the schema. It reinforces the context of querying stops but does not provide additional meaning for each parameter, except for the format parameter where it recommends 'text' default, which is already in the schema. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool queries detailed stop information for a specific train, including stations, arrival/departure times, and stop duration. It explicitly indicates when to use it: 'when the user asks about stops of a specific train.' This distinguishes it from sibling tools that deal with station codes or ticket purchasing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear usage guideline: use this interface when the user asks about the stops of a specific train. However, it does not explicitly mention when not to use it or suggest alternatives among sibling tools, which would have improved the score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.2.1- Changed
get-interline-tickets3 fields changed- changed
Input schema / properties / fromStation / descriptionPrevious value: -"出发地的 `station_code` 。必须是通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到的编码,严禁直接使用中文地名。"New value: +"出发地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)" - changed
Input schema / properties / middleStation / descriptionPrevious value: -"中转地的 `station_code` ,可选。必须是通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到的编码,严禁直接使用中文地名。"New value: +"中转地的中文或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)。该参数可选。" - changed
Input schema / properties / toStation / descriptionPrevious value: -"出发地的 `station_code` 。必须是通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到的编码,严禁直接使用中文地名。"New value: +"到达地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)"
- Changed
get-tickets2 fields changed- changed
Input schema / properties / fromStation / descriptionPrevious value: -"出发地的 `station_code` 。必须是通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到的编码,严禁直接使用中文地名。"New value: +"出发地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)" - changed
Input schema / properties / toStation / descriptionPrevious value: -"到达地的 `station_code` 。必须是通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到的编码,严禁直接使用中文地名。"New value: +"到达地的中文名或站点的 `station_code`(可通过 `get-station-code-by-names` 或 `get-station-code-of-citys` 接口查询得到)"
4 tool updates
v1.0.0- Changed
get-current-date1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
- Changed
get-interline-tickets3 fields changed- added
Input schema / properties / earliestStartTimeAdded value: +{ + "default": 0, + "description": "最早出发时间(0-24),默认为0。", + "maximum": 24, + "minimum": 0, + "type": "number" +} - added
Input schema / properties / formatAdded value: +{ + "default": "text", + "description": "返回结果格式,默认为text,建议使用text。可选标志:[text, json]", + "pattern": "^(text|json)$", + "type": "string" +} - added
Input schema / properties / latestStartTimeAdded value: +{ + "default": 24, + "description": "最迟出发时间(0-24),默认为24。", + "maximum": 24, + "minimum": 0, + "type": "number" +}
- Changed
get-tickets3 fields changed- added
Input schema / properties / earliestStartTimeAdded value: +{ + "default": 0, + "description": "最早出发时间(0-24),默认为0。", + "maximum": 24, + "minimum": 0, + "type": "number" +} - added
Input schema / properties / formatAdded value: +{ + "default": "text", + "description": "返回结果格式,默认为text,建议使用text与csv。可选标志:[text, csv, json]", + "pattern": "^(text|csv|json)$", + "type": "string" +} - added
Input schema / properties / latestStartTimeAdded value: +{ + "default": 24, + "description": "最迟出发时间(0-24),默认为24。", + "maximum": 24, + "minimum": 0, + "type": "number" +}
- Changed
get-train-route-stations7 fields changed- changed
Input schema / properties / departDate / descriptionPrevious value: -"列车从 `fromStationTelecode` 指定的车站出发的日期 (格式: yyyy-MM-dd)。如果用户提供的是相对日期,请务必先调用 `get-current-date` 解析。"New value: +"列车出发的日期 (格式: yyyy-MM-dd)。如果用户提供的是相对日期,请务必先调用 `get-current-date` 解析。" - added
Input schema / properties / formatAdded value: +{ + "default": "text", + "description": "返回结果格式,默认为text,建议使用text。可选标志:[text, json]", + "pattern": "^(text|json)$", + "type": "string" +} - removed
Input schema / properties / fromStationTelecodeRemoved value: -{ - "description": "该列车行程的**出发站**的 `station_telecode` (3位字母编码`)。通常来自 `get-tickets` 结果中的 `telecode` 字段,或者通过 `get-station-code-by-names` 得到。", - "type": "string" -} - removed
Input schema / properties / toStationTelecodeRemoved value: -{ - "description": "该列车行程的**到达站**的 `station_telecode` (3位字母编码)。通常来自 `get-tickets` 结果中的 `telecode` 字段,或者通过 `get-station-code-by-names` 得到。", - "type": "string" -} - added
Input schema / properties / trainCodeAdded value: +{ + "description": "要查询的车次 `train_code`,例如\"G1033\"。", + "type": "string" +} - removed
Input schema / properties / trainNoRemoved value: -{ - "description": "要查询的实际车次编号 `train_no`,例如 \"240000G10336\",而非\"G1033\"。此编号通常可以从 `get-tickets` 的查询结果中获取,或者由用户直接提供。", - "type": "string" -} - changed
Input schema / requiredPrevious value: -[ - "trainNo", - "fromStationTelecode", - "toStationTelecode", - "departDate" -]New value: +[ + "trainCode", + "departDate" +]
8 tool updates
- First observed
get-current-date - First observed
get-interline-tickets - First observed
get-station-by-telecode - First observed
get-station-code-by-names - First observed
get-station-code-of-citys - First observed
get-stations-code-in-city - First observed
get-tickets - First observed
get-train-route-stations
TDQS
Scored across 8 tools
Most tools have distinct purposes (date, tickets, interline tickets, station queries by different criteria, train route). However, get-station-code-by-names and get-station-code-of-citys could be confused as both involve station codes, but descriptions clarify the input type.
All tools follow get-<resource>-<detail> pattern with snake_case, but there are inconsistencies: 'citys' is a typo, and some use singular 'station' while others use plural 'stations' (e.g., get-stations-code-in-city vs get-station-code-by-names).
8 tools cover core query needs for a train information server (date, tickets, stations, routes). Not excessive or insufficient, though a tool for train number details might be expected.
Covers essential queries: date, tickets, interline tickets, station codes by multiple methods, station details, and train routes. Missing price or order-related queries, but the scope is focused on info retrieval.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for China Railway 12306 ticket availability: schedules and seats by Chinese station name.
Skiplagged MCP Server for flight search, hotel booking, and travel planning
Search and compare flight offers through a cache-aware Streamable HTTP MCP server for AI agents.
Geo-based flight search MCP server. Find more flights between any two places on earth
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that allows large language models to search for and analyze Chinese railway (12306) tickets through a simple API interface.83,85018MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching for train tickets on China's 12306 railway system, including ticket availability queries, train filtering, station stopover information, and transfer route planning.3,8502MIT
- AlicenseBqualityDmaintenance12306 ticket purchase search server based on Model Context Protocol (MCP). It provides a simple API interface, allowing large models to search for 12306 ticket purchasing information through the interface.81Apache 2.0
- AlicenseNot gradedqualityBmaintenanceMCP server providing access to Russian Railways ticket API, enabling train search, station lookup, and trip information.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Joooook/12306-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
