Docs
Codex
Codex CLI and the Codex desktop app both speak MCP. Add the Physique server to ~/.codex/config.toml and the reads show up as tools. Inside a sandboxed session you can also just run the CLI.
1. Credential and profile
mkdir -p ~/.config/physique
curl -fsSL https://physique.syncgr.com/agent/profile.example.json -o ~/.config/physique/profile.json
curl -fsSL https://physique.syncgr.com/agent/physique_mcp.py -o ~/.config/physique/physique_mcp.py
curl -fsSL https://physique.syncgr.com/agent/physique.py -o ~/.config/physique/physique.py && chmod +x ~/.config/physique/physique.py
Create the credential in the app (account circle → Agent access) and set credential_command in the profile to whatever prints it, for example op read op://Personal/Physique/credential or pass show physique.
2. MCP server in config.toml
[mcp_servers.physique]
command = "python3"
args = ["/home/you/.config/physique/physique_mcp.py"]
env = { PHYSIQUE_PROFILE = "/home/you/.config/physique/profile.json" }
Restart Codex. Ask "what were my workouts this week?" and it will call physique_days with a bounded date range.
3. Or the CLI from inside a session
Codex sandboxes usually block network. Run with network access allowed for the session, then:
~/.config/physique/physique.py discover
~/.config/physique/physique.py days --from 2026-09-01 --to 2026-09-07
~/.config/physique/physique.py foods
Keep the credential out of the repo. The CLI reads it from
PHYSIQUE_TOKEN or the profile's credential_command and never prints it.Writes
Same as everywhere: a separate credential with fitness:write, put-day with --expected-revision and a stable --request-id. See the API page.