Prerequisites
Setup
Cursor authenticates with a Personal Access Token. You paste it once into Cursor’s MCP config; the token is long-lived, so there’s no OAuth dance to redo every time you reopen the editor.
Step 1 — Create a Personal Access Token
- Sign in at gymlogic.me
- Go to Account → Security & access → Manage API tokens (or straight to gymlogic.me/account/api-tokens)
- Click Create token
- Name it something you’ll recognize later (
Cursor laptop) and pick a lifetime — 30 / 90 / 365 days, or never - Copy it now. It starts with
glp_, it’s shown once, and it’s a password.
The token gives full read access plus program writes on your account. If you lose it, revoke it on the same page and mint a new one — the next request from the old token returns 401.
Step 2 — Add the MCP server
Edit ~/.cursor/mcp.json (create the file if it isn’t there):
{
"mcpServers": {
"gymlogic": {
"url": "https://mcp.gymlogic.me/functions/v1/mcp",
"headers": {
"Authorization": "Bearer <YOUR_PAT>"
}
}
}
}
Swap <YOUR_PAT> for the full glp_… string from step 1.
Step 3 — Activate in Cursor
- Open Cursor Settings → MCP
gymlogicshould be listed — hit the refresh icon if it isn’t- Start a new Agent chat. Chats that were already open won’t pick up the new tools.
Available tools
| Tool | What it does |
|---|---|
search_exercises | Search the exercise catalog by name (FR/EN), muscle group, equipment, or difficulty |
resolve_exercises | Resolve a batch of exercise names (up to 30) to catalog UUIDs in one call — bundles weight_convention, measurement_type, and default_duration_seconds, everything create_program / update_program need |
get_exercise_details | Full exercise info: instructions, muscles, equipment, media |
get_workout_history | Your past sessions with sets, weights, and PRs |
get_training_stats | Volume by muscle group, personal records, session frequency |
get_upcoming_workouts | Your programmed training days and exercises |
list_programs | List all your training programs (active, drafts, optionally archived) with id, name, day count, creation date, active-cycle flag |
get_program_details | Full structure of one program by UUID — days, exercises, sets/reps/weights/rest. Works on any program (active/draft/archived). Chain after list_programs to drill in |
create_program | Create / replace your active program from structured days + exercise UUIDs. Default dry_run: true returns the insert plan only; dry_run: false writes to Supabase and deactivates your other active programs |
create_workout_day | Log a single ad-hoc session (“quick workout for today”) without touching the active program. dry_run defaults to true |
update_program | Edit an existing program in place by program_id — preserves all logged history. dry_run defaults to true; removing days also needs confirm: true |
There’s also one MCP Resource (exercise_catalog_schema) exposing the exercise taxonomy: muscle groups, equipment types, difficulty levels.
Eleven tools — eight reads, three writes (plus resolve_exercises for name→UUID resolution).
Example prompts
- “Montre-moi mes 5 dernières séances”
- “Cherche les exercices pour les pectoraux”
- “Analyse mon équilibre push/pull sur le dernier mois”
- “C’est quoi mon prochain training ?”
- “Donne-moi les détails du Romanian Deadlift”
- “Voici ma semaine type en 4 jours — enregistre ça comme programme actif (dry run puis apply avec create_program)“
Rotating or revoking a token
- Rotate: create a new token, swap it into
mcp.json, restart Cursor, then revoke the old one from/account/api-tokens. - Revoke: click Revoke next to the token. It’s immediate and irreversible — there is no soft-delete.
- Lost laptop: revoke that token. Your other PATs keep working.
Troubleshooting
| Problem | Fix |
|---|---|
Only search_exercises shows up | Quit Cursor entirely, reopen the project, start a new Agent chat |
401 Authentication required | Token was revoked, expired, or mistyped. Mint a fresh one at /account/api-tokens |
| Tools not listed at all | Check the ~/.cursor/mcp.json syntax, then restart MCP in Cursor Settings |
Token works in curl but not Cursor | Make sure the value in mcp.json is the full glp_… string — no quotes inside the bearer, no trailing whitespace |
Legacy: pasting a 1-hour session JWT
Older guides told you to copy access_token out of the browser’s localStorage. That still works, but it expires in an hour, which means a fresh OAuth dance every time you reopen Cursor. PATs replace that workaround.