Skip to main content
Glama
README.md
# tonal-mcp

An unofficial [Model Context Protocol](https://modelcontextprotocol.io) server for [Tonal](https://www.tonal.com). It lets Claude, Cursor or any MCP client read your full training history and per-exercise progress, search Tonal's coach-led library, and build, edit and schedule custom workouts on your Tonal.

> **Not affiliated with Tonal.** This project is not endorsed by, sponsored by or associated with Tonal Systems, Inc. "Tonal" is a trademark of Tonal Systems, Inc. The server talks to the same private API the Tonal apps use, which can change without notice. Use it with your own account, at your own risk.

## What you can ask

- "Is my bench press going up? Show me the last few months."
- "How consistent have I been the last eight weeks, and am I on track for this week's goals?"
- "Which muscles are recovered enough to train today?"
- "Find me a 20-minute Tonal arms workout I can do with just handles."
- "Build me a 30-minute pull workout and put it on my Tonal for Tuesday and Friday."
- "Swap the rows in my Push Day workout for something easier on my lower back."

## Setup

You need Node.js 20 or later.

**1. Sign in once** in a terminal:

```bash
npx -y github:JeffOtano/tonal-mcp login
```

The first run downloads and builds the server from this repository, which takes around 15 seconds; after that it starts in a second or two.

This exchanges your email and password for Tonal session tokens and saves only the tokens, in `~/.config/tonal-mcp/session.json`, readable only by you. Your password is not stored. The server refreshes the tokens on its own; run `login` again only if Tonal ends the session.

**2. Add the server to your MCP client.**

Claude Code:

```bash
claude mcp add tonal -- npx -y github:JeffOtano/tonal-mcp
```

Claude Desktop, Cursor and most other clients take a JSON entry like this (for Claude Desktop, in `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "tonal": {
      "command": "npx",
      "args": ["-y", "github:JeffOtano/tonal-mcp"]
    }
  }
}
```

To look but never touch, add `"env": { "TONAL_MCP_READ_ONLY": "true" }`. That hides every tool that changes your account.

Check who is signed in with `npx -y github:JeffOtano/tonal-mcp status`, and sign out (revoking the session) with `npx -y github:JeffOtano/tonal-mcp logout`.

## Tools

**Your training**

| Tool | What it does |
| --- | --- |
| `get_profile` | Name, height, weight, goals and preferred training frequency |
| `get_strength_scores` | Current upper, lower, core and overall Strength Score, and your percentile |
| `get_strength_history` | Strength Scores after every workout, back to the first |
| `get_muscle_readiness` | Tonal's 0-100 recovery estimate per muscle group |
| `get_training_summary` | Week-by-week workouts, minutes and volume, your weekly streak, and lifetime totals |
| `get_weekly_goals` | Tonal's weekly targets (volume, work, strength sets, power reps and more) and where you stand |
| `list_workout_history` | Every completed Tonal workout, newest first |
| `get_workout_detail` | Exercises, sets, reps and weights for one completed workout |
| `get_movement_history` | One exercise across recent workouts: sets, reps, top weight and estimated one-rep max |
| `list_external_activities` | Non-Tonal workouts Tonal has synced, such as runs from Apple Health |

**Workouts**

| Tool | What it does |
| --- | --- |
| `search_movements` | Search Tonal's movement library by name, muscle group or accessory |
| `search_tonal_workouts` | Search Tonal's 3,000+ coach-led workouts by words, coach, type, area, level, length, movement or the accessories you have |
| `get_tonal_workout` | The exercises in a library workout, the Daily Lift or a recommendation |
| `list_custom_workouts` / `get_custom_workout` | Your saved custom workouts |
| `estimate_workout` | How long a workout would take, without saving it |
| `create_custom_workout` | Save a custom workout to your Tonal ✏️ |
| `update_custom_workout` | Replace a custom workout's exercises, keeping its ID and calendar entries ✏️ |
| `share_custom_workout` | Get a link that opens a custom workout in the Tonal app ✏️ |
| `delete_custom_workout` | Delete a custom workout ✏️ |

**Calendar**

| Tool | What it does |
| --- | --- |
| `get_calendar` | Scheduled workouts, the Daily Lift and recommendations by day |
| `schedule_workout` | Put a custom or library workout on a day; the same workout can go on several days ✏️ |
| `unschedule_workout` | Take a workout off one day or every upcoming day ✏️ |

✏️ changes your Tonal account and is hidden in read-only mode. The server also ships two prompts, `build_workout` and `plan_week`.

### How workouts are described

`create_custom_workout` and `estimate_workout` take blocks of exercises. A block with one exercise is straight sets; two or more alternate round by round, which is how Tonal runs supersets and circuits.

```json
{
  "title": "Push: Chest & Triceps",
  "blocks": [
    { "exercises": [{ "name": "Bench Press", "sets": 3, "reps": 8, "spotter": true }] },
    { "exercises": [
      { "name": "Triceps Extension", "sets": 3, "reps": 12 },
      { "name": "Pillar Bridge", "sets": 3, "duration": 40 }
    ] }
  ]
}
```

The server matches each exercise to Tonal's catalog by exact name, so a model cannot slip in a made-up movement ID; near misses come back with suggestions. Timed movements get seconds and counted ones get reps, whatever was sent. For alternating movements, reps are per side. After saving, the server reads the workout back from Tonal and warns if Tonal stored something different.

## Privacy

Everything runs on your machine. The server talks only to `api.tonal.com` and Tonal's sign-in service at `tonal.auth0.com`; nothing is sent anywhere else, and there is no telemetry. Your MCP client's model provider sees the data the tools return, as with any MCP server.

Instead of `login`, you can set `TONAL_EMAIL` and `TONAL_PASSWORD` in the server's environment. Tokens then stay in memory, but your password sits in the client's config file, so `login` is the better choice. `TONAL_MCP_SESSION_PATH` moves the session file.

## Known limits

- Tonal's calendar follows UTC dates. Late in the day in the Americas, "today" on Tonal may already be tomorrow, and earlier dates cannot be scheduled.
- `get_movement_history` reads up to your 50 most recent workouts at a time, which covers months of training for most people.
- Tonal does not say which training types a movement belongs to, so `search_movements` filters by name, muscle group and accessory only.
- Strength Scores are Tonal's own 0-999 index, not pounds. Weights are reported in pounds.

## Development

```bash
npm install
npm test           # unit tests, no Tonal account needed
npm run build
npm run inspect    # open the server in the MCP Inspector
```

## License

[MIT](LICENSE)