NS Travel MCP Server
Provides real-time Dutch Railways (NS) data for journey planning, live departures, disruptions, and station search.
README
NS Travel MCP Server
This MCP server provides real-time Dutch Railways (NS) data for journey planning, live departures, disruptions, and station search.
Features
- Journey Planning - Plan optimal routes between stations with real-time updates
- Live Departures - Get real-time departure boards for any station
- Disruption Alerts - Check service disruptions and maintenance work
- Station Search - Find stations with auto-suggestions
Prerequisites
-
NS API Key: Get your free API key from NS API Portal
- Sign up for an account
- Subscribe to the "NS App" product (free)
- Copy your subscription key
-
Cloudflare Account: Sign up at Cloudflare
-
Wrangler CLI: Install globally
npm install -g wrangler
Setup Instructions
1. Clone and Install Dependencies
# Create project directory
git clone git@github.com:lauragift21/ns-travel-mcp.git
cd ns-mcp-server
# Install dependencies
npm install
2. Set Environment Variables
# Set your NS API key as a secret
npx wrangler secret put NS_API_KEY
# Paste your NS API subscription key when prompted
Local Development
Create a .dev.vars file in the project root with your NS API key:
NS_API_KEY=your_ns_api_key
4. Deploy
# Deploy to Cloudflare Workers
npx wrangler deploy
# Your MCP server will be available at:
# https://ns-travel-mcp.your-subdomain.workers.dev
Using with MCP Client (e.g Claude Desktop)
To use this MCP server with Claude Desktop, add it to your configuration: ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ns-mcp-server": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-deployment.workers.dev/sse"
],
"env": {
"NS_API_KEY": "<YOUR_API_KEY"
}
}
}
}
Connect to Cloudflare AI Playground
You can connect your MCP server from the Cloudflare AI Playground, which is a remote MCP client:
- Go to https://playground.ai.cloudflare.com/
- Enter your deployed MCP server URL (remote-mcp-server-authless.<your-account>.workers.dev/sse)
- You can now use your MCP tools directly from the playground!
Common Use Cases
Basic Journey Planning
Plan my journey from Amsterdam Centraal to Utrecht Centraal tomorrow at 8:00 AM
Weekend Travel
Plan a trip from Amsterdam Centraal to Rotterdam Centraal this Saturday at 2:00 PM. I want to see both earlier and later options.
Route Impact Assessment
Are there any disruptions that would affect travel between Amsterdam and Utrecht?
Planned vs Unplanned Issues
Show me both planned maintenance and unexpected disruptions happening today
Find Stations
Find all train stations in Amsterdam
Airport Connection
I'm flying into Schiphol at 3:00 PM. What's the best way to get to Amsterdam Centraal, and when should I expect to arrive?
Event Planning
I have a meeting in Rotterdam at 10:00 AM. What time should I leave from Amsterdam Centraal to arrive on time?
Emergency Alternatives
My usual train from Amsterdam to Utrecht is cancelled. What are my alternative options?
Night Travel
What are the last trains from Amsterdam Centraal to Utrecht tonight?
Troubleshooting
Common Issues
-
API Key Error: Ensure your NS API key is correctly set
wrangler secret put NS_API_KEY -
Station Not Found: Use exact station names or codes
- ✅ "Amsterdam Centraal" or "asd"
- ❌ "Amsterdam Central" or "amsterdam"
-
CORS Issues: The server includes CORS headers for browser requests
-
Rate Limiting: NS API has rate limits - implement caching if needed
Debug Mode
# Run locally for debugging
npx wrangler dev
# Check logs
npx wrangler tail
Resources
- NS API Documentation: apiportal.ns.nl
- Cloudflare Workers: developers.cloudflare.com
- Model Context Protocol modelcontextprotocol.io/introduction
License
MIT License - Feel free to modify and extend for your needs!
Built with ❤️ by Gift Egwuenu | Powered by MCP & Cloudflare Workers
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。