mcp-national-rail

mcp-national-rail

Access live National Rail train data via MCP for AI agents.

1
Stars
3
Forks
1
Watchers
2
Issues
mcp-national-rail is a Model Context Protocol (MCP) server designed to enable AI agents to retrieve real-time and scheduled train information from National Rail using the Realtime Trains API. It facilitates live and historical lookups of departures and arrivals by exposing a set of tools through a standardized MCP interface. The server can be installed via Smithery or manually and configured for use with AI clients like Claude Desktop. Secure authentication with the Realtime Trains API is supported through user-provided credentials.

Key Features

Live train departures retrieval
Live train arrivals lookup
Historical departures by date
Historical arrivals by date
Integration with Realtime Trains API
Smithery CLI installation support
Node.js and cross-platform compatibility
Secure authentication via environment variables
Configurable for Claude Desktop
Supports Model Context Protocol (MCP)

Use Cases

Enabling AI assistants to fetch live train schedules for National Rail
Providing real-time departure and arrival information to productivity apps
Integrating National Rail data into custom AI tools or chatbots
Building travel advisory solutions utilizing up-to-date rail data
Automating travel plan generation based on train availability
Retrieving historical train operation data for analysis
Creating dashboards for tracking UK train services in real time
Augmenting mobility apps with direct train data lookups
Supporting users with accessibility needs in navigating rail services
Enhancing virtual agents for customer support in transport sectors

README

smithery badge

mcp-national-rail

A Model Context Protocol (MCP) server to retrieve train schedules from National Rail.

Overview

This project implements a server using the Model Context Protocol (MCP) that allows AI agents to retrieve train information on National Rail trains using the Realtime Trains API.

It provides tools for:

  • get_live_departures
  • get_live_arrivals
  • get_departures_by_date
  • get_arrivals_by_date

Installation

Real Time Trains API account can be created from here: https://api.rtt.io/

You will need to note down your API Auth credentials

Installing via Smithery

To install mcp-national-rail for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @lucygoodchild/mcp-national-rail --client claude

Manual Installation for Claude Desktop

Prerequisites

  • Node.js

Setup

  1. Clone this repository
  2. Install dependencies
bash
npm install
  1. Build and start the project
bash
npm run build
npm run start
  1. Add the following to your MCP client configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
bash
{
  "mcpServers": {
    "mcp-national-rail": {
      "command": "node",
      "args": ["/path/to/mcp-national-rail/dist/index.js"],
      "env": {
        "RTT_API_USERNAME": "your_rtt_api_username",
        "RTT_API_PASSWORD": "your_rtt_api_password"
      }
    }
  }
}

Make sure to replace "/path/to/mcp-national-rail/dist/index.js" with the actual path and add your RTT API username and password which can be created from here: https://api.rtt.io/

  1. Restart Claude

Development

  • Create .env file based on the example file
bash
RTT_API_USERNAME=your_rtt_api_username
RTT_API_PASSWORD=your_rtt_api_password

Run the inspector with the following command:

bash
npx @modelcontextprotocol/inspector node dist/index.js

Star History

Star History Chart

Repository Owner

Repository Details

Language TypeScript
Default Branch main
Size 21 KB
Contributors 2
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
95.96%
Dockerfile
4.04%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • NS Travel Information MCP Server

    NS Travel Information MCP Server

    Connects AI assistants to real-time Dutch train data.

    Provides an MCP server enabling AI assistants, such as Claude, to access and deliver real-time travel information from Nederlandse Spoorwegen (NS). Supports installation via NPM, Smithery, or from source, and requires an NS API key for operation. Offers endpoints for live train departures, arrivals, disruptions, alternative routes, station facilities, and ticket pricing. Designed to integrate seamlessly with AI platforms for enhanced Dutch railway expertise.

    • 43
    • MCP
    • r-huijts/ns-mcp-server
  • TripGo MCP Server

    TripGo MCP Server

    Remote MCP server providing transport location, departure, and routing tools via the TripGo API.

    TripGo MCP Server acts as a remote Model Context Protocol server that wraps the TripGo API, offering tools for retrieving transport-related locations, departures from transport stops, multi-modal trip planning, and trip URL retrieval. It is deployed on Cloudflare Workers and is accessible directly or via MCP-compatible clients such as Claude Desktop through the mcp-remote proxy. The server supports direct integration for context-aware transport queries and trip management, facilitating enhanced interactions with public transport data.

    • 2
    • MCP
    • skedgo/tripgo-mcp-server
  • attio-mcp-server

    attio-mcp-server

    MCP server for enabling Attio CRM access via AI model context clients.

    attio-mcp-server implements a Model Context Protocol (MCP) server that facilitates communication between MCP clients, such as Claude, and the Attio CRM API. It enables reading and writing company notes and records within Attio by leveraging a bearer token for authentication. Designed for Node.js, it provides streamlined integration with Attio for applications utilizing AI-driven model context protocols.

    • 16
    • MCP
    • hmk/attio-mcp-server
  • MCP Simple Timeserver

    MCP Simple Timeserver

    Provides local and UTC time to AI models via the Model Context Protocol.

    MCP Simple Timeserver provides current local time, timezone, and UTC information to AI models such as Claude by serving as a Model Context Protocol (MCP) tool. It offers two main endpoints: one for retrieving the user's local time and timezone, and another for fetching the current UTC time from an NTP server. The project supports both local and web server deployments and can be integrated into the Claude desktop app to enhance temporal awareness for LLMs.

    • 25
    • MCP
    • andybrandt/mcp-simple-timeserver
  • Yuque-MCP-Server

    Yuque-MCP-Server

    Seamless integration of Yuque knowledge base with Model-Context-Protocol for AI model context management.

    Yuque-MCP-Server provides an MCP-compatible server for interacting with the Yuque knowledge base platform. It enables AI models to retrieve, manage, and analyze Yuque documents and user information through a standardized Model-Context-Protocol interface. The server supports operations such as document creation, reading, updating, deletion, advanced search, and team statistics retrieval, making it ideal for AI-powered workflows. Inspired by Figma-Context-MCP, it facilitates contextual awareness and dynamic knowledge management for AI applications.

    • 31
    • MCP
    • HenryHaoson/Yuque-MCP-Server
  • AllTrails MCP Server

    AllTrails MCP Server

    MCP server for seamless AllTrails data access and integration

    AllTrails MCP Server provides Model Context Protocol (MCP) compliant access to AllTrails hiking trail data, enabling AI tools to search for trails and retrieve detailed trail information. It supports searching by national park and fetching comprehensive details such as difficulty, length, elevation, ratings, and route types. The server communicates via standard input/output and is designed for easy integration with MCP-compatible clients like Claude Desktop. Installation is flexible, supporting both virtual environments and system Python setups.

    • 6
    • MCP
    • srinath1510/alltrails-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results