Skip to main content
Glama
README.md
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/readme-cover-dark.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/readme-cover-light.png">
  <img src="docs/readme-cover-light.png" alt="RouteMate: London journeys for your AI assistant. Lift outages, step-free access, diversions, closures, and crowding, on every route." width="100%">
</picture>

# RouteMate

[![CI](https://github.com/AlexanderTar/routemate-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/AlexanderTar/routemate-mcp/actions/workflows/ci.yml)
[![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
[![Release](https://img.shields.io/github/v/release/AlexanderTar/routemate-mcp)](https://github.com/AlexanderTar/routemate-mcp/releases/latest)
[![Go Reference](https://pkg.go.dev/badge/github.com/AlexanderTar/routemate-mcp.svg)](https://pkg.go.dev/github.com/AlexanderTar/routemate-mcp)
[![Go version](https://img.shields.io/github/go-mod/go-version/AlexanderTar/routemate-mcp)](go.mod)
[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-io.github.AlexanderTar%2Froutemate-informational)](https://registry.modelcontextprotocol.io/?q=io.github.AlexanderTar%2Froutemate)
[![Glama MCP server](https://glama.ai/mcp/servers/AlexanderTar/routemate-mcp/badges/score.svg)](https://glama.ai/mcp/servers/AlexanderTar/routemate-mcp)
[![Glama MCP connector](https://glama.ai/mcp/connectors/io.github.AlexanderTar/routemate/badges/score.svg)](https://glama.ai/mcp/connectors/io.github.AlexanderTar/routemate)

An [MCP](https://modelcontextprotocol.io) server that gives AI assistants London journey options with the known issues on every leg, for now or for a later date.

RouteMate uses TfL open data; not affiliated with or endorsed by Transport for London.

## What it does

Ask your assistant things like "I need to be at Canary Wharf by 09:25 next Thursday" or "get me to Heathrow with as little walking as possible".

- **Several routes, side by side:** rail, bus, walking, and mixed options, so your assistant can weigh speed against changes and walking.
- **Issues on each leg:** delays and closures, planned works, bus diversions, lift faults, road works, and crowding.
- **Step-free travel:** step-free routes when you ask for them, and station access with every lift out of service.
- **Plan ahead:** arrive by, or leave at, a time days ahead, to fit what is in your calendar.

Use the hosted connector, or run it yourself with your own TfL key.

## Hosted connector

Add a custom connector (also called a remote MCP server) in your assistant with this URL:

```
https://routemate.city/mcp
```

Sign in with Apple, Google, or an email link, choose a plan, and allow access. It costs £1.99 a month or £19.99 a year, VAT included. Clients that cannot sign in can send a personal API key from your account page. Running RouteMate yourself is free and never gated.

## Tools

All tools only read.

| Tool | What it does |
|---|---|
| `plan_journey` | Route options between two places, now, by a given time, or leaving at one, with the issues on each leg |
| `check_route` | Re-checks a planned route shortly before leaving |
| `find_places` | Finds stations, stops, postcodes, addresses, and bike hire docks |
| `get_departures` | Next live departures at a stop or station |
| `get_line_status` | Line status now or for later dates, and network notices |
| `get_station_access` | Step-free access, lift faults, and crowding at one station |

## Self-host

You need [Go](https://go.dev/dl/) 1.27.1 or later and your own API key from the [TfL API portal](https://api-portal.tfl.gov.uk/).

```sh
git clone https://github.com/AlexanderTar/routemate-mcp
cd routemate-mcp
go build -o routemate ./cmd/routemate
```

The server reads the key from the `TFL_APP_KEY` environment variable and sends it only as a request header.

### Claude Desktop

Add this to `claude_desktop_config.json` (Settings, Developer, Edit Config), with the full path to the binary you built, then restart Claude Desktop:

```json
{
  "mcpServers": {
    "routemate": {
      "command": "/path/to/routemate",
      "args": ["serve", "--stdio"],
      "env": { "TFL_APP_KEY": "your-key" }
    }
  }
}
```

### Claude Code

```sh
claude mcp add --env TFL_APP_KEY=your-key --transport stdio routemate -- /path/to/routemate serve --stdio
```

### Codex

```sh
codex mcp add routemate --env TFL_APP_KEY=your-key -- /path/to/routemate serve --stdio
```

### Other clients that start local servers

Run `/path/to/routemate serve --stdio` with `TFL_APP_KEY` in its environment.

### ChatGPT and other clients that need a URL

ChatGPT cannot start a program on your computer. Its [Secure MCP Tunnel](https://developers.openai.com/plugins/deploy/connect-chatgpt) connects it to a server on your machine without putting that server on the public internet: point the tunnel at `routemate serve --stdio`, or at the HTTP server below, then add it in ChatGPT as a custom MCP server.

To serve streamable HTTP instead:

```sh
TFL_APP_KEY=your-key ./routemate serve --http   # http://127.0.0.1:8080/mcp
```

Use `--addr` to listen elsewhere. Before you expose this to other machines, know that:

- `--http` has **no sign-in**. Anyone who can reach it can use your key and your quota.
- A request arriving over loopback is refused unless its `Host` header names localhost or a loopback address, so a forwarding service on the same machine has to send `Host: localhost`.
- Requests from other websites in a browser are refused.

## Privacy

The [privacy policy](https://routemate.city/privacy) covers the hosted service. In short:

- It keeps your sign-in email, your plan, and the apps and API keys you connect. It runs no analytics and no advertising.
- The places and times you ask about go to TfL to be answered. Planned routes stay in server memory for up to 2 hours so your assistant can re-check them, and are never written to disk or logs.
- Keys, tokens, places, and coordinates are removed from the request log.
- Stripe handles payments, so the server never sees your card.
- You can delete your account at any time.

### Self-hosted

A self-hosted server writes no record of your journeys or preferences; your assistant sends the preferences on each call. The places and times you ask about go to TfL to plan the journey. Planned routes stay in server memory for up to 2 hours so your assistant can re-check them: the lines, stations, stops, and times of each option. A start or end at a station or stop is kept as that stop, while a home address, postcode, or coordinates are not. They are never written to disk or logs. It writes one file, a key for signing route tokens, at `routemate/route.key` in your user config directory (or set `ROUTEMATE_TOKEN_KEY`, at least 32 bytes). If you run the server yourself, the project receives nothing from it.

## Development

```sh
go test ./...                       # recorded data, no network
go test -tags live -count=1 ./...   # real API, needs TFL_APP_KEY
```

`eval/` measures how well a language model uses the tools: it plays fixed tasks over recorded data and scores what the model chose. See [docs/eval](docs/eval/) for results.

To run the hosted server yourself, see [docs/deploy-railway.md](docs/deploy-railway.md) and [docs/sign-in.md](docs/sign-in.md).

## Contributing

Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). [CHANGELOG.md](CHANGELOG.md) lists what changed. Report a security problem as [SECURITY.md](SECURITY.md) says, not in an issue.

## Attribution

Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights [2019].

Answers with National Rail legs also use National Rail data from National Rail Enquiries.

RouteMate uses TfL open data; not affiliated with or endorsed by Transport for London.

## Licence

Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). The fonts and the Apple logo artwork the hosted pages use, and the recorded TfL data in the tests, are under their own terms, listed there.