A Model Context Protocol (MCP) server to retrieve train schedules from National Rail
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.
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.
Everything the assistant can do here goes through one of these:
get_live_departures — get_live_arrivalsget_departures_by_date — get_arrivals_by_datePrerequisites — The Prerequisites tool exposed by this serverSetup — 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 theDevelopment — Run the inspector with the following command: bash npx @modelcontextprotocol/inspector node dist/index.js@smithery/cli on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.
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.
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.
| Tool | What it does |
|---|---|
| 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 following to your MCP client configuration (~/Library/Application Support/Claud |
| Development | Run the inspector with the following command: bash npx @modelcontextprotocol/inspector node dist/index.js |
{
"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.
| Variable | Description | Required |
|---|---|---|
| RTT_API_USERNAME | Configuration value read at startup. | Optional |
| RTT_API_PASSWORD | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.