Skip to main content
Glama

🚇 TfL MCP Server

A Model Context Protocol (MCP) server that gives Claude AI real-time access to Transport for London (TfL) data. Ask Claude about tube status, plan journeys, check arrivals, and more — all through natural language.

🎥 Demo

Ask Claude things like:

  • "Is the Elizabeth line running?"

  • "How do I get from Seven Kings to Canary Wharf?"

  • "Any disruptions on TfL today?"

  • "When is the next bus at stop 55354?"

  • "How much is a journey from Seven Kings to Liverpool Street?"

Related MCP server: TFL MCP Server for Poke

🛠 Tools Available

Tool

Description

get_line_status

Status of a specific TfL line

get_all_lines_status

Status of ALL TfL lines at once

get_station_info

Station details (zone, modes, ID)

get_arrivals

Next train arrivals at a station

plan_journey

Full journey plan between two locations

get_journey_time

Fastest journey time between two locations

get_bus_arrivals

Next buses at a bus stop

get_bus_route

Full route of a bus

get_fare

Journey fare estimate

search_station

Search for a station by name

get_nearby_stations

Stations near a postcode

get_disruptions

Current network disruptions

get_planned_works

Upcoming engineering works

🚀 Getting Started

Prerequisites

  • Node.js 18+

  • Claude Desktop

Installation

  1. Clone the repository:

git clone https://github.com/Rumaisa10/tfl-mcp.git
cd tfl-mcp
  1. Install dependencies:

npm install
  1. Build:

npm run build
  1. Add to Claude Desktop config:

Find your config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Add the following:

{
  "mcpServers": {
    "tfl-mcp": {
      "command": "node",
      "args": ["/full/path/to/tfl-mcp/build/index.js"]
    }
  }
}
  1. Restart Claude Desktop

  2. Ask Claude anything about TfL! 🚇

📁 Project Structure

tfl-mcp/ ├── src/ │ ├── index.ts ← MCP server entry point │ ├── tools.ts ← Tool definitions │ ├── handlers.ts ← Tool logic │ └── tfl/ │ ├── client.ts ← TfL API base fetch helper │ ├── lines.ts ← Line status functions │ ├── stations.ts ← Station functions │ ├── journey.ts ← Journey planning │ ├── bus.ts ← Bus functions │ ├── fares.ts ← Fare functions │ └── disruptions.ts← Disruption functions ├── build/ ← Compiled JavaScript ├── package.json └── tsconfig.json

🔑 API Key

This server uses the TfL Unified API which works without an API key for up to 50 requests/minute. For higher rate limits, register at api.tfl.gov.uk and add your credentials as query parameters in src/tfl/client.ts.

🌐 Supported Lines

elizabeth → Elizabeth line central → Central line jubilee → Jubilee line northern → Northern line victoria → Victoria line dlr → DLR overground → London Overground bakerloo → Bakerloo line piccadilly → Piccadilly line district → District line circle → Circle line hammersmith → Hammersmith & City line metropolitan → Metropolitan line

🤝 Contributing

Pull requests welcome! Feel free to add more TfL tools or improve existing ones.

📄 License

MIT

👩‍💻 Built by

Romysa Sultana — Frontend Developer based in London

Available Tools

13 tools
get_all_lines_statusC

Get the current status of ALL TfL lines at once

Inputs: no named parameters.

get_arrivalsA

Get next train arrivals at a station. NOTE: First call get_station_info to get the stationId, then pass that ID here. Do not pass the station name directly.

Inputs: stationId (required), line.

get_bus_arrivalsC

Get next bus arrivals at a bus stop

Inputs: stopCode (required).

get_bus_routeC

Get the full route of a bus

Inputs: busNumber (required).

get_disruptionsB

Get all current disruptions on the TfL network

Inputs: no named parameters.

get_fareC

Get the fare for a journey between two locations

Inputs: to (required), from (required).

get_journey_timeC

Get the fastest journey time between two locations

Inputs: to (required), from (required).

get_line_statusB

Get the current status of a specific TfL line (tube, DLR, Elizabeth line etc)

Inputs: line (required).

get_nearby_stationsC

Find TfL stations near a postcode

Inputs: postcode (required).

get_planned_worksB

Get upcoming planned engineering works on TfL lines

Inputs: no named parameters.

get_station_infoA

Get information about a station including zone and transport modes

Inputs: station (required).

plan_journeyB

Plan a journey between two locations using TfL

Inputs: to (required), from (required), time.

search_stationC

Search for a station by name

Inputs: query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (line status vs all-line status, bus arrivals vs train arrivals, nearby vs search vs station info). However, get_disruptions, get_planned_works, and get_line_status have some conceptual overlap around service conditions, and search_station vs get_station_info could be confused when resolving station identifiers.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun or verb_noun_qualifier pattern using snake_case, such as get_line_status, get_bus_arrivals, plan_journey, and search_station. There are no mixed conventions or vague standalone verbs.

    Tool Count5/5

    13 tools is well-scoped for a TfL transport server, covering lines, stations, arrivals, journeys, fares, buses, and disruptions without excessive sprawl. Each tool appears to earn its place.

    Completeness4/5

    The surface covers the core read-only TfL workflows: status, disruptions, planned works, station search/info, arrivals, journey planning, fares, and buses. Minor gaps exist, such as detailed line route/stop listings and potential ambiguity around how to obtain station IDs for arrivals, but agents can likely work around them.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers