Skip to main content

Trackline MCP Client — Device Flow Auth + stdio<->HTTP Bridge for the Trackline railway data platform

Project description

trackline-mcp

PyPI Test & Lint

A zero-dependency Python MCP client that bridges Claude Code (and other MCP hosts) to the Trackline railway data platform over Streamable HTTP. Distributed as a uvx-runnable package — no manual installation or virtualenv required.


Installation

Via uvx (recommended)

No installation needed. Run directly:

uvx trackline-mcp --auth

Via pip

pip install trackline-mcp
trackline-mcp --auth

Authentication

Trackline MCP uses OAuth 2.0 Device Authorization Grant (no browser redirect required). You authenticate once and the token is cached at ~/.trackline/token.json with automatic refresh via an offline token.

Step 1 — Authenticate in a terminal:

uvx trackline-mcp --auth

This opens a URL. Visit it, log in, and the token is cached automatically.

Step 2 — Connect from Claude Code (see config below — no manual step needed).


Claude Code / MCP Configuration

Add to your .mcp.json (project or global):

{
  "mcpServers": {
    "trackline": {
      "command": "uvx",
      "args": ["trackline-mcp"]
    }
  }
}

How It Works

  1. On first run (--auth), the client performs a Device Authorization Grant with Keycloak, opening a short URL for you to approve.
  2. The token (including an offline refresh token) is cached at ~/.trackline/token.json.
  3. On subsequent runs, the client reads the cached token and refreshes it automatically if needed.
  4. JSON-RPC messages from Claude Code arrive on stdin and each is POSTed independently to the Trackline MCP server (/mcp); the JSON response is forwarded to stdout. Concurrent tool calls run in parallel — the server is stateless streamable-HTTP, so each request is fully independent.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trackline_mcp-1.0.0.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trackline_mcp-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file trackline_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: trackline_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trackline_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7f0de7b0fa8cd401c3c8c9c204e9ba83e2e4a67ad2ec3d6122199e5325d61fe9
MD5 44bfce2acfae7c668492903aa6e639b2
BLAKE2b-256 01edc5179e378d629c6bdd364772aa8d75e90bc5bee8f27be2dd5a89bf72c1cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for trackline_mcp-1.0.0.tar.gz:

Publisher: release.yml on Trackline-Live/trackline-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trackline_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: trackline_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trackline_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e7f171f999cf99b36c7212d8ffe47a575ce0c685cea8dbe7c08c8106c9878e0
MD5 b21311a2cd1d8a36d2f3ccaf5967babe
BLAKE2b-256 e90f1938934472e277fc2fe68102fc7b2e403fffaff8021378a5a0f01b516cb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for trackline_mcp-1.0.0-py3-none-any.whl:

Publisher: release.yml on Trackline-Live/trackline-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page