
Node.js — 下载 Node.js®双击打开千万不要勾选该选项保持当前的未勾选状态直接点击Next完成安装即可。原因如下勾选此项后安装程序会在结束后自动下载并安装 Python 和 Visual Studio Build Tools 等编译工具这个过程非常耗时且会占用大量 C 盘空间。运行12306-mcp项目完全不需要这些原生编译工具不勾选可以避免不必要的麻烦和等待。后续步骤提醒点击Next完成安装后务必关闭并重新打开命令行工具CMD 或 PowerShell。输入node -v和npm -v如果能输出版本号说明 Node.js 环境配置成功。C:\Users\jffcnode -vv24.19.0C:\Users\jffcnpm -v11.17.0C:\Users\jffcnpm config set registry https://registry.npmmirror.com/C:\Users\jffcnpm config get registryhttps://registry.npmmirror.com/C:\Users\jffcnpx -y 12306-mcp --port 8088npm warn deprecated modelcontextprotocol/server-legacy2.0.0: This package is a frozen copy of v1s SSE transport and OAuth Authorization Server helpers for migration purposes only. Use StreamableHTTP from modelcontextprotocol/server and a dedicated OAuth server in production. Will not receive new features.Streamable HTTP MCP Server listening at http://[::]:8088/mcpSSE MCP Server listening at http://[::]:8088/sse12306-mcpMicrosoft Windows [版本 10.0.19045.6466](c) Microsoft Corporation。保留所有权利。C:\Users\jffccurl -X POST http://localhost:8088/mcp ^More? -H Content-Type: application/json ^More? -H Accept: application/json, text/event-stream ^More? -d {\jsonrpc\:\2.0\,\id\:1,\method\:\tools/list\,\params\:{}}{result:{tools:[{name:get-current-date,description:获取当前日期以上海时区Asia/Shanghai, UTC8为准返回格式为 \yyyy-MM-dd\。主要用于解析用户提到的相对日期如“明天”、“下周三”提供准确的日期输入。,inputSchema:{$schema:http://json-schema.org/draft-07/schema#,type:object,properties:{}},execution:{taskSupport:forbidden}},{name:get-stations-code-in-city,description:通过中文城市名查询该城市 **所有** 火车站的名称及其对应的 station_code结果是一个包含多个车站信息的列表。,inputSchema:{type:object,properties:{city:{type:string,description:中文城市名称例如\北京\, \上海\}},required:[city],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}},{name:get-station-code-of-citys,description:通过中文城市名查询代表该城市的 station_code。,inputSchema:{type:object,properties:{citys:{type:string,description:要查询的城市比如\北京\。若要查询多个城市请用|分割比如\北京|上海\。}},required:[citys],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}},{name:get-station-code-by-names,description:通过具体的中文车站名查询其 station_code 和车站名。,inputSchema:{type:object,properties:{stationNames:{type:string,description:具体的中文车站名称例如\北京南\, \ 上海虹桥\。若要查询多个站点请用|分割比如\北京南|上海虹桥\。}},required:[stationNames],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}},{name:get-station-by-telecode,description:通过车站的 station_telecode 查询车站的详细信息包括名称、拼音、所属城市等。此接口主要用于在已知 telecode 的情况下获取更完整的车站数据或用于特殊查询及调试目的。一般用户对话流程中较少直接触发。,inputSchema:{type:object,properties:{stationTelecode:{type:string,description:车站的 station_telecode (3位字母 编码)}},required:[stationTelecode],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}},{name:get-tickets,description:查询12306余票信息。,inputSchema:{type:object,properties:{date:{type:string,minLength:10,maxLength:10,description:查询日期格式为 \yyyy-MM-dd\。如果用户提供的是相对日期如“明天”请务必先调用 get-current-date 接口获取当前日期并计算出目标日期。},fromStation:{type:string,description:出发地的中文名或站点的 station_code可通过 get-station-code-by-names 或 get-station-code-of-citys 接口查询得到},toStation:{type:string,description:到达地的中文名或站点的 station_code可通过 get-station-code-by-names 或 get-station-code-of-citys 接口查询得到},trainFilterFlags:{type:string,pattern:^[GDZTKOFS]*$,maxLength:8,default:,description:车次筛选条件默认为空即不筛选。支持多个标志同时筛选。例如用户说“高铁票”则应使用 \G\。可选标志[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)]},earliestStartTime:{type:number,minimum:0,maximum:24,default:0,description:最早出发时间0-24默认为0。},latestStartTime:{type:number,minimum:0,maximum:24,default:24,description:最迟出发时间0-24默认为24。},sortFlag:{type:string,default:,description:排序方式默认为空即不排序。 仅支持单一标识。可选标志[startTime(出发时间从早到晚), arriveTime(抵达时间从早到晚), duration(历时从短到长)]},sortReverse:{type:boolean,default:false,description:是否逆向排序结果默认为false。仅在设置了sortFlag时生效。},limitedNum:{type:number,minimum:0,default:0,description:返回的余票数量限制默认为0即不限制。},format:{type:string,pattern:^(text|csv|json)$,default:text,description:返回结果格式默认为text建议使用text与csv。 可选标志[text, csv, json]}},required:[date,fromStation,toStation],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}},{name:get-interline-tickets,description:查询12306中转余票信息。尚且只支持查询前十条。,inputSchema:{type:object,properties:{date:{type:string,minLength:10,maxLength:10,description:查询日期格式为 \yyyy-MM-dd\。如果用户提供的是相对日期如“明天” 请务必先调用 get-current-date 接口获取当前日期并计算出目标日期。},fromStation:{type:string,description: 出发地的中文名或站点的 station_code可通过 get-station-code-by-names 或 get-station-code-of-citys 接口查询得到},toStation:{type:string,description:到达地的中文名或站点的 station_code可通过 get-station-code-by-names 或 get-station-code-of-citys 接口查询得到},middleStation:{type:string,default:,description:中转地的中 文或站点的 station_code可通过 get-station-code-by-names 或 get-station-code-of-citys 接口查询得到。该参数可选 。},showWZ:{type:boolean,default:false,description:是否显示无座车默认不显示无座车。},trainFilterFlags:{type:string,pattern:^[GDZTKOFS]*$,maxLength:8,default:,description:车次筛选条件默认为空。从以下标志中选取多个条件组合[G(高铁/城际),D(动车),Z(直达特快),T(特快),K(快速),O(其他),F(复兴号),S(智能动车组)]},earliestStartTime:{type:number,minimum:0,maximum:24,default:0,description:最早出发时间0-24默认为0。},latestStartTime:{type:number,minimum:0,maximum:24,default:24,description:最迟出发时间0-24默认为24。},sortFlag:{type:string,default:,description:排序方式默认为空即不排序。仅支持单一标识。可选标志[startTime(出发时间从早到晚), arriveTime(抵达时间从早到晚), duration(历时从短到长)]},sortReverse:{type:boolean,default:false,description:是否逆向排序结果默认为false。仅在设置了sortFlag时生效。},limitedNum:{type:number,minimum:1,default:10,description:返回的中转余票数量限制默认为10。},format:{type:string,pattern:^(text|json)$,default:text,description:返回结果格式默认为text建议使用text。可选标志[text, json]}},required:[date,fromStation,toStation],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}},{name:get-train-route-stations,description:查询特定列车车次在指定区间内的途径车站、到站时间、出发时间及停留时间等详细经停信息。当用户询问某趟具体列车的经停站时使用此接口。,inputSchema:{type:object,properties:{trainCode:{type:string,description:要查询的车次 train_code例如\G1033\。},departDate:{type:string,minLength:10,maxLength:10,description:列车出发的日期 (格式: yyyy-MM-dd)。如果用户提供的是相对日期请务必先调用 get-current-date 解析。},format:{type:string,pattern:^(text|json)$,default:text,description:返回结果格 式默认为text建议使用text。可选标志[text, json]}},required:[trainCode,departDate],additionalProperties:false,$schema:http://json-schema.org/draft-07/schema#},execution:{taskSupport:forbidden}}]},jsonrpc:2.0,id:1}C:\Users\jffc