mcp-national-rail
About
A Model Context Protocol (MCP) server to retrieve train schedules from National Rail
Details
- Author
- lucygoodchild
- GitHub stars
- 7
- Downloads
- 175
- Categories
- Other
Jump to
- Retrieve live train departures and arrivals.
- Retrieve departures and arrivals by date.
- Integrates with National Rail via the Realtime Trains API.
- Simple installation via Smithery or manual setup.
- Built on the Model Context Protocol for AI agents.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
mcp-national-railCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install via Smithery or manually for Claude Desktop. Manual installation requires Node.js, cloning the repository, running npm install, npm build, and npm start, then adding the server to the MCP client configuration with environment variables for your Realtime Trains API username and password.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp-national-rail": {
"mcp-national-rail": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@lucygoodchild/mcp-national-rail",
"--client",
"claude"
]
}
}
}
}
McpServers
{
"mcp-national-rail": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@lucygoodchild/mcp-national-rail",
"--client",
"claude"
]
}
}
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:
npx -y @smithery/cli install @lucygoodchild/mcp-national-rail --client claude
Manual Installation for Claude Desktop
Prerequisites
- Node.jsSetup
1. Clone this repository
2. Install dependencies
npm install
3. Build and start the project
npm run build
npm run start
4. Add the following to your MCP client configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"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/
5. Restart Claude
Development
- Create .env file based on the example fileRTT_API_USERNAME=your_rtt_api_username
RTT_API_PASSWORD=your_rtt_api_password
Run the inspector with the following command:
npx @modelcontextprotocol/inspector node dist/index.js
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



