提供荷兰铁路(NS)旅行信息的MCP服务器。
404 查看 · 2026-07-07 更新
简介
提供荷兰铁路(NS)旅行信息的MCP服务器。
简介
提供荷兰铁路(NS)旅行信息的MCP服务器。
NS 旅行信息 MCP 服务器
将您的 AI 助手转变为荷兰铁路专家!此 MCP 服务器将 Claude 连接到实时 NS(Nederlandse Spoorwegen)旅行信息,使其成为您在荷兰乘坐火车旅行的完美伴侣。
安装
您可以使用以下三种方式安装此服务器:
1. 使用带有 NPM 包的 Claude 桌面版
更新您的 Claude 配置文件 (~/Library/Application Support/Claude/claude_desktop_config.json):
{ "mcpServers": { "ns-server": { "command": "npx", "args": [ "-y", "ns-mcp-server" ], "env": { "NS_API_KEY": "your_api_key_here" } } } }
您可以从 NS API Portal 获取 API 密钥。
2. 使用 Smithery
通过 Smithery 自动安装 NS 旅行信息服务器:
npx -y @smithery/cli install ns-server --client claude
3. 从源代码安装
- 克隆此仓库
- 安装依赖项:
npm install - 复制示例环境文件:
cp .env.example .env - 在
.env文件中添加您的 NS API 密钥:NS_API_KEY=your_api_key_here
然后更新您的 Claude 配置文件:
{ "mcpServers": { "ns-server": { "command": "node", "args": [ "/path/to/ns-server/build/index.js" ], "env": { "NS_API_KEY": "your_api_key_here" } } } }
请确保:
- 将
/path/to/ns-server替换为您实际的安装路径 - 在
env部分添加您的 NS API 密钥
更新配置后,重启 Claude Desktop 以使更改生效。
实际用例
- "我平时 8:15 从 Almere 到阿姆斯特丹的火车是否准时运行?"
- "今天鹿特丹到海牙的线路上是否有延误?"
- "如果直达线路有维护,去乌得勒支的最佳替代路线是什么?"
- "我要在早上 9 点前到达阿姆斯特丹南站,应该坐哪趟火车?"
- "哪条通往阿姆斯特丹的路线带婴儿车转乘最少?"
- "我要参加上午 10 点在海牙的会议,最早可以坐哪趟火车?"
- "晚上在阿姆斯特丹外出后,回格罗宁根的最后一班火车是什么时候?"
- "周末是否有工程可能影响我周一早上的课程?"
- "乌得勒支中央车站下午是否有可用的 OV-fiets 自行车供我开会使用?"
- "埃因霍温 Strijp-S 车站是否适合轮椅通行,有哪些站台?"
- "接下来一小时内哪些火车会到达乌得勒支中央车站?"
- "从芬洛到史基浦机场的火车是否准时到达?"
- "从阿姆斯特丹到鹿特丹的一等车厢票价是多少?"
- "两名成人和一名儿童前往海牙的票价是多少?"
🔑 环境变量
| 变量 | 描述 |
|---|---|
| NS_API_KEY | 您的 NS API 密钥(必需) |
🌟 功能
此 MCP 服务器通过以下端点提供全面的 NS 火车信息访问:
实时列车信息
- 发车信息: 获取实时发车信息,包括站台号、延误情况和旅行提示
- 到站信息: 查看即将到达的列车信息,包括始发站、站台变更和状态更新
- 行程规划: 查找最佳旅行路线,包括换乘和实时更新
- 服务更新: 检查中断、维护工作和工程活动
价格信息
- 票价: 获取单程和往返旅程的准确票价
- 旅行等级: 比较一等座和二等座的价格
- 团体票价: 计算成人和儿童的票价
- 折扣选项: 检查联程折扣和特别优惠
- 有效期详情: 查看车票的有效期和旅行条件
车站信息
- 车站详情: 访问全面的车站信息,包括:
- 设施和服务设施
- 站台布局和轨道信息
- OV-fiets(自行车租赁)可用性
- 位置和到达细节
其他功能
- 多语言支持: 提供荷兰语和英语信息
- 灵活查询: 通过车站名称、代码或UIC标识符进行搜索
- 时区处理: 正确处理国际车站的时区
- 状态更新: 实时跟踪变更、延误和取消
许可证
本项目采用MIT许可证 - 详见LICENSE文件中的详细信息
工具列表
-
get_disruptions: Get comprehensive information about current and planned disruptions on the Dutch railway network. Returns details about maintenance work, unexpected disruptions, alternative transport options, impact on travel times, and relevant advice. Can filter for active disruptions and specific disruption types.
-
get_travel_advice: Get detailed travel routes between two train stations, including transfers, real-time updates, platform information, and journey duration. Can plan trips for immediate departure or for a specific future time, with options to optimize for arrival time. Returns multiple route options with status and crowding information.
-
get_departures: Get real-time departure information for trains from a specific station, including platform numbers, delays, route details, and any relevant travel notes. Returns a list of upcoming departures with timing, destination, and status information.
-
get_ovfiets: Get OV-fiets availability at a train station
-
get_station_info: Get detailed information about a train station
-
get_current_time_in_rfc3339: Get the current server time (Europe/Amsterdam timezone) in RFC3339 format. This can be used as input for other tools that require date-time parameters.
-
get_arrivals: Get real-time arrival information for trains at a specific station, including platform numbers, delays, origin stations, and any relevant travel notes. Returns a list of upcoming arrivals with timing, origin, and status information.
-
get_prices: Get price information for domestic train journeys, including different travel classes, ticket types, and discounts. Returns detailed pricing information with conditions and validity.
服务配置
[{'mcpServers': {'ns-server': {'args': ['-y', 'ns-mcp-server'], 'command': 'npx', 'env': {'NS_API_KEY': 'your_api_key_here'}}}}, {'mcpServers': {'ns-server': {'args': ['/path/to/ns-server/build/index.js'], 'command': 'node', 'env': {'NS_API_KEY': 'your_api_key_here'}}}}]
来源
- 来源:github
- 链接:https://github.com/r-huijts/ns-mcp-server