developer-tools

Transport for London

anoopt

by anoopt

Get real-time London transport updates, plan journeys across London’s underground & bus routes, and manage your Oyster c

Provides real-time London transport data including tube line status, detailed disruption information, and comprehensive journey planning between any London locations or UK postcodes with intelligent location disambiguation and multi-modal route options.

github stars

0

0 commentsdiscussion

Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.

Real-time TfL dataUK-wide postcode supportMulti-modal routing

best for

  • / Travel apps and commuter tools
  • / London-based services needing transport data
  • / Journey planning integrations
  • / Real-time transport monitoring

capabilities

  • / Check tube line status and delays
  • / Get detailed disruption information
  • / Plan journeys between London locations
  • / Search UK postcodes for route planning
  • / Access multi-modal transport options
  • / Resolve ambiguous location names

what it does

Get real-time London transport data including tube status, disruptions, and journey planning between any UK locations.

about

Transport for London is a community-built MCP server published by anoopt that provides AI assistants with tools and capabilities via the Model Context Protocol. Get real-time London transport updates, plan journeys across London’s underground & bus routes, and manage your Oyster c It is categorized under developer tools.

how to install

You can install Transport for London in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

license

MIT

Transport for London is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

readme

TfL (Transport for London) Status & Journey Planner MCP Server

This Model Context Protocol (MCP) server provides AI assistants with access to real-time Transport for London data through a set of automated tools.

⚠️ Important Disclaimer: This is not an official Transport for London (TfL) MCP server. This is an independent project that uses the publicly available TfL Unified API to provide transport data. It is not affiliated with, endorsed by, or officially supported by Transport for London.

Demo Video

TfL MCP Server Demo

🚇 What This MCP Server Does

This server enables AI assistants (like Claude Desktop and VS Code GitHub Copilot) to access live TfL data by providing three main capabilities:

🔧 Available Tools

  1. get_line_status - Get the current status of any TfL line (e.g., Central, Victoria, Piccadilly)
  2. get_line_status_detail - Get detailed status information including disruption details for a TfL line
  3. plan_journey - Plan journeys between two locations using the TfL Journey Planner

🎯 Use Cases

With this MCP server connected, AI assistants can help users:

  • Check if their tube line is running normally before commuting
  • Get detailed information about service disruptions
  • Plan optimal routes between London locations
  • Provide real-time transport advice for London travel

Example interactions:

  • "Is the Central line running normally?"
  • "Plan a journey from King's Cross to Heathrow Airport"
  • "What's causing delays on the Northern line today?"

Let's set things up!

🚦 Getting Started

Choose your preferred installation method:

📦 Option 1: Quick Install via npm (Recommended)

The easiest way to use this MCP server is through npm:

Installation

npm install -g london-transport-mcp

🔐 Set up your TfL API key

You can get a free API key from the TfL API Portal.

Method 1: Environment Variable (Recommended) Set the environment variable in your system:

# Windows (PowerShell)
$env:TFL_API_KEY="your_actual_tfl_api_key_here"

# macOS/Linux
export TFL_API_KEY="your_actual_tfl_api_key_here"

Method 2: MCP Configuration Include the API key directly in your MCP configuration (see examples below).

AI Assistant Configuration

For Claude Desktop (Settings → Developers → Edit Config):

{
  "mcpServers": {
    "london-transport": {
      "command": "npx",
      "args": ["london-transport-mcp"],
      "env": {
        "TFL_API_KEY": "your_actual_tfl_api_key_here"
      }
    }
  }
}

For VS Code GitHub Copilot (Settings → GitHub Copilot › MCP: Servers):

{
  "london-transport": {
    "command": "npx",
    "args": ["london-transport-mcp"],
    "env": {
      "TFL_API_KEY": "your_actual_tfl_api_key_here"
    }
  }
}

That's it! No manual installation or path configuration required.


🛠️ Option 2: Local Development Setup

For developers who want to modify the code or contribute:

⚙️ Prerequisites

Before starting, please ensure you have:

Warning: if you run with a lower version of Node, fetch won't be present. Tools use fetch to make HTTP calls. To work around this, you can modify the tools to use node-fetch instead. Make sure that node-fetch is installed as a dependency and then import it as fetch into each tool file.

📥 Installation & Setup

1. Clone the repository

git clone https://github.com/anoopt/london-tfl-journey-status-mcp-server.git
cd london-tfl-journey-status-mcp-server

2. Install dependencies

npm install

🔐 Set up your TfL API key

3. Configure your TfL API key

Create a .env file in the project root with your TfL API key:

TFL_API_KEY=your_actual_tfl_api_key_here

You can get a free API key from the TfL API Portal.

🧪 Test the MCP Server with Postman

We strongly recommend testing your MCP server with Postman before connecting it to an AI assistant. The Postman Desktop Application provides the easiest way to run and test MCP servers.

Step 1: Download Postman Desktop

Download the latest Postman Desktop Application from postman.com/downloads.

Step 2: Create an MCP Request

  1. Open Postman Desktop
  2. Create a new MCP Request (see the documentation for detailed steps)
  3. Set the type to STDIO
  4. Set the command to the full path to your node executable followed by the full path to mcpServer.js

To get the required paths, run these commands in your terminal:

# Get the full path to node
which node

# Get the full path to mcpServer.js  
realpath mcpServer.js

# Check your node version (should be 18+)
node --version

Example command format:

/usr/local/bin/node /full/path/to/TfL-Status-MCP-Server/mcpServer.js

Step 3: Test Your Tools

  1. Click Connect in your Postman MCP Request
  2. You should see the three TfL tools listed
  3. Test each tool:
    • Try get_line_status with lineId: "central"
    • Try plan_journey with fromLocation: "King's Cross" and toLocation: "Westminster"
    • Try get_line_status_detail with lineId: "piccadilly"

If all tools work correctly in Postman, you're ready to connect to an AI assistant!

🤖 Connect to AI Assistants

Once you've tested with Postman, you can connect your MCP server to AI assistants:

For Local Development Setup (Option 2)

If you're using the local development setup, you'll need to specify full paths:

Claude Desktop

Step 1: Use the same node and mcpServer.js paths from the Postman testing step.

Step 2: Open Claude Desktop → SettingsDevelopersEdit Config and add:

{
  "mcpServers": {
    "london-transport": {
      "command": "node",
      "args": ["/full/path/to/mcpServer.js"]
    }
  }
}

Step 3: Restart Claude Desktop and verify the MCP server shows with a green circle.

VS Code GitHub Copilot

Step 1: Install the GitHub Copilot extension in VS Code if you haven't already.

Step 2: Open VS Code → Settings (Ctrl+,) → Search for "MCP" → GitHub Copilot › MCP: Servers

Step 3: Add your TfL MCP server configuration:

{
  "london-transport": {
    "command": "node",
    "args": ["/full/path/to/mcpServer.js"]
  }
}

Step 4: Restart VS Code and the MCP server will be available to GitHub Copilot.

Now you can ask your AI assistant things like:

  • "Check the status of the Central line"
  • "Plan a journey from London Bridge to Camden Town"

Additional Options

🛠️ List Available Tools

View all available tools and their parameters:

npm run list-tools

🚀 Quick Postman Integration

Open Postman with the correct MCP configuration automatically:

npm run postman

🐳 Docker Deployment (Production)

For production deployments, you can use Docker:

1. Build Docker image

docker build -t <your_server_name> .

2. AI Assistant Integration

Add Docker server configuration to your AI assistant:

For Claude Desktop (Settings → Developers → Edit Config):

{
  "mcpServers": {
    "tfl-status": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--env-file=.env", "tfl-mcp-server"]
    }
  }
}

For VS Code GitHub Copilot (Settings → GitHub Copilot › MCP: Servers):

{
  "tfl-status": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "--env-file=.env", "tfl-mcp-server"]
  }
}

Add your environment variables (API keys, etc.) inside the .env file.

The project comes bundled with the following minimal Docker setup:

FROM node:22.12-alpine AS builder

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install

COPY . .

ENTRYPOINT ["node", "mcpServer.js"]

🌐 Streamable HTTP

To run the server with Streamable HTTP support, use the --streamable-http flag. This launches the server with the /mcp endpoint enabled:

node mcpServer.js --streamable-http

🌐 Server-Sent Events (SSE)

To run the server with Server-Sent Events (SSE) support, use the --sse flag. This launches the server with the /sse and /messages endpoints enabled:

node mcpServer.js --sse

🖥️ Stdio (Standard Input/Output)

To run the server using standard input/output (stdio), simply run the script without any flags. This mode is ideal for CLI tools or programmatic integration via stdin and stdout.

node mcpServer.js

🛠️ Extending the Server

To add more TfL API endpoints or other transport APIs:

  1. Create new tool files in the tools/tfl/ directory
  2. Follow the pattern in existing tools like tools/tfl/status.js
  3. Add your new tool file to tools/paths.js
  4. Test with Postman before deploying

📚 API Reference

This server uses the Transport for London Unified API. All tools automatically include your API key from the .env file.

➕ Adding New Tools

Extend your MCP server with more tools easily:

  1. Visit Postman MCP Generator.
  2. Pick new API request(s), generate a new MCP server, and download it.
  3. Copy new generated tool(s) into your existing project's tools/ folder.
  4. Update your tools/paths.js file to include new tool references.

💬 Questions & Support

Visit the Postman MCP Generator page for updates and new capabilities.

Join the #mcp-lab channel in the Postman Discord to sh


FAQ

What is the Transport for London MCP server?
Transport for London is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
How do MCP servers relate to agent skills?
Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
How are reviews shown for Transport for London?
This profile displays 71 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.6 out of 5—verify behavior in your own environment before production use.

Use Cases

Extended AI Capabilities

Add new capabilities to Claude beyond text generation

Example

Access external data sources, execute code, interact with tools and services

Transform Claude from chatbot to action-taking agent

Context Enhancement

Provide Claude with access to relevant context and data

Example

Load project documentation, access knowledge bases, query databases

Get more accurate, context-aware responses

Workflow Automation

Automate multi-step workflows combining AI and external tools

Example

Research → Summarize → Create document → Send notification

Complete complex tasks end-to-end without manual steps

Implementation Guide

Prerequisites

  • Claude Desktop 0.7.0+ or Cursor IDE with MCP support
  • Basic understanding of MCP architecture and capabilities
  • Access credentials for integrated services (if required)
  • Willingness to experiment and iterate on configuration

Time Estimate

15-60 minutes depending on server complexity

Installation Steps

  1. 1.Install MCP server: npm install -g [package-name] or via GitHub
  2. 2.Add server configuration to ~/.claude/mcp.json
  3. 3.Provide required credentials and configuration
  4. 4.Restart Claude Desktop to load new server
  5. 5.Test basic functionality with simple prompts
  6. 6.Explore capabilities and experiment with use cases
  7. 7.Document successful patterns for reuse

Troubleshooting

  • MCP server not loading: Check config syntax, verify installation
  • Connection errors: Check network, firewall, credentials
  • Feature not working: Read server docs, check required parameters
  • Performance issues: Monitor resource usage, check for network latency
  • Conflicts with other servers: Check port assignments, namespace collisions

Best Practices

✓ Do

  • +Read server documentation thoroughly before setup
  • +Start with simple use cases to validate functionality
  • +Test in non-production environment first
  • +Monitor resource usage and performance
  • +Keep servers updated for bug fixes and new features
  • +Document configuration for team members
  • +Use environment variables for sensitive configuration

✗ Don't

  • Don't grant overly permissive access to MCP servers
  • Don't skip reading security considerations in docs
  • Don't expose sensitive data without proper controls
  • Don't run untrusted MCP servers without code review
  • Don't ignore error messages—investigate root cause

💡 Pro Tips

  • Combine multiple MCP servers for powerful workflows
  • Create custom MCP servers for your specific needs
  • Share successful configurations with team
  • Use MCP inspector for debugging
  • Join MCP community for tips and troubleshooting

Technical Details

Architecture

Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.

Protocols

  • Model Context Protocol (MCP)
  • JSON-RPC 2.0
  • stdio or HTTP transport

Compatibility

  • Claude Desktop
  • Cursor IDE
  • Custom MCP clients

When to Use This

✓ Use When

Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.

✗ Avoid When

Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.

Integration

  • Tool composition: Chain multiple MCP tools in workflows
  • Context augmentation: Provide AI with relevant external data
  • Action delegation: Let AI execute tasks on external systems
  • Bidirectional sync: Keep AI context and external systems in sync

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.

List & Promote Your MCP Server

Share your MCP server with the developer community

GET_STARTED →
MCP server reviews

Ratings

4.671 reviews
  • Emma Shah· Dec 16, 2024

    We wired Transport for London into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Evelyn Rahman· Dec 4, 2024

    I recommend Transport for London for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Soo Khanna· Dec 4, 2024

    Transport for London reduced integration guesswork — categories and install configs on the listing matched the upstream repo.

  • Hana Nasser· Nov 23, 2024

    Useful MCP listing: Transport for London is the kind of server we cite when onboarding engineers to host + tool permissions.

  • Yusuf Park· Nov 7, 2024

    Transport for London is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Yusuf Sanchez· Oct 26, 2024

    Transport for London has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Hana Jackson· Oct 14, 2024

    Strong directory entry: Transport for London surfaces stars and publisher context so we could sanity-check maintenance before adopting.

  • Hana Martin· Oct 2, 2024

    Strong directory entry: Transport for London surfaces stars and publisher context so we could sanity-check maintenance before adopting.

  • Yusuf Farah· Sep 21, 2024

    We evaluated Transport for London against two servers with overlapping tools; this profile had the clearer scope statement.

  • Oshnikdeep· Sep 13, 2024

    Transport for London is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

showing 1-10 of 71

1 / 8