TfL MCP Server
Provides tools for querying live London transport data from the TfL Unified API, including service status, arrivals, journey planning, bike points, crowding, and fares.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TfL MCP ServerIs the Central line running normally?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TfL MCP Server
Disclaimer: This is a community-built project. It is not affiliated with, endorsed by, or connected to Transport for London (TfL). This project consumes the publicly available TfL Unified API.
An MCP server that exposes the TfL (Transport for London) Unified API as tools, allowing AI assistants like Claude to query live London transport data.
Version 2 is a single Node.js 22 implementation using the MCP 2026-07-28 protocol revision. It supports stdio for local hosts, npm, and MCPB, plus stateless Streamable HTTP at /mcp for remote deployments.
Protocol compatibility: Streamable HTTP is modern-only MCP
2026-07-28. The stdio entry point also accepts 2025-era initialization for desktop hosts such as Codex, while modern stdio clients continue to negotiate2026-07-28. Legacy HTTP/SSE is not supported.
Getting Started
Step 1 — Add to Claude Desktop
Open your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Option A: Node.js MCPB (recommended)
Download tfl-mcp-server.mcpb from GitHub Releases and install it in Claude Desktop.
Option B: npm
With Node.js 22 or later installed, point Claude Desktop at the published package:
{
"mcpServers": {
"tfl-mcp-server": {
"command": "npx",
"args": ["-y", "@oneill9/tfl-mcp-server@2.0.0"],
"env": { "TFL_APP_KEY": "your_key_here" }
}
}
}Option C: Docker
{
"mcpServers": {
"tfl-mcp-server": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "TFL_APP_KEY", "ghcr.io/oneill9/tfl-mcp-server:latest"]
}
}
}Step 2 — Add a TfL API key (recommended)
Without a key, TfL applies strict rate limits that will impact most real-world usage. Register a free key and pass it via the TFL_APP_KEY environment variable. The Docker example's -e TFL_APP_KEY forwards this value into the container:
"env": { "TFL_APP_KEY": "your_key_here" }Step 3 — Restart Claude Desktop and start asking questions
Example: "Is the Central line running normally?", "When is the next bus from Oxford Circus?"
For source, Docker, and Streamable HTTP options, see docs/installation.md.
Related MCP server: MBTA MCP Server
Tools
Tool | Description | TfL Endpoint |
| Current status and disruptions by mode |
|
| Live arrivals at a stop by name |
|
| Plan a journey between two points |
|
| List Santander Cycles docking stations |
|
| Live station crowding level by name |
|
| Fare information between two named stops |
|
Note: The server uses the
/StopPoint/Search/{query}endpoint internally to automatically resolve stop names to NaPTAN IDs for thearrivals,crowding, andfarestools.
MCP Apps UI
The service_status tool includes MCP Apps support as a progressive enhancement. UI-capable hosts (e.g. Claude Desktop) can render an interactive service status board alongside the text response. Non-UI hosts continue to receive the standard text output.
The UI is self-contained (inline HTML/CSS, no external assets)
Structured JSON data is returned alongside the text fallback
No additional setup is required — host support is detected automatically
See docs/tools.md for full details.
Authentication
The MCPB and default container mode use stdio transport. The optional Streamable HTTP mode does not implement OAuth or any other server-side authentication; deploy it only behind an appropriate trusted access layer.
The TfL API uses a simple API key (TFL_APP_KEY) that you supply as an environment variable. A key is strongly recommended — without one, TfL applies strict rate limits that will impact most real-world usage. Registration is free. No OAuth flow, login, or account beyond the TfL portal is required to use this MCP server.
Configuration
Environment Variable | Default | Description |
| (none) | TfL API key — register at api-portal.tfl.gov.uk |
| (none) | TfL App ID — only needed for older API registrations that issued both an ID and key |
|
| Maximum JSON request body size accepted by Streamable HTTP |
|
| Streamable HTTP request timeout in milliseconds |
|
| Streamable HTTP header timeout in milliseconds; must not exceed the request timeout |
An API key is strongly recommended — without one, TfL's strict rate limits will impact most real-world usage. Registration is free at api-portal.tfl.gov.uk.
Running from source
Node.js 22 or later is required. Install from the lockfile and build before starting the server.
cd node
npm ci
npm run build
node dist/index.jsThat starts stdio transport. For stateless Streamable HTTP:
cd node
HOST=127.0.0.1 PORT=8080 node dist/index.js --httpConnect an MCP 2026-07-28 client to http://127.0.0.1:8080/mcp. Set MCP_ALLOWED_HOSTS to a comma-separated hostname allowlist when serving under other hostnames.
For use with Claude Desktop, see docs/installation.md.
Testing
Unit tests use a mock HTTP server — no network access or API key required:
cd node && npm testThe Streamable HTTP acceptance tests are included in npm test. Run the official frozen MCP 2026-07-28 requirement set separately (optional extension probes outside that set are not scored):
cd node && npm run test:conformanceThe conformance fixture registers the real production TfL tools and resource through the shared modern-only HTTP adapter. It also adds test-only diagnostic tools, resources, prompts, and flows needed by the referee's hard-coded probes; those diagnostics are not exposed by the production entry point.
Contract tests call the live TfL API:
cd node && TFL_APP_KEY=your_key_here npm run contractTestBuild and smoke-test the packed npm CLI, MCPB, and container distributions with bash scripts/test-distributions.sh. The script skips container checks when Docker is unavailable.
Support
For questions, bug reports, or feature requests, please open an issue on GitHub Issues.
Privacy Policy
This MCP server acts as a local proxy between your AI assistant and the TfL Unified API. It does not collect, store, or transmit any personal data beyond what is required to forward your queries to TfL.
Data collection: No analytics or telemetry is collected. Limited operational diagnostics are written to standard error but are not persisted by the server; a host may retain them under its own logging policy.
Usage and storage: Queries are forwarded to TfL in real time and responses are returned immediately. No query history or results are persisted.
Third-party sharing: Requests are forwarded to the TfL Unified API (
api.tfl.gov.uk). See TfL's privacy policy for how TfL handles API usage data.Data retention: The server retains no data and holds no state between requests. Host-managed standard-error retention is outside the server's control.
Contact: For privacy concerns, open an issue at https://github.com/oneill9/tfl-mcp-server/issues.
The full privacy policy is available at PRIVACY.md.
Compliance
This server has been reviewed for compliance with the Anthropic Software Directory Terms and Anthropic Software Directory Policy. See COMPLIANCE.md for the full compliance statement and maintainer commitments.
TfL API Reference
Unified API: https://api.tfl.gov.uk/
API Portal / Key Registration: https://api-portal.tfl.gov.uk/
Swagger UI: https://api.tfl.gov.uk/swagger/ui/index.html
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityDmaintenanceProvides real-time access to Transport for London data, enabling users to check tube line statuses, get disruption details, and plan journeys between London locations. Uses the official TfL Unified API to deliver live transport information through AI assistants.330MIT
- AlicenseBqualityFmaintenanceEnables AI clients to access Boston's MBTA public transit data, including real-time predictions, schedules, route planning, and service alerts.321Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to access real-time Transport for London data, including tube/bus arrivals, line status, journey planning, and disruptions.1
- AlicenseBqualityDmaintenanceProvides real-time Transport for London journey data, including routes, alerts, and disruptions, allowing AI assistants to search journeys and get station information.1234ISC
Related MCP Connectors
UK refunds inside your AI assistant: train delays, flights, TfL, parking. Made in London.
Read and update your Everway trips and itineraries from any MCP-compatible AI assistant.
Real-time transit stops, routes, arrivals, vehicle positions, and schedules via OneBusAway APIs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/oneill9/tfl-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server