MCP MCP Server

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

Local serverstdio

What is the MCP MCP server?

A Model Context Protocol (MCP) server to retrieve train schedules from National Rail. The mcp mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 5 defined tools rather than through you.

What it actually does

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.

Its toolset

Everything the assistant can do here goes through one of these:

  • get_live_departures — get_live_arrivals
  • get_departures_by_date — get_arrivals_by_date
  • Prerequisites — The Prerequisites tool exposed by this server
  • Setup — 1. Clone this repository 2. Install dependencies bash npm install 3. Build and start the project bash npm run build npm run start 4. Add the
  • Development — Run the inspector with the following command: bash npx @modelcontextprotocol/inspector node dist/index.js

Adding it to your client

@smithery/cli on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Configuration

You will need 2 environment variables: RTT_API_USERNAME, RTT_API_PASSWORD. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js

When to reach for it

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MCP's toolset — get_live_departures, get_departures_by_date, Prerequisites and 2 more — is a fair guide to whether it matches your workflow. It is maintained by lucygoodchild; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcp mcp server does with a few real requests.

Available tools

ToolWhat it does
get_live_departuresget_live_arrivals
get_departures_by_dateget_arrivals_by_date
PrerequisitesThe Prerequisites tool exposed by this server.
Setup1. Clone this repository 2. Install dependencies bash npm install 3. Build and start the project bash npm run build npm run start 4. Add the following to your MCP client configuration (~/Library/Application Support/Claud
DevelopmentRun the inspector with the following command: bash npx @modelcontextprotocol/inspector node dist/index.js

How to install the MCP MCP server

{
  "mcpServers": {
    "national-rail": {
      "command": "npx",
      "args": ["-y", "@smithery/cli"],
      "env": {
        "RTT_API_USERNAME": "your-value",
        "RTT_API_PASSWORD": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Node.js
VariableDescriptionRequired
RTT_API_USERNAMEConfiguration value read at startup.Optional
RTT_API_PASSWORDConfiguration value read at startup.Optional

Example prompts to try

  • Use MCP to get live departures.
  • Use MCP to get departures by date.
  • Use MCP to Prerequisites.

Frequently asked questions

It is an MCP server that enables AI agents to query National Rail train schedules in real time, using the Realtime Trains API.