Skip to main content
Glama

AIm Workout Journal

A workout journal that Claude and ChatGPT write to. Tell your assistant what you trained and it saves the exercises, sets, reps and weights. Ask it for a program and it builds one from your goal, schedule and equipment, checked by AIm before it is kept. The journal opens in the browser on any phone, in English, Spanish, French, Portuguese or Russian. Live at aim-journal.com.

Add it to your assistant

An AIm window asks for your email and a code it sends you. If you do not have a journal yet, AIm creates one there. Press Allow, then try: Make me a workout program in AIm for 3 days a week.

PT: diário de treino em que o Claude e o ChatGPT registram por você. Adicione pelo diretório do Claude ou do ChatGPT. ES: diario de entrenamiento en el que Claude y ChatGPT anotan por usted. Añádalo desde el directorio de Claude o de ChatGPT.

How it works

There are two ways in, on the same host, and both resolve to the same user_id:

https://<app>/mcp                OAuth 2.1 — add as a connector, approve in the browser
https://<app>/{token}            mobile web app / installable PWA
https://<app>/{token}/mcp        the original connector address, still supported
https://<app>/{token}/api/*      read only JSON the UI consumes

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.

Related MCP server: super-hevy-mcp

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      Vercel entrypoint (must stay at repo root, see below). Imports backend/src.
requirements.txt  Vercel's Python build reads this (must also stay at repo root).
backend/          Python package, tests, scripts, DB migrations.
web/              Vite + React SPA (own package.json, own dev server) and the static guide pages.

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 as a static SPA plus one Python function.

One thing to know before you go reading: some code comments cite internal planning documents by path, such as docs/COACHING_PLAN.md, docs/TEST_CASES.md or docs/DEPLOYMENT.md. Those are product and research notes that are not published here, so the paths will not resolve. Nothing in the code depends on them; they are provenance for a decision, not a dependency. Everything you need to build, test and run what is in this repository is in this README.

Stack

  • Backend (backend/): Python 3.12, FastMCP (stateless HTTP), psycopg3, Supabase Postgres (transaction pooler). MCP and the read API live in backend/src/workout_storage/, served by api/index.py.

  • Frontend (web/): Vite, React, Tailwind v4, shadcn/ui, recharts, React Query, vite-plugin-pwa. Data layer in web/src/app/lib/ (token to api to adapter to hooks). The guide pages under web/guides/ are generated to static HTML at build time and ship no bundle.

  • Hosting: one Vercel project. vercel.json routes mcp, api and cron to the function and everything else to the SPA.

Frontend dev

cd web
npm install
echo 'VITE_API_ORIGIN=https://aim-journal.com' > .env.local  # dev against prod API
npm run dev              # http://localhost:5173/{token}
npm run test             # vitest: pure function + component tests
npx playwright install chromium   # one time, before the first test:e2e run
npm run test:e2e         # Playwright, against /demo (no backend needed)

Backend dev

cd backend
uv sync --extra dev           # install deps
cp ../.env.example ../.env     # fill DATABASE_URL etc. (kept at repo root, shared by all tooling)
uv run pytest                  # unit + integration + e2e
uv run ruff check . && uv run mypy .

Create a user (prints the token to open in the browser and to paste into an assistant):

cd backend
uv run python scripts/create_user.py --name "Alex"

Running your own

Everything needed is here, but this is the source of a hosted service rather than a turnkey self host kit: you supply a Supabase project (migrations in backend/supabase/migrations/), a Vercel project, and the environment variables listed in .env.example. Analytics, email and backup integrations are optional and stay dormant without their keys.

Attribution

Exercise illustrations are third party works under CC BY-SA, each credited in web/ATTRIBUTIONS.md. They keep their own license regardless of the license on this repository.

License

MIT, see LICENSE. The exercise illustrations are the one exception, see Attribution above.

Available Tools

20 tools
delete_sessionDelete a workout sessionA
DestructiveIdempotent
Inspect

Delete a session and all its entries/sets. Returns {deleted: bool}.

Inputs: session_id (required). Returns: object

get_body_metricsGet body measurementsA
Read-only
Inspect

List body measurements, newest first.

Inputs: limit. Returns: result

get_coaching_contextGet coaching contextA
Read-only
Inspect

Coaching instructions + this user's fresh training context for the task. Call at the start of any coaching conversation and treat the returned prompt as your instructions. If intake is incomplete it returns the intake flow instead (intake_required=true). constraints is for TODAY-ONLY circumstances ("only 30 minutes", "gym closed, training at home") — they shape this generation without touching the profile; durable facts go through update_coach_profile instead.

Inputs: task (required), constraints. Returns: object

get_goalsGet goalsA
Read-only
Inspect

The user's goals (status: active|achieved|abandoned|revised|all).

Inputs: status. Returns: result

get_programGet the training programA
Read-only
Inspect

Get the active training program with its day templates (planned blocks/supersets and per-exercise targets). Returns null if no active program — to build one, call get_coaching_context(task='new_program') and follow it; never invent a program from generic knowledge. Edit via import_document.

Inputs: no named parameters. Returns: result

get_sessionGet a workout sessionA
Read-only
Inspect

Get one session with its full nested entries, sets, cardio and wearable metrics.

Inputs: session_id (required). Returns: result

get_sessionsList workout sessionsA
Read-only
Inspect

List sessions (newest first) with summary fields and total volume. Optional date range.

Inputs: limit, date_to, date_from. Returns: result

get_statsGet training statisticsA
Read-only
Inspect

Statistics for ONE exercise, or for training as a whole.

exercise_id is REQUIRED for kind='progression' and kind='prs' (they are per-exercise) and is ignored for kind='volume' (whole-training-volume over time). Calling progression/prs without it is an error, not a whole-library default — if the user did not name an exercise, pick its id from list_exercises first, or use kind='volume'.

'progression' → per-date top set, est-1RM (Epley), volume + PRs; 'prs' → personal records; 'volume' → total training volume over time with trend %. For coaching decisions (what to train, what weight) start from get_coaching_context instead — it bundles the fresh numbers with the user's context.

Inputs: kind (required), date_from, exercise_id. Returns: object

import_documentImport training historyAInspect

Bulk-import a full workout document (exercises, sessions, body metrics, programs). Programs must be designed via get_coaching_context(task='new_program') and explicitly approved by the user before importing. Any active program in the document is validated server-side (the same checklist as review_program_draft) before anything is saved; a response with ok=false and a violations list means nothing was written — fix each one and call import_document again.

Inputs: document (required). Returns: object

list_exercisesList the user's exercisesA
Read-only
Inspect

List THIS USER's own exercise catalog — what they have actually trained, with their logged metadata (instructions / video_url / image_url / pool_slug). Optional filters: muscle, equipment, movement_pattern, query (substring of the name or id). Use this to reuse an id the user already has; use search_exercise_pool to choose a NEW exercise.

Inputs: query, muscle, equipment, movement_pattern. Returns: result

log_body_metricRecord a body measurementAInspect

Record the user's body weight, body-fat % or circumferences for one day. Use it whenever the user states a current measurement; training goes to log_session, and reading measurements back is get_body_metrics. The app's weight tile and charts and the coaching context read these entries, not the profile's bodyweight field. One entry per date, and recording the same date again ADDS to it: send only what the user just told you. Fields you leave out keep their stored value, new measurements or custom_fields keys join the existing ones, and a repeated key or field is overwritten, which is how a wrong number is corrected. Send a field as null to clear it. Returns the whole stored entry for that day. There is no delete.

Inputs: metric (required). Returns: object

log_coach_eventRecord a coaching eventAInspect

Append a dated milestone to the user's coaching history: a check-in held, a goal reviewed or achieved, a deload advised, a red flag raised, intake started or finished, the profile changed. Call it at the end of the step the coaching prompt names (for example type='checkin' after a check-in), not for ordinary chat, logged workouts (log_session) or goal edits themselves (upsert_goal). Each call adds a new entry, so do not repeat one. The history is kept with the user's data export; no tool reads it back, so it does not replace saving facts through update_coach_profile or upsert_goal. Returns the stored event.

Inputs: type (required), payload. Returns: object

log_sessionLog workout sessionAInspect

Log a completed workout session (exercises → sets, cardio, wearable metrics) at once. Returns the stored session including any auto-created exercise catalog entries. The response may carry a coach_hint: a server note to gently offer coaching (intake or a program) after confirming the log — offer once, never push. If the conversation is about PLANNING training (not just logging), call get_coaching_context first. Ask how long the session took (or estimate from set count) and set duration_sec — omitting it renders as an empty duration in the app's history and session views.

Inputs: session (required). Returns: object

review_program_draftReview a program draftA
Read-only
Inspect

Server-side checklist for a DRAFT training program. Call it with the same WorkoutDocument you intend to import BEFORE presenting the draft to the user: it verifies every exercise has a starting weight (or calibration note), matches the user's equipment, respects session length / weekly days, and flags possible injury conflicts. Returns {ok, violations, warnings}. Fix violations and re-check; saves nothing.

Inputs: document (required). Returns: object

search_exercise_poolSearch the exercise catalogA
Read-only
Inspect

Search the curated global exercise pool — THE place to pick exercises from when building a program or a workout. Filter by muscle (e.g. 'lats', 'side_delts'), equipment (list of what the user actually has; only exercises fully covered by it are returned), movement_pattern, category, or query (a name in any supported language). Every entry carries a canonical slug — reuse it verbatim as the exercise_id — plus localized name and technique cues, primary/secondary/tertiary muscles, and rep/rest defaults. in_user_catalog marks the ones this user has trained before. Invent your own exercise only when nothing here fits.

Inputs: limit, query, locale, muscle, +3 more. Returns: object

update_coach_profileUpdate the coaching profileA
Idempotent
Inspect

Persist facts the user confirmed (goal, experience, schedule, equipment, injuries, preferences). Call as soon as a fact is confirmed — one fact per call is fine, don't batch or wait for the end of the conversation; works mid-workout too. Injuries: add via add_injuries, close via resolve_injury_areas. An explicitly null field is CLEARED; omitted fields are untouched. Returns the updated profile, changed fields, and ui_impact — the app surfaces this write feeds; confirm to the user that their answer was saved and now shapes their plan.

Inputs: patch (required). Returns: object

update_sessionUpdate workout sessionA
Idempotent
Inspect

Fix session-level fields. Allowed keys: date, day_label, duration_sec, location, bodyweight_kg, session_rpe, energy_level, status, notes, tags, start_time, end_time.

Inputs: patch (required), session_id (required). Returns: result

update_setCorrect a logged setA
Idempotent
Inspect

Fix a key metric of a single set, located by session + exercise + set_number. Allowed patch keys: weight_kg, reps, rir, rpe, tempo, rest_sec, duration_sec, distance_m, is_per_side, completed, notes, type. occurrence (1-based) picks which instance when the exercise appears more than once in the session. Returns the updated set, or null if none.

Inputs: patch (required), session_id (required), set_number (required), exercise_id (required), +1 more. Returns: result

upsert_exerciseAdd or update an exerciseA
Idempotent
Inspect

Create or update an exercise in the user's catalog (keyed by its id/name). Prefer a pool exercise: call search_exercise_pool first and pass its slug as the id plus pool_slug, so the movement keeps one identity and one history. Only hand-write an exercise when the pool genuinely has nothing for it — then always set instructions (2-3 short technique cues, in the user's language), primary_muscles, category and equipment: the muscle map and the app UI are blank without them. Fields you omit are left as they are, so a partial update is safe.

Inputs: exercise (required). Returns: object

upsert_goalAdd or update a goalAInspect

Create or update a training goal (pass id to update). target.goal_type selects the shape: milestone (point target — exercise_id+value, or bodyweight+baseline_value), weekly_volume (muscle+band: mev|mev_mav|mav — "train X at least at MEV every week"), trend (exercise_id+metric, no value — "just keep it climbing", no fixed finish line), maintenance (baseline_value+tolerance_pct, exercise_id and/or muscle optional, unset means total session volume — "don't lose ground"), or omit goal_type for a plain process goal (metric=sessions_per_week).

Any exercise_id MUST be an id from the user's catalog (check list_exercises; create via upsert_exercise first if genuinely new) — unknown ids are rejected, and a synonymous duplicate would split the exercise's history. Set review_date on every ratified goal (~4 weeks out, or the deadline if sooner) so check-ins have an anchor; calibrate milestone targets ~5-10% beyond the user's current number for an 8-12 week horizon.

Set featured=true on the ONE goal that should be the user's single featured goal in the app — this automatically un-features any other active goal. Never set featured on a frequency goal (the server rejects it); those live in the adherence widget only, never the featured-goal card.

When a milestone looks achieved, don't silently transition it — tell the user and ask whether to keep maintaining that level or set a new target, then call upsert_goal twice: mark the old goal status=achieved (also set featured=false, though the server defends this too) and create the new goal with supersedes_goal_id=<old goal's id> and featured=true. This is a decision the user makes with you in conversation, never something the app decides on its own.

Coach-proposed goals carry ratified=false until the user explicitly agrees. Never delete goals — supersede with status=revised/abandoned/achieved so history survives.

Inputs: goal (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool targets a distinct resource/action: logging vs reading vs updating sessions, body metrics, exercises, programs, goals, and coaching context. Close neighbors like search_exercise_pool vs list_exercises and get_stats vs get_coaching_context are explicitly differentiated in their descriptions.

    Naming Consistency5/5

    Tool names follow a consistent verb-first snake_case convention: log_*, get_*, update_*, upsert_*. Exceptions like import_document, review_program_draft, and search_exercise_pool still follow the verb_noun pattern and do not break the overall consistency.

    Tool Count4/5

    20 tools is above the typical lean range, but the coaching/training domain is broad—covering sessions, body metrics, exercises, programs, goals, coaching context, and stats—and each tool has a distinct job. It is slightly heavy but not bloated.

    Completeness4/5

    Core workflows are covered: log/read/update/delete sessions, log/read body metrics, create/search/list exercises, get/create programs, manage goals and coach profile, plus stats and import/review. Minor gaps exist (no delete for body metrics, no read-back for coaching events, no dedicated single-exercise fetch), but agents can work around them.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Personal workout coach MCP server that logs exercises in natural language, tracks progress with SQLite, and provides coaching signals like estimated 1RM and volume trends.
      6
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the Hevy workout tracker that enables users to query training history, log workouts, and manage routines via natural language.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Strength-training app Claude can write to: reads real workout history (planned vs actual) and writes planned workouts back into the Tally iOS app. First-party hosted remote MCP server secured with OAuth 2.1 (PKCE + dynamic client registration).
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Self-hosted fitness tracking MCP server that gives AI assistants access to your nutrition, training, weight, sleep, and accomplishment data via 77 tools and 5 resources. Enables natural-language logging and querying of personal health metrics through Claude or ChatGPT.
      1
      BSD 2-Clause "Simplified"