home / mcp / london transport mcp server

London Transport MCP Server

Provides live TfL data through three tools: get_line_status, get_line_status_detail, and plan_journey.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "anoopt-london-tfl-journey-status-mcp-server": {
      "command": "npx",
      "args": [
        "london-transport-mcp"
      ],
      "env": {
        "TFL_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You can access real-time Transport for London data through this MCP server, giving you fast line status, detailed disruptions, and journey planning capabilities for London. Use it with an MCP client to empower AI assistants to fetch live transport information and plan trips on the fly.

How to use

Connect your MCP client to the London transport MCP server, then you can ask for the current status of a TfL line, get detailed disruption information, or plan journeys between locations in London. Typical workflows include checking if your line is running normally before you travel, understanding any service issues, and selecting the best route for your journey.

How to install

Prerequisites: you need Node.js installed on your system (v18+ is recommended). You also need npm which comes with Node.js.

Choose your preferred installation method. The quickest method is to install the MCP server globally via npm.

npm install -g london-transport-mcp

Additional configuration and run details

Set up your TfL API key to authorize requests. You can either provide it via an environment variable or include it in the MCP configuration.

# Environment variable (recommended)
export TFL_API_KEY="your_actual_tfl_api_key_here"

# Windows PowerShell
$env:TFL_API_KEY="your_actual_tfl_api_key_here"

Security and keys

Keep your TfL API key secure. Do not expose it in public repositories. Use environment variables or secure configuration mechanisms in your MCP client setup.

Troubleshooting tips

If you encounter issues, ensure Node.js is version 18 or newer, and that your TfL API key is correctly set in the environment or the MCP config. You can also test basic tool calls after starting the MCP server to verify connectivity.

Available tools

get_line_status

Fetches the current status of a specified TfL line (for example, Central, Victoria, or Piccadilly).

get_line_status_detail

Retrieves detailed status information including disruption details for a TfL line.

plan_journey

Plans journeys between two locations using the TfL Journey Planner, returning optimal routes and options.