MCP HubMCP Hub
r-huijts

ns-mcp-server

by: r-huijts

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.

22created 04/12/2024
Visit
API
Claude

📌Overview

Purpose: The NS Travel Information MCP Server aims to transform your AI assistant into a knowledgeable expert on Dutch railways, providing real-time travel information for navigating the train system in the Netherlands.

Overview: This server connects the AI assistant Claude with the Nederlandse Spoorwegen (NS) API, enabling users to access a variety of services related to train schedules, ticket pricing, journey planning, and station information. The setup is straightforward, with multiple installation options and the ability to obtain real-time updates and essential travel details.

Key Features:

  • Real-time Train Information: Access current departure and arrival data, including delays, platform changes, and journey planning assistance.

  • Pricing Information: Retrieve accurate fare details for various travel classes, group pricing options, and any available discounts.

  • Station Information: Gain comprehensive insights into train stations, including facilities, accessibility options, and OV-fiets bike rental availability.

  • Multi-language Support: Information is available in both Dutch and English to cater to a wider audience.

  • Flexible Queries: Supports searches by station names, codes, or UIC identifiers, ensuring ease of access to information.

  • Time Zone Handling: Proper management of time zones for international travelers ensures accurate scheduling.


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.

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 the NS API Portal.

2. Using Smithery

To install NS Travel Information Server 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 replace /path/to/ns-server with the actual path to your installation and add your NS API key in the env section.

Real-World Use Cases

  • Inquire about train timeliness and delays.
  • Ask for alternative routes during maintenance.
  • Query for accessible platforms and facilities at stations.
  • Request information about ticket prices and discounts.

Environment Variables

VariableDescription
NS_API_KEYYour NS API key (required)

Features

This MCP server provides comprehensive access to NS train information through the following endpoints:

Real-time Train Information

  • Departures and Arrivals
  • Journey Planning
  • Service Updates

Pricing Information

  • Ticket Prices
  • Travel Classes
  • Group Pricing
  • Discount Options
  • Validity Details

Station Information

  • Station Details
  • Facilities and accessibility features

Additional Features

  • Multi-language Support
  • Flexible Queries
  • Time Zone Handling
  • Status Updates

License

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