Skip to main content
Glama
liftoff-mcp
by mpvii
README.md
# liftoff-mcp

An MCP server for [Liftoff](https://getgymbros.com) (gymbros.com) that **reads and writes**
your training data — unlike the upstream `liftoff-export` CLI, which is export-only.

Weights are **kilograms** at the tool boundary. Liftoff stores pounds, so the server
converts on the way out and on the way back in (`weight_lb` is included for reference).

## What it can do

| Tool | Access | Notes |
| --- | --- | --- |
| `liftoff_status` | read | Auth check, API host, routine/workout counts |
| `liftoff_routines_list` | read | Names, ids, exercise and set counts, volume (kg) |
| `liftoff_routine_show` | read | Every set decoded to kg/reps/seconds |
| `liftoff_exercises_search` | read | Resolves names to Liftoff exercise ids |
| `liftoff_exercise_create` | **write** | Adds a custom exercise (dry-run unless `confirm=true`) |
| `liftoff_exercise_delete` | **write** | Removes a custom exercise by id (dry-run unless confirmed) |
| `liftoff_workouts_list` | read | Newest first, windowed, filtered by exercise |
| `liftoff_bodyweights_list` | read | Recorded bodyweights in kg |
| `liftoff_routine_create` | **write** | Creates a routine (dry-run unless `confirm=true`) |
| `liftoff_routine_update` | **write** | Full replacement (Liftoff has no partial edit) |
| `liftoff_routine_delete` | **write** | Deletes by name or id (dry-run unless `confirm=true`) |
| `liftoff_schedule_get` | read | Concrete scheduled workouts between two dates |
| `liftoff_schedule_week` | read | Recurring weekday template (Mon A / Tue B / ...) |
| `liftoff_schedule_add_workout` | **write** | Puts a saved routine on a date (dry-run unless confirmed) |
| `liftoff_schedule_add_one_off` | **write** | Adds an ad-hoc workout to a date without saving a routine |
| `liftoff_schedule_move_workout` | **write** | Moves a scheduled workout to another date |
| `liftoff_schedule_remove_workout` | **write** | Removes a scheduled workout by id |
| `liftoff_schedule_set_week` | **write** | Sets the weekday template (USER_PRESET / REST / GENERATED) |
| `liftoff_schedule_update_workout` | **write** | Edits exercises inside a scheduled session |
| `liftoff_plan_start` | **write** | Generates a Liftoff training plan (dry-run unless confirmed) |
| `liftoff_plan_edit` / `liftoff_plan_delete` | **write** | Edits or deletes a generated plan |

Every write tool returns the exact payload it would send and writes nothing until
called again with `confirm=true`. Destructive changes are always previewed first.

## Why writing is possible

The Liftoff app speaks tRPC at `/api/trpc/<procedure>`. The export CLI only uses the
two read procedures (`post.getMyPosts`, `fitnessService.fetchUserPresetsWithFolders`).
The same router exposes mutations that the app itself uses:

- `fitnessService.createPreset`
- `fitnessService.editPreset`
- `fitnessService.deletePreset`
- `fitnessService.createExercise` / `fitnessService.deleteExercise`
- `schedule.getSchedule` / `schedule.editSchedule` (recurring weekday template)
- `workoutSchedule.get` / `addWorkout` / `moveWorkout` / `removeWorkout` /
  `updateWorkout` (concrete scheduled sessions)
- `workoutSchedule.addOneOff` (an ad-hoc workout with no saved routine)
- `workoutSchedule.startPlan` / `editPlan` / `deletePlan` (generated plan)
- `post.create` / `post.remove` (logged workouts — not wired up yet)

`createExercise` needs `name`, `exerciseTypes`, `muscle`, `primaryMuscles[]`,
`secondaryMuscles[]`, `equipment[]`, `difficulty`, `instructions`, `imageURI`
and `avatarURI`. `equipment` is an enum of app codes (`MEDICINE_BALL`,
`CROSSOVER_CABLE`, `HANDLE_BANDS`, `OTHER`, ...), so `exercise_create` passes
the codes through unchanged. The returned user exercise carries the generated
id that routines need.

The required input shapes were derived from the API's own Zod validation errors
(see `scripts/discover.py`) and verified with a create → read → delete round trip.

## Auth

It reuses the `liftoff-export` login, so there is nothing extra to sign in to:

```sh
liftoff-export auth login     # once
```

Tokens live in `~/.config/liftoff-export/auth.json`. The server refreshes them when
they expire and writes the rotated tokens back, so the CLI stays logged in too.

Environment overrides:

- `LIFTOFF_REFRESH_TOKEN` — headless refresh token (never persisted)
- `LIFTOFF_API_BASE` — override the version-pinned host if Liftoff retires it

## Install

```sh
git clone https://github.com/mpvii/liftoff-mcp.git
cd liftoff-mcp
uv sync
```

Versions are tagged; see [Releases](https://github.com/mpvii/liftoff-mcp/releases).
To pin one, clone its tag:

```sh
git clone --branch v0.1.0 https://github.com/mpvii/liftoff-mcp.git
```

Register it with OpenCode (local stdio server). Replace `/path/to/liftoff-mcp`
with the directory you cloned into:

```json
{
  "mcp": {
    "servers": {
      "liftoff": {
        "type": "local",
        "command": ["/path/to/liftoff-mcp/.venv/bin/liftoff-mcp"],
        "environment": { "PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" }
      }
    }
  }
}
```

You can also run it straight from the repo with `uv run liftoff-mcp`.

Then the tools appear as `liftoff_status`, `liftoff_routines_list`,
`liftoff_routine_create`, and so on.

## Example

> "Create a push routine: bench press 3×8 at 80 kg, incline dumbbell press 3×10 at
> 30 kg, dips 3×10 bodyweight."

The agent calls `routine_create` without `confirm`, gets a preview, then repeats the
call with `confirm=true`. The routine appears in the Liftoff app immediately.

## Development

```sh
uv run pytest          # unit tests, no network
uv run ruff check .
uv run liftoff-mcp     # stdio
uv run liftoff-mcp --transport streamable-http --port 8766
```

`scripts/discover.py` is the safe probe used to find procedure names and input
schemas: a GET to a mutation returns 405 (`METHOD_NOT_SUPPORTED`) rather than
executing it, and an invalid POST returns the Zod field list without side effects.

## Caveats

- Liftoff is unofficial and version-pinned. If calls fail with "server is
  deprecated", set `LIFTOFF_API_BASE` to the host the current app uses.
- `routine_update` replaces the whole routine; there is no partial edit procedure.
- Exercise names resolve against your own history and routines. A brand-new
  exercise that you have never logged is not in the catalogue — create it first
  with `exercise_create` (or it will fail to resolve).
- Writing to Liftoff changes your real account. Preview, then confirm.

TDQS

A3.5/5.0

Scored across 22 tools

Disambiguation4/5

Each tool has a recognizable resource+action target, and the descriptions actively disambiguate the risky pairs (routine_create vs. schedule_add_workout vs. schedule_add_one_off, schedule_get vs. workouts_list vs. schedule_week). A couple of boundaries still require careful reading — notably routine_create + schedule_add_workout versus schedule_add_one_off, and exercises_search versus exercise_create for naming resolution — but nothing is truly duplicated.

Naming Consistency4/5

The convention is uniformly resource_verb (exercises_search, routine_create, schedule_move_workout, plan_delete), with schedule_* and plan_* families clearly grouped. Minor deviations exist: the bare 'status' tool breaks the pattern, and list tools use plural nouns (workouts_list, routines_list) while mutation tools use singular (exercise_create, routine_create).

Tool Count3/5

22 tools spanning six sub-domains (exercises, workouts, bodyweight, routines, schedule, plans) is defensible, but the schedule family alone has eight entries including the low-level schedule_update_workout, which pushes the surface toward heavy. The set is cohesive rather than bloated, though the upward creep is noticeable.

Completeness3/5

Routines and schedule have near-full lifecycle coverage, but the workout surface is read-only (workouts_list, no get/detail or logging of a completed session), custom exercises can be created and deleted but never updated, and plans can be started/edited/deleted but not listed or shown. These are meaningful gaps for a fitness-logging domain that will force agents to route around them.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues