Trackline MCP Client — Device Flow Auth + stdio<->HTTP Bridge for the Trackline railway data platform
Project description
trackline-mcp
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
- On first run (
--auth), the client performs a Device Authorization Grant with Keycloak, opening a short URL for you to approve. - The token (including an offline refresh token) is cached at
~/.trackline/token.json. - On subsequent runs, the client reads the cached token and refreshes it automatically if needed.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f0de7b0fa8cd401c3c8c9c204e9ba83e2e4a67ad2ec3d6122199e5325d61fe9
|
|
| MD5 |
44bfce2acfae7c668492903aa6e639b2
|
|
| BLAKE2b-256 |
01edc5179e378d629c6bdd364772aa8d75e90bc5bee8f27be2dd5a89bf72c1cc
|
Provenance
The following attestation bundles were made for trackline_mcp-1.0.0.tar.gz:
Publisher:
release.yml on Trackline-Live/trackline-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trackline_mcp-1.0.0.tar.gz -
Subject digest:
7f0de7b0fa8cd401c3c8c9c204e9ba83e2e4a67ad2ec3d6122199e5325d61fe9 - Sigstore transparency entry: 1348487805
- Sigstore integration time:
-
Permalink:
Trackline-Live/trackline-mcp@4d1a8237afadef8b583d566719ed076839302e92 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Trackline-Live
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4d1a8237afadef8b583d566719ed076839302e92 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e7f171f999cf99b36c7212d8ffe47a575ce0c685cea8dbe7c08c8106c9878e0
|
|
| MD5 |
b21311a2cd1d8a36d2f3ccaf5967babe
|
|
| BLAKE2b-256 |
e90f1938934472e277fc2fe68102fc7b2e403fffaff8021378a5a0f01b516cb3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trackline_mcp-1.0.0-py3-none-any.whl -
Subject digest:
9e7f171f999cf99b36c7212d8ffe47a575ce0c685cea8dbe7c08c8106c9878e0 - Sigstore transparency entry: 1348487874
- Sigstore integration time:
-
Permalink:
Trackline-Live/trackline-mcp@4d1a8237afadef8b583d566719ed076839302e92 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Trackline-Live
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4d1a8237afadef8b583d566719ed076839302e92 -
Trigger Event:
push
-
Statement type: