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
伺服器配置
{
"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"
}
}
}
}