Skip to content

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.

License

Notifications You must be signed in to change notification settings

r-huijts/ns-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NS Logo NS Travel Information Server MCP server

NS Travel Information MCP Server

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.

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?"
  • "Is there first class quiet workspace available on the Amsterdam to Rotterdam route?"
  • "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?"

Setup

  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
    
    You can get an API key from NS API Portal

Integration with Claude Desktop

To add this server to Claude Desktop, update your Claude configuration file (~/Library/Application Support/Claude/claude_desktop_config.json) by adding the following to the mcpServers object:

{
  "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

After updating the configuration, restart Claude Desktop for the changes to take effect.

🔑 Environment Variables

Variable Description
NS_API_KEY Your NS API key (required)

🌟 Features

This MCP server enables Claude to:

  • Access real-time departure and arrival information
  • Find optimal travel routes across the Netherlands
  • Check for service disruptions and engineering works
  • Provide platform information and station facilities
  • Get pricing information for your journey
  • Check OV-fiets (bike rental) availability at stations

License

This project is licensed under the MIT License - see the LICENSE file for details

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published