Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. 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"
      }
    }
  }
}
  1. Using Smithery
  • Install NS Travel Information Server via Smithery:
npx -y @smithery/cli install ns-server --client claude
  1. From Source
  1. Clone this repository
  2. Install dependencies:
npm install
  1. Copy the example environment file:
cp .env.example .env
  1. Add your NS API key to the .env file:
NS_API_KEY=your_api_key_here
  1. 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"
      }
    }
  }
}
  1. 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

Sponsor this space

Reach thousands of developers