Skip to main content
Glama

intervals-mcp

An MCP server that lets Claude plan your cycling training in intervals.icu — and read back how it actually went.

Workouts land in the intervals.icu calendar, from which Zwift and Garmin pick them up. Afterwards Claude can review the outcome: planned versus actual, per-interval detail, fitness trend, power curve. So the next block is built on what happened, not on what was hoped for.

There is no training program in the code. You say what you want to train, Claude writes the workouts, this server delivers them and checks that intervals.icu understood them the way you meant.

"Check my FTP and build a 4-week VO2max block starting January 12. Three quality sessions a week, the rest Z2."

…and a week later: "How did last week go?"

Install

You need uv and an intervals.icu API key.

Nothing to clone — uvx runs the server straight from this repository.

Getting your API key

  1. If you do not have an intervals.icu account yet, create one — it is free — and connect Strava, Garmin, Zwift or whatever records your rides, so your training actually lands there.

  2. Open https://intervals.icu/settings and scroll to the bottom, to the Developer Settings section.

  3. Copy the API key. It is about 25 characters of lowercase letters and digits.

That is all — there is no app to register and no OAuth flow to complete. The same section regenerates the key if you ever need to revoke it, which immediately invalidates the old one.

You do not need INTERVALS_ICU_ATHLETE_ID. It defaults to 0, meaning the account the key belongs to. Set it only if you are working with another athlete's data, such as one you coach.

Registering the server

Claude Code — put this in .mcp.json in your project, or run claude mcp add:

{
  "mcpServers": {
    "intervals-icu": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/staffanbergvall/intervals-mcp",
               "intervals-mcp"],
      "env": { "INTERVALS_ICU_API_KEY": "your-key-here" }
    }
  }
}

Claude Desktop — the same block goes in claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS, ~/.config/Claude/ on Linux). Restart the app fully — on Windows that means File → Exit, not just closing the window.

Then ask Claude to run check_connection. If it reports your FTP, you are set.

If your machine blocks executables from user directories

Some managed Windows environments (AppLocker and friends) refuse to run .exe files installed under the user profile, so uvx fails with Failed to spawn: intervals-mcp — Access is denied. The package is fine; only the generated console script is blocked. Start the module directly instead:

{
  "mcpServers": {
    "intervals-icu": {
      "command": "uv",
      "args": ["run", "--with", "git+https://github.com/staffanbergvall/intervals-mcp",
               "python", "-m", "intervals_mcp.server"],
      "env": { "INTERVALS_ICU_API_KEY": "your-key-here" }
    }
  }
}

Zwift

Uploaded workouts appear under Workouts → Custom → Intervals.icu. Restart Zwift if they do not show up right away. If Zwift runs somewhere the intervals.icu integration is unavailable, export_block writes the block as .zwo files instead.

Related MCP server: Garmin-Strava-mcp

Tools

Tool

What it does

check_connection

Fetches FTP, threshold HR, max HR and power zones from the account

upload_block

Puts a block of workouts in the calendar and verifies the interpretation

list_block

Shows which workouts the server has added during a period

delete_block

Removes a block

export_block

Downloads the block as .zwo/.erg/.fit files

review_period

Planned versus actual for a period: compliance, missed workouts, and every other activity

get_activity

One completed activity with its intervals — per-rep watts, HR, cadence

get_fitness

CTL/ATL per day with client-computed form (TSB)

get_power_curve

Best power per duration over a period, in watts and W/kg

The icu://workout-syntax resource carries the full syntax for workout descriptions; Claude reads it before writing any workout.

The read tools report numbers, never judgements. What the numbers mean for your next block is decided in the conversation — that is the model's job, not the server's.

Workouts are always written in English — block names, workout names and descriptions — whatever language you and Claude are speaking. They end up in the calendar, in Zwift and on the Garmin head unit, and they outlive the conversation that created them.

What makes it safe to let a model write to your calendar

It can only touch its own workouts. Every workout this server creates is stamped with an external_id of the form mcp:<block>:<number>. Workouts you added by hand, imported, or got from a coach carry no such stamp — they are invisible to list_block and cannot be deleted by delete_block.

Uploading is idempotent. Re-uploading the same block name updates the workouts instead of duplicating them, so you correct a block by simply running it again. If the corrected version has fewer workouts than before, the leftovers from the earlier version are reported rather than left silently in your calendar.

The length check. The dangerous failure is not an HTTP error — it is a workout that uploads without protest and is interpreted wrong. After every upload the server compares intervals.icu's own parse of each workout against the duration you stated, and says so when they diverge:

!!  2027-01-14  30/15 3x13
      3 steps, 36 min (stated: 63 min)
      WARNING: Line 6: '13x' directly follows '3x'. Nested repeats are not
      supported — the outer one swallows the inner. Write the sets out one by
      one instead.
      WARNING: Duration mismatch: you stated 63 min, the server parsed 36.0 min
      (43% off). Something in the description was not read the way you meant.

A workout the server returns no event for is reported the same way — as a warning, never as silence.

Nested repeats are not supported by intervals.icu. 3x around 13x gives 3 rounds, not 39, and intervals.icu does not complain. Verified against the live API — worth knowing even if you never use this server.

Your API key

The key grants full read and write access to your intervals.icu account, not just to workouts. Treat it like a password: keep it in your MCP client's config or environment, never in a file you commit. This server sends it only to intervals.icu, over HTTPS, and never logs it.

If you think a key has leaked, regenerate it at https://intervals.icu/settings — that invalidates the old one at once.

For local development you can put it in a .env file instead (see .env.example); .env is gitignored.

Development

git clone https://github.com/staffanbergvall/intervals-mcp
cd intervals-mcp
uv sync
uv run python -m pytest -q      # 138 tests, no network traffic

The tests cross the same interfaces production does: the pure logic directly, the API client through httpx.MockTransport, and the tool bodies with the real client behind a mock transport. Nothing touches a live calendar.

The repository ships a path-free .mcp.json, so Claude Code picks up your working copy when you open the project.

On the locked-down machines described above, the same restriction applies to .venv/Scripts/ — run tests as uv run python -m pytest, never as pytest.

Documentation

The pages in docs/ go deeper than this README:

Status

A personal project, shared because it might be useful to someone else. Issues and pull requests are welcome, but this is a spare-time thing — there is no guarantee of a timely response. See CONTRIBUTING.md before opening a PR.

Not affiliated with or endorsed by intervals.icu, Zwift or Garmin. It talks to the public intervals.icu API with your own key.

MIT licensed.

Available Tools

9 tools
check_connectionA

Verifies the connection and fetches the athlete's threshold values.

Run this before building a workout. FTP, threshold heart rate and zone boundaries come from the account, so intensities are computed against the right numbers instead of a guess.

Inputs: no named parameters. Returns: result

delete_blockA

Removes a block from the calendar.

Deletes only workouts this server created under the given block name. Workouts you added yourself, imported, or that belong to another block cannot be hit.

Inputs: end_date (required), block_name (required), start_date (required). Returns: result

export_blockA

Downloads an uploaded block as workout files.

The workouts must be in the calendar first — run upload_block before. The files are an alternative to the intervals.icu integration, useful when Zwift runs on a device where the integration is unavailable.

.zwo files are used in Zwift by placing them under Documents/Zwift/Workouts// and appear under Workouts -> Custom.

Inputs: end_date (required), block_name (required), output_dir (required), start_date (required), +1 more. Returns: result

get_activityA

Fetches one completed activity with its intervals.

The per-rep actuals — watts, heart rate, cadence per detected interval — for checking how a structured workout actually went. Run review_period first to find the activity id.

Inputs: activity_id (required). Returns: result

get_fitnessA

Shows the fitness trend: CTL, ATL and form (TSB) per day.

Form is computed here as CTL − ATL — intervals.icu exposes no form field. Defaults to the last 28 days. The trend says whether the athlete is peaking or digging a hole; what to do about it is the caller's judgement.

Inputs: end_date, start_date. Returns: result

get_power_curveA

Shows the athlete's power curve — best average power per duration.

The strength profile of a cyclist: best 5 s, 1 min, 5 min, 20 min and longer efforts over the period, in watts and W/kg. Downsampled to the classic durations; the raw curve carries one point per second.

Inputs: sport, period. Returns: result

list_blockA

Shows workouts this server has put in the calendar during a period.

Shows only its own workouts. Anything you added by hand, imported, or got from a coach is invisible here — and cannot be deleted by delete_block either.

Inputs: end_date (required), start_date (required), block_name. Returns: result

review_periodA

Reviews planned versus actual training in a period.

Shows this server's planned workouts with their outcome — the paired activity and its server-computed compliance — flags missed workouts, and lists every other activity in the window: spontaneous rides and foreign plans count toward load all the same. Defaults to the last 7 days.

The numbers are reported, not interpreted — the judgement about what they mean for the next block is yours. Use get_activity for the per-interval detail of one ride, get_fitness for the CTL/ATL/form trend.

Inputs: end_date, start_date. Returns: result

upload_blockA

Puts a block of planned workouts in the intervals.icu calendar.

From there the workouts sync to Zwift (Workouts -> Custom -> Intervals.icu) and Garmin.

Write the block name, the workout names and the descriptions in ENGLISH, even when talking to the user in another language. The calendar, Zwift and Garmin are English, and these workouts outlive the conversation.

After the upload, the server's interpretation of each workout is compared with the duration you stated. That catches DSL mistakes that would otherwise be silent — above all nested repeats, which make the workout shorter than intended without the server complaining. Read the warnings: a workout can upload without errors and still be wrong.

Re-run with the same block_name to correct; it creates no duplicates.

Inputs: workouts (required), block_name (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: connection check, block upload/list/delete/export, fitness trend, power curve, period review, and activity details. The descriptions further clarify any potential overlap, such as upload vs. export or review_period vs. get_activity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with lowercase and underscores: check_connection, upload_block, list_block, delete_block, get_fitness, get_power_curve, export_block, review_period, get_activity. There are no deviations or mixed conventions.

    Tool Count5/5

    With 9 tools, the server is well-scoped. Each tool covers a distinct aspect of the workout planning and analysis workflow, and the count is within the ideal 3-15 range.

    Completeness4/5

    The tool surface covers the full lifecycle from connection verification and threshold fetching to uploading, listing, deleting, exporting blocks, reviewing period performance, and fetching activity details. A minor gap is the lack of a dedicated tool to retrieve a single workout's planned structure without exporting the entire block, but this is workable.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides MCP servers for Claude to access fitness data from Strava and intervals.icu, enabling natural language queries for activity analysis, advanced training metrics, and wellness tracking.
      1
      -
    • A
      license
      A
      quality
      C
      maintenance
      MCP server for Intervals.icu that enables AI assistants to manage athletic training data, including activities, calendar events, wellness metrics, and workout libraries.
      19
      Apache 2.0