ns
A Model Context Protocol (MCP) server that provides access to NS (Dutch Railways) travel information through Claude AI. This server enables Claude to fetch real-time train travel information and disruptions using the official Dutch NS API.
claude mcp add --transport stdio r-huijts-ns-mcp-server npx -y ns-mcp-server \ --env NS_API_KEY="your_api_key_here"
How to use
This MCP server turns Claude into a Dutch railways expert by connecting it to real-time NS (Nederlandse Spoorwegen) travel information. With the ns-server MCP, you gain access to real-time departures and arrivals, journey planning with transfers and live updates, and service disruption information. You can also retrieve pricing details for tickets, compare travel classes, and explore station information including facilities and OV-fiets availability. The server exposes multi-language support (Dutch and English) and flexible query capabilities so Claude can answer questions about specific stations, routes, delays, and alternatives. To use it, configure Claude to point at the ns-server MCP and supply your NS API key via the NS_API_KEY environment variable. Once configured, Claude can issue natural language requests like “When is the next train from Almere to Amsterdam?” or “What’s the price for a return ticket to Den Haag for 2 adults?” and receive structured, real-time NS data in response.
How to install
Prerequisites:
- Node.js and npm installed on your system
- An NS API key from the NS API Portal
- Access to Claude Desktop or your MCP orchestration environment
Three installation options are supported:
- Using Claude Desktop with NPM Package
- Update Claude configuration file (~/. Claude/claude_desktop_config.json) to include:
{
"mcpServers": {
"ns-server": {
"command": "npx",
"args": [
"-y",
"ns-mcp-server"
],
"env": {
"NS_API_KEY": "your_api_key_here"
}
}
}
}
- Obtain an API key from NS API Portal: https://apiportal.ns.nl/
- Using Smithery
- Install NS Travel Information Server via Smithery:
npx -y @smithery/cli install ns-server --client claude
- 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
- Update Claude configuration to point to the local server, for example:
{
"mcpServers": {
"ns-server": {
"command": "node",
"args": [
"/path/to/ns-server/build/index.js"
],
"env": {
"NS_API_KEY": "your_api_key_here"
}
}
}
}
- Replace /path/to/ns-server with the actual install path and restart Claude Desktop to apply changes.
Additional notes
Tips and common notes:
- Ensure NS_API_KEY is present in the environment where the MCP runs; without it, real-time data access will fail.
- If running from source, build or point to the correct built index.js location as shown in the node example.
- Some environments may require a restart of Claude or the MCP service after changing environment variables or configuration.
- The MCP exposes real-time train information, pricing, station details, and journey planning. Use clear queries in Claude like “next departure from Utrecht Centraal” or “price for a return trip to Rotterdam.”
- Review NS API usage limits and terms to avoid throttling or unexpected blocks.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud