Get the FREE Ultimate OpenClaw Setup Guide →

mcp-tfl-journey

🚇 MCP server for Transport for London journey data. AI-powered route planning with real-time alerts, disruptions & stop points. Built with Model Context Protocol for seamless AI integration.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio alisonborba-mcp-tfl-journey npx mcp-tfl-journey \
  --env TFL_API_KEY="your-api-key"

How to use

The TFL Journey MCP Server provides access to Transport for London journey data via the Model Context Protocol (MCP). It exposes capabilities to search for journeys between stations, retrieve real-time service alerts and disruptions, and fetch stop-point details as well as journey summaries. You can use it with AI assistants like Claude by configuring it as an MCP source, allowing natural language queries such as finding routes between two stations or asking for current service disruptions. The server uses your TFL API key to query the official data sources and returns structured results suitable for conversational agents. To enable it in Claude, supply the server as an MCP source and provide the required environment variable for authentication (TFL_API_KEY in the example).

Usage within an assistant typically involves invoking the journey search function with a from and to station code, then presenting options such as quickest route, total duration, and any transfer details. Real-time alerts can inform users of delays or closures, while stop-point information helps users orient themselves to specific stations and platforms. The available tools include search_journey (to find routes and timings), and access to alerts and stop information, all wrapped in an MCP interface for easy integration into chat-based workflows.

How to install

Prerequisites:

  • Node.js 18.x or later (npm is included with Node.js)
  • An active TFL API key (you can obtain one from the Transport for London developer portal)

Installation and run steps:

  1. Ensure you have Node.js installed

    • Check: node -v
    • Check: npm -v
  2. Obtain your TFL API key and keep it ready

  3. Run the MCP server with your API key (demo mode is available by using a placeholder key, but you can supply your own real key):

    TFL_API_KEY="your-api-key" npx mcp-tfl-journey

Optional (configure through Claude or your MCP config):

  • To run via your MCP runner, ensure the config maps the environment variable correctly (see mcp_config example).
  1. Verify the server starts and responds to queries from your MCP client or Claude integration. You should see startup logs indicating the server is ready and listening for requests.

Additional notes

Tips and considerations:

  • Protect your TFL_API_KEY; avoid hard-coding it in source files. Use environment variables in your deployment environment.
  • If you hit API rate limits, consider implementing request throttling or upgrading your TFL API plan as needed.
  • The provided quick-start uses npx for convenience; for production deployments you can wrap the same command in your preferred process manager or deployment platform using the mcpServers config structure.
  • Station codes (e.g., 9400ZZLUKSX for Kings Cross) are used by the search_journey tool; you can query with code values as shown in the README.
  • Ensure the environment where the MCP runs has network access to the TFL API endpoints and that any firewalls allow outbound HTTPS requests.
  • If Claude integration experiences issues, verify the Claude MCP config references the correct server name (tfl-journey) and that the environment variable TFL_API_KEY is provided in the deployment configuration.

Related MCP Servers

Sponsor this space

Reach thousands of developers