Ns 旅行信息 Mcp 服务器
一个模型上下文协议(MCP)服务器,通过Claude AI提供对荷兰铁路(NS)旅行信息的访问。该服务器使Claude能够使用官方荷兰NS API获取实时火车旅行信息和干扰情况。
概览
什么是 ns-mcp-server?
ns-mcp-server 是一个模型上下文协议(MCP)服务器,旨在通过 Claude AI 提供来自荷兰铁路(NS)的实时旅行信息。这个创新的服务器允许用户使用官方 NS API 获取最新的火车时刻表、旅行中断和其他重要的旅行数据。它充当用户与荷兰铁路提供的丰富旅行信息之间的桥梁,通过即时访问关键数据来增强旅行体验。
ns-mcp-server 的特点
- 实时数据访问:服务器连接到官方 NS API,确保用户获得最新的旅行信息。
- 与 Claude AI 的集成:通过利用 Claude AI,服务器可以解释用户查询并无缝提供相关的旅行信息。
- 用户友好的界面:服务器以可用性为设计理念,使用户能够轻松访问火车时刻表和中断信息。
- 开源:ns-mcp-server 是公开可用的,鼓励全球开发者的合作和贡献。
如何使用 ns-mcp-server
- 安装:使用以下命令从 GitHub 克隆代码库:
git clone https://github.com/r-huijts/ns-mcp-server.git
- 设置:按照代码库的 README 文件中提供的安装说明,在本地机器上设置服务器。
- API 访问:利用服务器向 NS API 发出请求。您可以通过 Claude AI 发送查询以获取实时旅行信息。
- 探索功能:尝试不同的查询,以了解服务器的全部功能以及它如何帮助旅行规划。
常见问题解答
ns-mcp-server 是用什么编程语言构建的?
ns-mcp-server 主要使用 JavaScript 构建,使其对熟悉网络技术的开发者易于访问。
使用 ns-mcp-server 是否需要费用?
不,ns-mcp-server 是开源的,免费使用。然而,用户应注意官方 NS API 设定的任何使用限制或条款。
我可以为 ns-mcp-server 项目做贡献吗?
当然可以!欢迎贡献。您可以在 GitHub 代码库上提交问题、功能请求或拉取请求。
我该如何报告服务器的错误或问题?
您可以通过在 GitHub 代码库上打开一个问题来报告错误或问题。请确保提供有关您遇到的问题的详细信息。
我在哪里可以找到 ns-mcp-server 的文档?
文档通常可以在代码库的 README 文件中找到,以及代码本身中的注释。有关更详细的指导,您还可以查看 GitHub 上的问题和讨论部分。
详情
| <img src="https://upload.wikimedia.org/wikipedia/commons/b/b7/Nederlandse_Spoorwegen_logo.svg" alt="NS Logo" width="380"/> | <img src="https://glama.ai/mcp/servers/tzd5oz5tov/badge" alt="NS Travel Information Server MCP server" width="380"/> | |::|::|
NS Travel Information MCP Server
Transform your AI assistant into a Dutch railways expert! This MCP server connects Claude to real-time NS (Nederlandse Spoorwegen) travel information, making it your perfect companion for navigating the Netherlands by train.
Installation
You can install this server in three ways:
1. Using Claude Desktop with NPM Package
Update your Claude configuration file (~/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"
}
}
}
}
You can get an API key from NS API Portal
2. Using Smithery
To install NS Travel Information Server automatically via Smithery:
npx -y @smithery/cli install ns-server --client claude
3. From Source
- Clone this repository
- Install dependencies:
npm install
- Copy the example environment file:
cp .env.example .env
- Add your NS API key to the
.env
file:NS_API_KEY=your_api_key_here
Then update your Claude configuration file:
{
"mcpServers": {
"ns-server": {
"command": "node",
"args": [
"/path/to/ns-server/build/index.js"
],
"env": {
"NS_API_KEY": "your_api_key_here"
}
}
}
}
Make sure to:
- Replace
/path/to/ns-server
with the actual path to your installation - Add your NS API key in the
env
section. It can be obtained from here https://apiportal.ns.nl/product#product=NsApp
After updating the configuration, restart Claude Desktop for the changes to take effect.
Real-World Use Cases
- "Is my usual 8:15 train from Almere to Amsterdam running on time?"
- "Are there any delays on the Rotterdam-Den Haag route today?"
- "What's the best alternative route to Utrecht if there's maintenance on the direct line?"
- "Which train should I take to arrive at my office in Amsterdam Zuid before 9 AM?"
- "Which route to Amsterdam has the fewest transfers with a stroller?"
- "What's the earliest train I can take to make my 10 AM meeting in The Hague?"
- "When's the last train back to Groningen after a night out in Amsterdam?"
- "Are there any weekend engineering works that might affect my Monday morning class?"
- "Are there OV-fiets bikes available at Utrecht Centraal for my afternoon meeting?"
- "Is Eindhoven Strijp-S station wheelchair accessible and what platforms does it have?"
- "What trains are arriving at Utrecht Centraal in the next hour?"
- "Has the train from Venlo to Schiphol Airport arrived on time?"
- "How much does a first-class ticket from Amsterdam to Rotterdam cost?"
- "What's the price for 2 adults and 1 child traveling to Den Haag?"
🔑 Environment Variables
Variable | Description |
---|---|
NS_API_KEY | Your NS API key (required) |
🌟 Features
This MCP server provides comprehensive access to NS train information through the following endpoints:
Real-time Train Information
- Departures: Get real-time departure information including platform numbers, delays, and travel notes
- Arrivals: Access upcoming train arrivals with origin stations, platform changes, and status updates
- Journey Planning: Find optimal travel routes with transfers and real-time updates
- Service Updates: Check for disruptions, maintenance work, and engineering activities
Pricing Information
- Ticket Prices: Get accurate pricing for single and return journeys
- Travel Classes: Compare prices for first and second class travel
- Group Pricing: Calculate fares for adults and children
- Discount Options: Check joint journey discounts and special offers
- Validity Details: View ticket validity periods and travel conditions
Station Information
- Station Details: Access comprehensive station information including:
- Facilities and accessibility features
- Platform layouts and track information
- OV-fiets (bike rental) availability
- Location and approach details
Additional Features
- Multi-language Support: Information available in Dutch and English
- Flexible Queries: Search by station name, code, or UIC identifier
- Time Zones: Proper handling of time zones for international stations
- Status Updates: Track changes, delays, and cancellations in real-time
License
This project is licensed under the MIT License - see the LICENSE file for details
Server配置
{
"mcpServers": {
"ns-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--r-huijts--ns-mcp-server--ns-mcp-server",
"node ./build/index.js"
],
"env": {
"NS_API_KEY": "ns-api-key"
}
}
}
}