A Model Context Protocol (MCP) server to retrieve train schedules from National Rail
https://github.com/lucygoodchild/mcp-national-railYour AI agents need access to live train data, but building a National Rail integration from scratch means wrestling with APIs, authentication, and data formatting. This MCP server handles all that complexity, giving your agents instant access to UK train schedules through a clean, standardized interface.
Every time you need train data in an AI project, you face the same tedious setup: API keys, endpoint documentation, response parsing, error handling. The MCP National Rail server eliminates this repetitive work by providing a plug-and-play solution that works with any MCP-compatible AI system.
What you get immediately:
The server exposes exactly what you need without the bloat:
get_live_departures
- Real-time departures from any stationget_live_arrivals
- Live arrival informationget_departures_by_date
- Historical/future departure schedulesget_arrivals_by_date
- Historical/future arrival schedulesTravel Planning Agents: Build AI assistants that can check train times, suggest alternative routes during delays, and provide real-time updates throughout a journey.
Business Intelligence: Create agents that analyze commuter patterns, track punctuality statistics, or generate travel reports for expense management.
Customer Service Bots: Deploy AI that can instantly check train status, explain delays, and suggest alternative connections without human intervention.
Smart Home Integration: Connect train data to home automation - your lights turn on automatically when your delayed train finally approaches the station.
The server connects to the Realtime Trains API, so you get comprehensive UK rail data without dealing with multiple data sources or inconsistent formats.
Via Smithery (recommended):
npx -y @smithery/cli install @lucygoodchild/mcp-national-rail --client claude
Manual installation:
Since it's built on the Model Context Protocol, this server works with Claude Desktop, custom MCP clients, or any AI system that supports MCP. No architectural changes needed - just add it to your server configuration and your agents can start accessing train data.
The server handles all the authentication, rate limiting, and data normalization behind the scenes. Your AI agents get clean, consistent responses whether they're asking about rush hour departures from London Paddington or late-night arrivals at a rural station.
Ready to give your AI agents real-time access to the UK rail network? The MCP National Rail server turns train data integration from a multi-day project into a five-minute setup.