ns-travel
MCP server for Dutch Railways (NS) - real-time train data, journey planning, and disruption alerts
claude mcp add --transport stdio lauragift21-ns-travel-mcp npx wrangler dev \ --env NS_API_KEY="your_ns_api_key"
How to use
NS Travel MCP Server provides real-time Dutch Railways (NS) data for journey planning, live departures, disruptions, and station search. This MCP server is deployed as a Cloudflare Workers project and uses the NS API to fetch live information, then exposes MCP-compatible endpoints that clients can query for planning routes, departures, and disruptions. To use it, deploy the worker (wraps the MCP server logic) and point your MCP client at the deployed URL. The server expects an NS API key for access to NS data, which you supply via environment configuration (for example, NS_API_KEY). Tools available include journey planning queries, live departure boards for stations, disruption alerts, and station search with auto-suggest. The MCP client can be Claude Desktop or Cloudflare AI Playground, among others, to send natural language requests and receive structured responses from the MCP server.
How to install
Prerequisites:
- Node.js and npm installed
- Cloudflare account and Wrangler CLI installed
- NS API Key from NS API Portal
Installation steps:
-
Clone the repository and install dependencies git clone https://github.com/lauragift21/ns-travel-mcp.git cd ns-travel-mcp npm install
-
Configure NS API Key as a secret (during deployment) or set locally for development
- For deployment (Cloudflare Workers): npx wrangler secret put NS_API_KEY (paste your NS API subscription key when prompted)
-
Run the MCP server locally (development mode using Wrangler) npx wrangler dev
-
Deploy to Cloudflare Workers npx wrangler deploy
-
Use the deployed MCP endpoint in your MCP client configuration (the exact URL will be shown after deployment, e.g., https://ns-travel-mcp.your-subdomain.workers.dev/sse)
Additional notes
Tips and common issues:
- Ensure your NS_API_KEY is valid and has access to required NS data products (Journey Planning, Live Departures, Disruptions, Station Search).
- When running locally, set NS_API_KEY as an environment variable or use Wrangler secrets. For production, deploy with Wrangler and rely on Cloudflare Workers environment.
- If you encounter CORS or rate-limiting, implement client-side caching and respect NS API rate limits to avoid throttling.
- The MCP server is designed to be invoked by MCP clients (Claude Desktop, Cloudflare AI Playground, etc.) via a remote MCP URL. Use the provided examples to format requests correctly.
- To connect via Claude Desktop, refer to the example in the README and provide the deployment URL along with your NS_API_KEY in the config.
Related MCP Servers
mcp
MCP server for the Cloudflare API
furi
CLI & API for MCP management
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
CodeRAG
Advanced graph-based code analysis for AI-assisted software development
google -remote
Collection of Google-native tools (e.g., Gmail, Calendar) for the MCP
canlii
canlii mcp for people in law in canada