tfl-ts

v2.17.1
io.github.ghcpuman902/tfl-ts Checked 9 hours ago Published 3 days ago

Read-only Transport for London data: line status, arrivals, journeys, stop lookup.

Values you need

VariableWhat it is
TFL_APP_KEYrequired secret TfL API primary key. Live tools need it. Static tools (docs, resolve_line_id, get_supported_modes) do not.
TFL_MCP_MIN_INTERVAL_MSoptional Minimum milliseconds between outbound TfL requests. Default 250. Cache hits do not count.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add tfl-ts -e 'TFL_APP_KEY=<TFL_APP_KEY>' -- npx -y --package=tfl-ts@2.17.1 tfl mcp
Add to claude_desktop_config.json
{
  "mcpServers": {
    "tfl-ts": {
      "args": [
        "-y",
        "--package=tfl-ts@2.17.1",
        "tfl",
        "mcp"
      ],
      "command": "npx",
      "env": {
        "TFL_APP_KEY": "<TFL_APP_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "tfl-ts": {
      "args": [
        "-y",
        "--package=tfl-ts@2.17.1",
        "tfl",
        "mcp"
      ],
      "command": "npx",
      "env": {
        "TFL_APP_KEY": "<TFL_APP_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "TFL_APP_KEY",
      "id": "tfl-app-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "tfl-ts": {
      "args": [
        "-y",
        "--package=tfl-ts@2.17.1",
        "tfl",
        "mcp"
      ],
      "command": "npx",
      "env": {
        "TFL_APP_KEY": "${input:tfl-app-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.tfl-ts]
command = "npx"
args = ["-y", "--package=tfl-ts@2.17.1", "tfl", "mcp"]
env = { "TFL_APP_KEY" = "<TFL_APP_KEY>" }

For AI agents

  1. Ask the user for: TFL_APP_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: get_supported_modes, resolve_line_id, docs, resolve_stop_id, get_line_status, get_arrivals, plan_journey.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json