MCP Connector

Access Real-Time Dutch Rail Data

MCP server connecting Claude to real-time NS (Dutch railways) departures, arrivals, pricing, and station info.

Works with ns api

Maintainer of this project? Claim this page to edit the listing.


90
Spark score
out of 100
Updated 11 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Integrate AI assistants with real-time Dutch railway information, enabling access to schedules, delays, pricing, and station details for seamless travel planning.

Outcomes

What it gets done

01

Retrieve live departure and arrival times with platform and delay information.

02

Plan optimal train routes, including transfers and alternative options.

03

Access ticket pricing and station-specific amenities and accessibility details.

04

Query real-time service updates for disruptions and maintenance.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-ns-travel-information | bash

Capabilities

Tools your agent gets

get_departures

Get real-time departure information including platform numbers and delays for a station.

get_arrivals

Get real-time arrival information including platform numbers and delays for a station.

plan_trip

Plan optimal routes between stations with transfer information and travel times.

get_service_updates

Retrieve service updates including disruptions, maintenance work, and delays.

get_ticket_prices

Get ticket pricing for different classes and group bookings between stations.

get_station_info

Get station information including amenities, accessibility, and OV-fiets availability.

search_stations

Search for stations by name, code, or UIC identifier with flexible matching.

Overview

NS Travel Information MCP Server

An MCP server that connects Claude to real-time NS (Nederlandse Spoorwegen) data - train departures, arrivals, journey planning, service disruptions, ticket pricing, and station facilities. It supports Dutch and English and requires an NS API key. Use when you want Claude to answer live questions about Dutch train travel - delays, alternative routes, station facilities, or ticket pricing.

What it does

This MCP server connects Claude to real-time NS (Nederlandse Spoorwegen) travel information, turning it into a Dutch-railways assistant that can answer questions about departures, arrivals, journey planning, service disruptions, ticket pricing, and station facilities across the Netherlands.

When to use - and when NOT to

Use it when you want Claude to answer real questions about Dutch train travel grounded in live NS data - checking whether a specific train is running on time, finding the best alternative route around maintenance work, planning arrival before a specific time, finding a route with the fewest transfers, checking OV-fiets bike availability or wheelchair accessibility at a station, pricing a ticket for a given number of adults and children, or checking which trains are arriving at a specific station in the next hour and whether a given train already arrived on time. Requires an NS API key from the NS API Portal, set via the NS_API_KEY environment variable.

Capabilities

Real-time train information: departures (platform numbers, delays, travel notes), arrivals (origin stations, platform changes, status), journey planning (optimal routes with transfers and real-time updates), and service updates (disruptions, maintenance, and engineering activities). Pricing information: single and return ticket prices, first- and second-class comparisons, group pricing for adults and children, joint-journey discounts and special offers, and ticket validity periods. Station information: facilities and accessibility features, platform layouts and track information, OV-fiets bike-rental availability, and location and approach details. Additional features: multi-language support (Dutch and English), flexible station lookup by name, code, or UIC identifier, correct time-zone handling for international stations, and real-time track-change, delay, and cancellation status.

How to install

Three installation methods. Via Claude Desktop with the npm package, add to claude_desktop_config.json:

{
  "mcpServers": {
    "ns-server": {
      "command": "npx",
      "args": [
        "-y",
        "ns-mcp-server"
      ],
      "env": {
        "NS_API_KEY": "your_api_key_here"
      }
    }
  }
}

Or install automatically via Smithery: npx -y @smithery/cli install ns-server --client claude. Or build from source: clone the repository, run npm install, copy .env.example to .env and add your NS_API_KEY, then point the Claude config's command at node with args set to the built build/index.js path. In every case, get an NS API key from the NS API Portal first, and restart Claude Desktop after updating the configuration. The project is MIT-licensed.

Who it's for

Commuters, travelers, and developers in the Netherlands who want Claude to answer real, live questions about NS train schedules, delays, alternative routes, station facilities, and ticket pricing - in Dutch or English - rather than checking the NS app or website separately.

Source README

MseeP.ai Security Assessment Badge

NS Logo NS Travel Information Server MCP server

NS Travel Information MCP Server

smithery badge
npm version

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

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Copy the example environment file:
    cp .env.example .env
    
  4. 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:

  1. Replace /path/to/ns-server with the actual path to your installation
  2. 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

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.