MCP Hub
Back to servers

mcp-server-tfl

Real-time London transport data via the TfL Unified API.

Registry
Updated
Mar 25, 2026

TFL MCP Server

Build Contract Tests GitHub release License: MIT

An MCP (Model Context Protocol) server that exposes the TfL (Transport for London) Unified API as tools, allowing AI assistants like Claude to query live London transport data.

Built with Java 25, Gradle 9.4.1, Jetty 12, and the MCP Java SDK v1.1.0 (SSE transport).

Tools

ToolDescriptionTfL Endpoint
line_statusCurrent status of one or more linesGET /Line/{ids}/Status
arrivalsLive arrivals at a stopGET /StopPoint/{id}/Arrivals
stop_searchSearch for stops by name/queryGET /StopPoint/Search/{query}
disruptionsCurrent disruptions by transport modeGET /Line/Mode/{modes}/Disruption
journeyPlan a journey between two pointsGET /Journey/JourneyResults/{from}/to/{to}
bike_pointsList Santander Cycles docking stationsGET /BikePoint
list_modesGet a list of all valid TfL transport modesGET /Line/Meta/Modes
air_qualityGet the latest London air quality data feedGET /AirQuality
road_disruptionsGet a list of disrupted streets and A-roadsGET /Road/all/Street/Disruption

Configuration

Environment VariableDefaultDescription
TFL_APP_KEY(none)TfL API key — register at api-portal.tfl.gov.uk
TFL_APP_ID(none)TfL App ID — only needed for older API registrations that issued both an ID and key

Requests work without an API key but are rate-limited. An app key raises the limit significantly.

Running

The server uses stdio transport — it reads JSON-RPC from stdin and writes responses to stdout, which is the standard MCP transport for Claude Desktop.

TFL_APP_KEY=your_key_here ./gradlew run

For use with Claude Desktop, see docs/installation.md.

Testing

Unit tests use WireMock to stub the TfL API — no network access or API key required:

./gradlew test

Contract tests spin up the server as a real subprocess (the same way Claude Desktop does) and call the live TfL API:

TFL_APP_KEY=your_key_here ./gradlew contractTest

TfL API Reference

Reviews

No reviews yet

Sign in to write a review