Self-hosted REST and MCP server for T4L Trainer agent workflows.
Project description
T4L Server
Self-hosted REST and MCP server for exchanging T4L Trainer JSON artifacts between the iPhone app and a coaching agent.
The phone remains the source of truth for accepted training state. The server stores synced context and pending agent results in SQLite so local agents, home-server agents, and private VPS agents can work through the same protocol.
Install
pipx install t4l-server
t4l-server serve --data-dir ~/T4LServerData
The command prints the server URL, MCP URL, and API key. Enter the server URL and API key in the T4L Trainer Settings screen.
Agent setup
Agents should read the public instruction repo first:
https://github.com/BigSlikTobi/t4l-agent-instructions
Those instructions explain how to start or verify this server, connect through MCP, wait for fresh phone context, and write app-consumed results safely.
Compatibility
The old command remains available for one transition cycle:
t4l-bridge serve --dir ~/CodexFitnessExchange
New setups should use t4l-server serve --data-dir ~/T4LServerData.
Safety model
- REST, MCP, and compatibility file endpoints require the API key.
- JSON artifacts are stored in
t4l.sqlite. - Image blobs are stored under
blobs/. - Only known exchange files and
meal_images/are accessible through compatibility endpoints. - Path traversal and arbitrary file access are rejected.
Development
python -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
ruff format --check .
ruff check .
mypy
pytest
python -m build
twine check dist/*
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 t4l_server-0.1.2.tar.gz.
File metadata
- Download URL: t4l_server-0.1.2.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5940d0a7514ce49314c6c0097233969035911a5356d0c65e3ae159a312f0f6f
|
|
| MD5 |
b2dc484479ad0bafa8b1674cbbdc79a1
|
|
| BLAKE2b-256 |
f47fb5ed06e1835cdfa69adaed3630fc4997f46b55f688a7c97b8b688caaa658
|
Provenance
The following attestation bundles were made for t4l_server-0.1.2.tar.gz:
Publisher:
publish.yml on BigSlikTobi/t4l-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
t4l_server-0.1.2.tar.gz -
Subject digest:
d5940d0a7514ce49314c6c0097233969035911a5356d0c65e3ae159a312f0f6f - Sigstore transparency entry: 1615058512
- Sigstore integration time:
-
Permalink:
BigSlikTobi/t4l-server@1732031b816309db3020e300f968a8899c8acb41 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/BigSlikTobi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1732031b816309db3020e300f968a8899c8acb41 -
Trigger Event:
push
-
Statement type:
File details
Details for the file t4l_server-0.1.2-py3-none-any.whl.
File metadata
- Download URL: t4l_server-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.9 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 |
06f0493c239e23963004d9ecd9a1ebb7a822efed33e08b25043093cb084395ba
|
|
| MD5 |
27596c6a55427ef609a74525f2350a42
|
|
| BLAKE2b-256 |
cb45fe86c2fe42f2d2c8202851121b8993ca3768acd3a57bb1a882555c6f8adc
|
Provenance
The following attestation bundles were made for t4l_server-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on BigSlikTobi/t4l-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
t4l_server-0.1.2-py3-none-any.whl -
Subject digest:
06f0493c239e23963004d9ecd9a1ebb7a822efed33e08b25043093cb084395ba - Sigstore transparency entry: 1615058577
- Sigstore integration time:
-
Permalink:
BigSlikTobi/t4l-server@1732031b816309db3020e300f968a8899c8acb41 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/BigSlikTobi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1732031b816309db3020e300f968a8899c8acb41 -
Trigger Event:
push
-
Statement type: