当前位置: 首页 > news >正文

怎么下载并安装node.js 且 启动 12306-mcp

Node.js — 下载 Node.js®

双击打开

千万不要勾选该选项,保持当前的未勾选状态,直接点击Next完成安装即可。

原因如下:

  • 勾选此项后,安装程序会在结束后自动下载并安装 Python 和 Visual Studio Build Tools 等编译工具,这个过程非常耗时,且会占用大量 C 盘空间。

  • 运行12306-mcp项目完全不需要这些原生编译工具,不勾选可以避免不必要的麻烦和等待。

后续步骤提醒:

  1. 点击Next完成安装后,务必关闭并重新打开命令行工具(CMD 或 PowerShell)。

  2. 输入node -vnpm -v,如果能输出版本号,说明 Node.js 环境配置成功。

  3. C:\Users\jffc>node -v
    v24.19.0

    C:\Users\jffc>npm -v
    11.17.0

    C:\Users\jffc>npm config set registry https://registry.npmmirror.com/

    C:\Users\jffc>npm config get registry
    https://registry.npmmirror.com/

    C:\Users\jffc>npx -y 12306-mcp --port 8088
    npm warn deprecated @modelcontextprotocol/server-legacy@2.0.0: This package is a frozen copy of v1's 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/mcp
    SSE MCP Server listening at http://[::]:8088/sse

  4. 12306-mcp

  5. Microsoft Windows [版本 10.0.19045.6466]
    (c) Microsoft Corporation。保留所有权利。

    C:\Users\jffc>curl -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, UTC+8)为准,返回格式为 \"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>

http://www.jsqmd.com/news/1402367/

相关文章:

  • Haar小波子带剪枝:一种无需重训练的LLM后训练压缩实践指南
  • 从Codex用户流失看AI开发工具体验优化:安装、集成与长期维护
  • DMR 专网项目复盘:黑龙江某林区通信改造客户反馈记录
  • 开源船舶管理系统OpenShip:从架构设计到二次开发实战
  • 从OpenClaw实战看云服务CLI工具:自动化运维与DevOps效率提升
  • KaihongOS 桌面版原生 VS Code 上线
  • 第4章 运算符与表达式
  • 机器学习数据集全解析:从概念到实战应用
  • HLS高层次综合设计--if(j == 0)引发的c/rtl协同仿真异常
  • HBuilderX彻底卸载指南:深度清理残留文件与配置,解决编译慢、内存溢出问题
  • AI智能体事故追踪:从数据模型到工程落地的全链路实践
  • 零基础读懂 HTTP 与 API:一篇文章打通你的第一次接口调用
  • 双栈实现队列:数据结构转换与摊还时间复杂度解析
  • 【2026年上海寄大件选哪家物流最划算?实测省钱攻略】 - 快递物流资讯
  • 2026年上海旧房翻新:质保期长短写进合同,口头承诺不受法律保护 - 优家闲谈
  • 《走出对话框,迎接工作流——AI Agent赋能桌面自动化》第一章:行业痛点与破局之道
  • C/C++中const关键字与指针、引用的位置关系全解析
  • 辊压成形技术:从原理到实践,掌握金属塑性成形的核心工艺
  • DOTween动画:TweenManager深度解析
  • AI 可以替我读完一本书,但不能替我经历阅读
  • 每天 100 积分,第 7 天 1000:我把 WorkBuddy 签到做成了「全自动」
  • 2026甄选:南京搬家市场中专业团队与高性价比服务公司的务实选择 - 卓企推荐
  • IntelliJ IDEA构建报错java.lang.IllegalArgumentException: MALFORMED排查指南
  • 深入解析x86汇编DIV指令:从整数除法原理到溢出规避实战
  • Windows 10下nvidia-smi命令失效的全面诊断与修复指南
  • 2026 年更新:韶山可靠的短视频获客推广公司哪家靠谱,靠这招,居然让门店客流转手翻了3倍?做实体的都该看看 - 行业推荐官[官方】--
  • 基于scrcpy构建安卓设备矩阵投屏控制中心:原理、架构与实现
  • SpaceMind:相机引导式模态融合如何革新VLM空间推理能力
  • AI总乱改代码?一个规则文件帮你搞定!99%的人都没设置!附万能模板!
  • 医院数字食堂开放平台API设计:HIS对接与数据交换实践