AIm Workout Journal
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A workout tracker your AI assistant writes to. AIm is an **MCP server** plus a **mobile web app
(PWA)**: you describe a session in Claude or ChatGPT in your own words, the assistant logs it
through MCP, and the app shows the program, the history, records, estimated 1RM and per muscle
load. The server hands the assistant your goal, injuries and logged weights as data, so it plans
from your training instead of generic advice.
Live at aim-journal.com. Free, and it runs inside the AI subscription
you already pay for rather than being a second one. Guides:
connect a workout tracker over MCP,
AI personal trainer,
1RM calculator.
How it works
There are two ways in, on the same host, and both resolve to the same user_id:
**OAuth** is what a connector uses now. The server is an OAuth 2.1 resource server: an
unauthenticated call gets a 401 carrying RFC 9728 protected-resource metadata, the client
discovers the authorization server from it, registers itself dynamically, and the user approves on
a consent screen this app serves. Supabase Auth is the authorization server, so no authorization
codes or access tokens are stored here; the access token's sub is mapped to an account through
users.supabase_user_id. Nothing secret is pasted by hand.
**The URL token** predates it and still works, which is why every link already in someone's inbox
kept working when OAuth landed. A token resolver middleware maps the leading path segment to a user
and scopes every query by user_id; the OAuth path sets the same context variable from a verified
token instead. Two doors, one scoping rule.
What the MCP server exposes
20 tools over stateless streamable HTTP (FastMCP):
- **Logging**: log_session, update_session, update_set, delete_session, import_document
(paste an export from another tracker or a photo of a notebook page).
- **Reading**: get_sessions, get_session, get_stats (volume, progression, estimated 1RM via
Epley), get_program, get_goals, get_body_metrics.
- **Catalogue**: search_exercise_pool (a curated global pool with illustrations),
list_exercises, upsert_exercise.
- **Coaching**: get_coaching_context is the important one. It returns data only: this user's
goal, experience, equipment, injuries (with the movement patterns that load them), recent
working weights, goal-matched planning ranges and the intake state, for the task at hand (next
workout, new program, weekly review), so the assistant plans from data rather than from
nothing. How the assistant uses it lives in the server's MCP instructions. review_program_draft, update_coach_profile, upsert_goal, log_coach_event,
log_body_metric keep that context current.
Repo layout
api/index.py and requirements.txt cannot move: Vercel's zero config Python builder only
auto detects functions under a root level api/, and only installs a root level
requirements.txt alongside them. Everything else in backend/ (pyproject.toml, uv.lock, tests,
scripts, supabase/) is hidden from the Vercel build by .vercelignore, so Vercel treats the repo