MCP Server for Connecting Claude with Intervals.icu API

Hi all,

I just published a Model Context Protocol (MCP) server that connects Anthropic’s Claude desktop client with the Intervals.icu API. It includes built-in tools for authentication and retrieving activities, events, and wellness data.

You can check out the project here: GitHub - mvilanova/intervals-mcp-server: Model Context Protocol (MCP) server for connecting Claude with the Intervals.icu API

Feel free to give it a try and ask Claude questions about your past activities and their interval data, upcoming workouts, and past wellness data — and I’d love any feedback or suggestions!

12 Likes

Works as advertised !!! Great work here :+1:

1 Like

Thanks! I just updated the readme to make instructions more clear. Let me know what use cases you come up with. I’ll post some that I found useful later.

BTW… nothing to do with your code, but i struggled to get Claude to play with uv and python (I’m on macOS)… and had to add full path on the Claude config file to make it work, so this may save some trouble for some of you… here it is the final configuration that worked for me:

{
“mcpServers”: {
“Intervals MCP Server”: {
“command”: “/intervals-mcp-server/.venv/bin/uv”,
“args”: [
“run”,
“–python”,
“/intervals-mcp-server/.venv/bin/python”,
“–with”,
“mcp[cli]”,
“mcp”,
“run”,
“/intervals-mcp-server/intervals_mcp_server.py”
]
}
}
}

Yes, still playing with it… I found most useful questions about the intervals, nice summary and insights

1 Like

Thanks, and sorry you had trouble with it. I’d be curious to know if you still have the same issues if you follow the new instructions. I’m on macOS too.

1 Like

Your config file should look like this after running mcp install src/intervals_mcp_server/server.py --name "Intervals.icu MCP Server"

{
  "mcpServers": {
    "Intervals.icu MCP Server": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "/path/to/intervals-mcp-server/src/intervals_mcp_server/server.py"
      ]
    }
  }
}
1 Like

This is a cool use for it… I did a ramp test on feb 21… so i asked

from the ramp test on feb 21, what is my ftp, thr and vo2max

Edit

Based on the ramp test data from February 21, 2025, I can identify the following key metrics:

  1. FTP (Functional Threshold Power): 242 watts
  • This is confirmed in your activity data and used as your FTP reference in subsequent workouts
  1. THR (Threshold Heart Rate): 168 bpm
  • This is listed as your LTHR (Lactate Threshold Heart Rate) in your activity data
  • During the test, your heart rate reached 170 bpm during the sustained threshold effort
  1. VO2max Power: Not directly measured in the test
  • Based on your peak power in the ramp test (375W) and your ability to sustain around 300W during the final minutes, your VO2max power is likely around 310-325W (approximately 115-120% of your FTP)
  • This would typically be the power you could sustain for a maximal 3-5 minute effort

The ramp test is primarily designed to establish your FTP rather than precisely measure VO2max. For a more accurate VO2max measurement, you would need either a specific field test (like a 5-minute all-out effort) or a laboratory test with respiratory gas analysis equipment.

The Xert “Gold Breakthrough” mentioned in your activity description indicates that this test represented a significant improvement in your performance markers according to their analytics system.

1 Like

no worries… absolute first time playing with MCP, so my struggles are due to being the very first time ever i connected Claude to mcp… great work, and thanks !!!

1 Like

Here’s a similar one:

Question: “Analyze my last 10 cycling activities and their interval data and let me know if I should decrease, keep, or increase my FTP and why.”

Answer:

I’d be happy to analyze your recent cycling activities and interval data to help determine if you should adjust your FTP (Functional Threshold Power). Let me retrieve your most recent activities and their interval data.

Now, let me look at the interval data for a few key workouts to better understand your performance. I’ll check the interval data for recent structured workouts at higher intensities.

Based on the data I’ve collected from your last 10 cycling activities and interval workouts, I can now analyze your performance to determine if you should adjust your FTP. Here’s my analysis:

Current FTP Status

Your current FTP is set at 260 watts.

Key Performance Indicators

Training Structure

You’ve completed a well-structured mix of workouts:

  • VO2max intervals at 110-115% FTP
  • Sweet Spot workouts (84-90% FTP)
  • Zone 2 endurance rides
  • Recovery rides
  • An outdoor ride after recovering from a shoulder injury

High-Intensity Workout Performance

Looking at your VO2max intervals (activity i70479948):

  • You consistently maintained 295-299 watts during 30-second intervals (113-115% of FTP)
  • Heart rate response was appropriate, reaching 154-169 bpm
  • Cadence was high (91-102 rpm) with good efficiency

During your Sweet Spot sessions:

  • You completed multiple 5-minute intervals at 233-234 watts (89-90% FTP)
  • You maintained 10-minute intervals at 228-233 watts (87-89% FTP)
  • Heart rate response was appropriate (160-169 bpm)
  • Decoupling was minimal, suggesting good aerobic fitness

RPE (Rating of Perceived Exertion)

  • Your workouts show “Feel” ratings of 1-3/10, suggesting the intensity was challenging but manageable
  • Your Sweet Spot sessions had RPE of 439-634 (moderate to somewhat hard)
  • Your VO2max session had RPE of 419 (moderate)

Heart Rate and Power Relationship

  • Your Power:HR ratio is consistently around 1.07-1.19, showing good efficiency
  • Decoupling during high-intensity efforts is minimal (<5% in most intervals)
  • You reach appropriate HR percentages for the given power zones

FTP Recommendation

Based on the analysis of your last 10 workouts, I recommend you increase your FTP by 5-10 watts (to 265-270 watts) for the following reasons:

  1. You’re completing high-intensity intervals at 115% of current FTP with good form and consistent power output
  2. Your Sweet Spot intervals are sustained well with appropriate physiological responses
  3. Your Power:HR ratio is favorable across different workout intensities
  4. Your RPE ratings suggest workouts are challenging but not excessively difficult
  5. The variability index in your harder workouts shows you’re maintaining steady power
  6. Your heart rate recovery appears good between intervals

The 5-10 watt increase is conservative but appropriate because:

  1. You’ve recently recovered from a shoulder injury
  2. A moderate increase will allow you to adapt gradually to the new zones
  3. Your current workouts are challenging but not overwhelming you

If you decide to increase your FTP, I’d recommend reassessing after 3-4 weeks of training at the new level to ensure it’s appropriate and sustainable.

Question: " Analyze and summarize my wellness data from the last 60 days" (I broke my shoulder 6 week ago)

Answer:

I’ll help you analyze your wellness data from the last 60 days. Let me retrieve that information for you.

Based on your wellness data from January 29 to March 30, 2025, here’s a comprehensive summary:

Training Metrics

  • Fitness (CTL): Started at around 36.7 and ended at 29.5, showing an overall declining trend in your training load.
  • eFTP: Decreased gradually from 230.1 to 219.5 watts over the 60-day period.
  • Training Load Pattern: Your training load shows a cyclical pattern with peaks typically on weekends, suggesting a weekend-focused training schedule.

Vital Signs

  • Resting Heart Rate: Ranged between 49-66 bpm, with an average of approximately 55 bpm, indicating good cardiovascular health.
  • HRV (Heart Rate Variability): Consistently between 65-88, averaging around 78, which suggests good recovery and autonomic nervous system balance.
  • Weight: Fluctuated between 84.5-87.0 kg, with slight variations throughout the period.
  • Body Fat: Ranged from 16.7% to 19.9% on the days it was measured.
  • VO2 Max: Mostly stable between 36-40 ml/kg/min, with some improvement in early March.

Sleep & Recovery

  • Sleep Duration: Averaged 7.4 hours per night, with a range of 1.5-9.7 hours.
  • Readiness Score: Typically high (70-100), with occasional dips to the 60s, indicating generally good recovery between training sessions.

Trends and Patterns

  1. Training Cycle: Your data shows a pattern of higher intensity training followed by recovery periods.
  2. Recovery Quality: Despite variation in sleep duration, your recovery scores remained relatively high, suggesting efficient recovery.
  3. Rest Days: Clear reduction in training load on certain weekdays, indicating structured rest days.
  4. February Decline: A noticeable decrease in fitness metrics from mid to late February (CTL dropped from ~35 to ~30).
  5. March Rebuilding: Signs of rebuilding training load in March, with more consistent training sessions.

Areas for Attention

  • Sleep Consistency: Some nights with less than 7 hours sleep could impact long-term recovery.
  • Training Consistency: The significant decline in CTL during February might indicate a period of reduced training volume.
  • Stress Index: Baevsky Stress Index occasionally elevated, suggesting periods of higher physiological stress.
1 Like

good update… I think the step I missed was
mcp install src/intervals_mcp_server/server.py --name “Intervals.icu MCP Server”

Thanks !

1 Like

Hi Marc,

thanks for this, it looks awesome. I’m having installing (on Ubuntu subsystem on Windows). I followed the instructions. I installed the Model Context Protocol (MCP) server inside the intervals-mcp-server dir and followed the setup page (btw, there’s a typo in git clone https://github.com/yourusername/intervals-mcp-server.git).

However, when I get to “uv pip install -e .”, I get this error:

Resolved 28 packages in 283ms
  × Failed to build `intervals-mcp-server @ file:///mnt/c/Non_Installed_Software/intervals_icu/intervals-mcp-server`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `hatchling.build.build_editable` failed (exit status: 1)

    [stderr]
      Traceback (most recent call last):
        File "<string>", line 11, in <module>
        File "/home/nik/.cache/uv/builds-v0/.tmpPQ2L1G/lib/python3.10/site-packages/hatchling/build.py", line 83,
      in build_editable
...... cut .......
 File "/home/nik/.cache/uv/builds-v0/.tmpPQ2L1G/lib/python3.10/site-packages/hatchling/builders/wheel.py", line
      250, in default_file_selection_options
          raise ValueError(message)
      ValueError: Unable to determine which files to ship inside the wheel using the following heuristics:
      https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection

Thanks. Please let me know if you’d prefer me to post help questions on git.

I have this error

2025-04-17 11:57:27.374 [info] Connection state: Starting

2025-04-17 11:57:27.380 [info] Starting server from LocalProcess extension host

2025-04-17 11:57:27.380 [info] Connection state: Starting

2025-04-17 11:57:27.381 [info] Connection state: Error spawn uv ENOENT

I added a manifest file: adds missing manifest by mvilanova · Pull Request #6 · mvilanova/intervals-mcp-server · GitHub. Can you try again and let me know if you’re still having the same issue?

Fixed the clone url as well in fixes repo clone url by mvilanova · Pull Request #7 · mvilanova/intervals-mcp-server · GitHub. Thanks for letting me know!

This looks like a connectivity related issue. Could you share more about the environment where you’re running the code?

Yes, It was a problem with uv installation. I did brew install uv and problem is gone

1 Like

Can coaches view student activity?

I’m on a Mac and I’m not familiar with hatchling. I got the following error on “Setup Step 4. Install dependencies”:

 $ uv pip install -e .
Resolved 27 packages in 15.32s
  × Failed to build `intervals-mcp-server @ file:///Users/andy/Projects/AI/intervals-mcp-server`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `hatchling.build.build_editable` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 11, in <module>
          wheel_filename = backend.build_editable("/Users/andy/.cache/uv/builds-v0/.tmpcQMekT", {}, None)
        File "/Users/andy/.cache/uv/builds-v0/.tmp4wccXg/lib/python3.13/site-packages/hatchling/build.py", line 83,
      in build_editable
          return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable'])))
                                  ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<snip>

        File "/Users/andy/.cache/uv/builds-v0/.tmp4wccXg/lib/python3.13/site-packages/hatchling/builders/wheel.py",
      line 262, in default_only_include
          return self.default_file_selection_options.only_include
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/andy/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/functools.py", line
      1037, in __get__
          val = self.func(instance)
        File "/Users/andy/.cache/uv/builds-v0/.tmp4wccXg/lib/python3.13/site-packages/hatchling/builders/wheel.py",
      line 250, in default_file_selection_options
          raise ValueError(message)
      ValueError: Unable to determine which files to ship inside the wheel using the following heuristics:
      https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection

      The most likely cause of this is that there is no directory that matches the name of your project
      (intervals_mcp_server).

      At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see:
      https://hatch.pypa.io/latest/config/build/

      As an example, if you intend to ship a directory named `foo` that resides within a `src` directory located at
      the root of your project, you can define the following:

      [tool.hatch.build.targets.wheel]
      packages = ["src/foo"]

      hint: This usually indicates a problem with the package or the build environment.

To fix this and to get the dependencies to install, I added the following lines to pyproject.toml per Claude’s recommendations:

[tool.hatch.build.targets.wheel]
packages = ["src/intervals_mcp_server"]
1 Like