Skip to main content
Glama
Intervals.icu MCP Server

Intervals.icu MCP Server

by mvilanova

Servidor MCP de Intervals.icu

Servidor del Protocolo de Contexto de Modelo (MCP) para conectar Claude y ChatGPT con la API de Intervals.icu. Proporciona herramientas para la autenticación y la recuperación de datos de actividades, eventos y bienestar.

Si consideras útil este servidor del Protocolo de Contexto de Modelo (MCP), por favor considera apoyar su desarrollo continuo con una donación.

Requisitos

Related MCP server: Intervals.icu MCP Server

Configuración

1. Instalar uv (recomendado)

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Después de la instalación, busca la ruta completa a uv; la necesitarás más adelante al configurar Claude Desktop:

where.exe uv
# Example output: C:\Users\<USERNAME>\.local\bin\uv.exe

2. Clonar este repositorio

git clone https://github.com/mvilanova/intervals-mcp-server.git
cd intervals-mcp-server

3. Crear y activar un entorno virtual

# Create virtual environment with Python 3.12
uv venv --python 3.12

# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate

4. Sincronizar las dependencias del proyecto

uv sync

5. Configurar las variables de entorno

Haz una copia de .env.example y nómbrala .env ejecutando el siguiente comando:

macOS/Linux:

cp .env.example .env

Windows (PowerShell):

Copy-Item .env.example .env

Luego edita el archivo .env y establece tu ID de atleta y clave de API de Intervals.icu:

API_KEY=your_intervals_api_key_here
ATHLETE_ID=your_athlete_id_here

Obtener tu clave de API de Intervals.icu

  1. Inicia sesión en tu cuenta de Intervals.icu

  2. Ve a Ajustes > API

  3. Genera una nueva clave de API

Encontrar tu ID de atleta

Tu ID de atleta suele ser visible en la URL cuando has iniciado sesión en Intervals.icu. Se ve así:

  • https://intervals.icu/athlete/i12345/... donde i12345 es tu ID de atleta

Actualización

Este proyecto se desarrolla activamente, con nuevas funciones y correcciones añadidas regularmente. Para mantenerte al día, sigue estos pasos:

1. Extraer los últimos cambios de main

⚠️ Asegúrate de no tener cambios sin confirmar antes de ejecutar este comando.

macOS/Linux:

git checkout main && git pull

Windows (PowerShell):

git checkout main; git pull

2. Actualizar las dependencias de Python

Activa tu entorno virtual y sincroniza las dependencias:

macOS/Linux:

source .venv/bin/activate
uv sync

Windows (PowerShell):

.venv\Scripts\activate
uv sync

Solución de problemas

Si Claude Desktop falla debido a cambios en la configuración, sigue estos pasos:

  1. Elimina la entrada Intervals.icu existente en claude_desktop_config.json.

  2. Reconfigura Claude Desktop desde el directorio intervals-mcp-server.

macOS/Linux:

mcp install src/intervals_mcp_server/server.py --name "Intervals.icu" --with-editable . --env-file .env

Windows: Vuelve a añadir la entrada manualmente como se describe en la sección de configuración de Windows.

Errores comunes

spawn uv ENOENT — Claude Desktop no puede encontrar el ejecutable uv. Usa la ruta completa a uv en el campo command. Ejecuta which uv (macOS/Linux) o where.exe uv (Windows) para obtenerla.

spawn /Users/... ENOENT en Windows — El archivo de configuración contiene una ruta al estilo macOS/Linux. Reemplázala con la ruta correcta de Windows usando barras invertidas como se describe en la sección de configuración de Windows a continuación.

Instalación desde la Microsoft Store: los cambios de configuración no surten efecto — Es posible que estés editando el archivo de configuración incorrecto. Claude Desktop instalado desde la Microsoft Store lee desde AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json, no desde AppData\Roaming\Claude\.

Uso con Claude

1. Configurar Claude Desktop

Para usar este servidor con Claude Desktop, debes añadirlo a tu configuración de Claude Desktop.

macOS/Linux

  1. Ejecuta lo siguiente desde el directorio intervals-mcp-server para configurar Claude Desktop:

mcp install src/intervals_mcp_server/server.py --name "Intervals.icu" --with-editable . --env-file .env
  1. Si abres tu archivo de configuración de la aplicación Claude Desktop claude_desktop_config.json, debería verse así:

{
  "mcpServers": {
    "Intervals.icu": {
      "command": "/Users/<USERNAME>/.local/bin/uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with-editable",
        "/path/to/intervals-mcp-server",
        "mcp",
        "run",
        "/path/to/intervals-mcp-server/src/intervals_mcp_server/server.py"
      ],
      "env": {
        "INTERVALS_API_BASE_URL": "https://intervals.icu/api/v1",
        "ATHLETE_ID": "<YOUR_ATHLETE_ID>",
        "API_KEY": "<YOUR_API_KEY>",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

Donde /path/to/ es la ruta a la carpeta de código intervals-mcp-server en tu sistema.

Windows

El comando mcp install puede fallar en Windows debido a problemas de entorno o permisos. En su lugar, configura Claude Desktop manualmente:

  1. Busca el archivo de configuración de Claude Desktop. Si Claude Desktop se instaló desde la Microsoft Store, la configuración se encuentra en:

    C:\Users\<USERNAME>\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json

    Si se instaló a través del instalador estándar, puede estar en:

    C:\Users\<USERNAME>\AppData\Roaming\Claude\claude_desktop_config.json

    Si el archivo o la carpeta no existen, créalos.

  2. Añade la siguiente entrada a claude_desktop_config.json, reemplazando los marcadores de posición con tus valores reales:

{
  "mcpServers": {
    "Intervals.icu": {
      "command": "C:\\Users\\<USERNAME>\\.local\\bin\\uv.exe",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with-editable",
        "C:\\path\\to\\intervals-mcp-server",
        "mcp",
        "run",
        "C:\\path\\to\\intervals-mcp-server\\src\\intervals_mcp_server\\server.py"
      ],
      "env": {
        "INTERVALS_API_BASE_URL": "https://intervals.icu/api/v1",
        "ATHLETE_ID": "<YOUR_ATHLETE_ID>",
        "API_KEY": "<YOUR_API_KEY>",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}
  • Usa barras invertidas dobles (\\) para todas las rutas de Windows en JSON.

  • Para encontrar la ruta completa a uv.exe, ejecuta where.exe uv en PowerShell.

  • Para encontrar la ruta completa al repositorio clonado, ejecuta pwd desde dentro de la carpeta intervals-mcp-server.

Nota para instalaciones desde la Microsoft Store: Claude Desktop instalado desde la Microsoft Store aísla su configuración en AppData\Local\Packages\.... Editar AppData\Roaming\Claude\claude_desktop_config.json no tendrá efecto; asegúrate de editar el archivo correcto.

  1. Reinicia Claude Desktop.

2. Usar el servidor MCP con Claude

Una vez que el servidor esté en ejecución y Claude Desktop esté configurado, puedes usar las siguientes herramientas para hacer preguntas sobre tus actividades, eventos y datos de bienestar pasados y futuros.

  • get_activities: Recuperar una lista de actividades

  • get_activity_details: Obtener información detallada de una actividad específica

  • get_activity_intervals: Obtener datos detallados de intervalos para una actividad específica

  • get_wellness_data: Obtener datos de bienestar

  • get_events: Recuperar próximos eventos (entrenamientos, carreras, etc.)

  • get_event_by_id: Obtener información detallada de un evento específico

Uso con ChatGPT

Los conectores MCP beta de ChatGPT también pueden comunicarse con este servidor a través del transporte SSE.

  1. Inicia el servidor en modo SSE para que exponga los puntos finales /sse y /messages/:

    export FASTMCP_HOST=127.0.0.1 FASTMCP_PORT=8765 MCP_TRANSPORT=sse FASTMCP_LOG_LEVEL=INFO
    python src/intervals_mcp_server/server.py

    El registro de inicio imprime las URLs completas (por ejemplo, http://127.0.0.1:8765/sse). ChatGPT necesita esa URL pública, así que redirige el puerto con una herramienta como ngrok http 8765 si no estás exponiendo el servidor directamente.

  2. En ChatGPT, abre Settings → Features → Custom MCP Connectors y haz clic en Add. Rellena:

    • Name: Intervals.icu

    • MCP Server URL: https://<tu-host-publico>/sse

    • Authentication: déjalo como No authentication a menos que hayas protegido tu túnel.

    Puedes reutilizar la misma URL del túnel ngrok http 8765 aquí; solo asegúrate de que redirija al host/puerto que exportaste arriba.

  3. Guarda el conector y abre un nuevo chat. ChatGPT mantendrá la conexión SSE abierta y enviará solicitudes POST al punto final /messages/ anunciado por el servidor. Si reinicias el servidor MCP o el túnel, vuelve a ejecutar el comando SSE y actualiza la URL del conector si cambia.

Desarrollo y pruebas

Instala las dependencias de desarrollo y ejecuta el conjunto de pruebas con:

uv sync --all-extras
pytest -v tests

Ejecutar el servidor localmente

Para iniciar el servidor manualmente (útil al desarrollar o probar), ejecuta:

mcp run src/intervals_mcp_server/server.py

Habilitar el registro de depuración

Para capturar los registros del servidor para la depuración, envuelve el comando en un shell y redirige stderr a un archivo.

macOS/Linux — modifica tu claude_desktop_config.json así:

{
  "mcpServers": {
    "Intervals.icu": {
      "command": "/bin/bash",
      "args": [
        "-c",
        "/Users/<USERNAME>/.local/bin/uv run --with 'mcp[cli]' --with-editable /path/to/intervals-mcp-server mcp run /path/to/intervals-mcp-server/src/intervals_mcp_server/server.py 2>> /path/to/intervals-mcp-server/mcp-server.log"
      ],
      "env": {
        "INTERVALS_API_BASE_URL": "https://intervals.icu/api/v1",
        "ATHLETE_ID": "<YOUR_ATHLETE_ID>",
        "API_KEY": "<YOUR_API_KEY>",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

Luego sigue el archivo de registro para ver la salida en tiempo real:

tail -f /path/to/intervals-mcp-server/mcp-server.log

Windows — modifica tu claude_desktop_config.json así:

{
  "mcpServers": {
    "Intervals.icu": {
      "command": "powershell",
      "args": [
        "-Command",
        "C:\\Users\\<USERNAME>\\.local\\bin\\uv.exe run --with 'mcp[cli]' --with-editable C:\\path\\to\\intervals-mcp-server mcp run C:\\path\\to\\intervals-mcp-server\\src\\intervals_mcp_server\\server.py 2>> C:\\path\\to\\intervals-mcp-server\\mcp-server.log"
      ],
      "env": {
        "INTERVALS_API_BASE_URL": "https://intervals.icu/api/v1",
        "ATHLETE_ID": "<YOUR_ATHLETE_ID>",
        "API_KEY": "<YOUR_API_KEY>",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

Luego monitorea el archivo de registro en tiempo real usando PowerShell:

Get-Content C:\path\to\intervals-mcp-server\mcp-server.log -Wait

Licencia

La Licencia Pública General de GNU v3.0

Destacado

Glama.ai

Available Tools

10 tools
add_or_update_eventB

Post event for an athlete to Intervals.icu this follows the event api from intervals.icu If event_id is provided, the event will be updated instead of created.

Many arguments are required as this MCP tool function maps directly to the Intervals.icu API parameters.

Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) event_id: The Intervals.icu event ID (optional, will use event_id from .env if not provided) start_date: Start date in YYYY-MM-DD format (optional, defaults to today) name: Name of the activity workout_doc: steps as a list of Step objects (optional, but necessary to define workout steps) workout_type: Workout type (e.g. Ride, Run, Swim, Walk, Row) moving_time: Total expected moving time of the workout in seconds (optional) distance: Total expected distance of the workout in meters (optional)

Example: "workout_doc": { "description": "High-intensity workout for increasing VO2 max", "steps": [ {"power": {"value": "80", "units": "%ftp"}, "duration": "900", "warmup": true}, {"reps": 2, "text": "High-intensity intervals", "steps": [ {"power": {"value": "110", "units": "%ftp"}, "distance": "500", "text": "High-intensity"}, {"power": {"value": "80", "units": "%ftp"}, "duration": "90", "text": "Recovery"} ]}, {"power": {"value": "80", "units": "%ftp"}, "duration": "600", "cooldown": true} {"text": ""}, # Add comments or blank lines for readability ] }

Step properties: distance: Distance of step in meters {"distance": "5000"} duration: Duration of step in seconds {"duration": "1800"} power/hr/pace/cadence: Define step intensity Percentage of FTP: {"power": {"value": "80", "units": "%ftp"}} Absolute power: {"power": {"value": "200", "units": "w"}} Heart rate: {"hr": {"value": "75", "units": "%hr"}} Heart rate (LTHR): {"hr": {"value": "85", "units": "%lthr"}} Cadence: {"cadence": {"value": "90", "units": "rpm"}} Pace by ftp: {"pace": {"value": "80", "units": "%pace"}} Pace by zone: {"pace": {"value": "Z2", "units": "pace_zone"}} Zone by power: {"power": {"value": "Z2", "units": "power_zone"}} Zone by heart rate: {"hr": {"value": "Z2", "units": "hr_zone"}} Ranges: Specify ranges for power, heart rate, or cadence: {"power": {"start": "80", "end": "90", "units": "%ftp"}} Ramps: Instead of a range, indicate a gradual change in intensity (useful for ERG workouts): {"ramp": True, "power": {"start": "80", "end": "90", "units": "%ftp"}} Repeats: include the reps property and add nested steps {"reps": 3, "steps": [ {"power": {"value": "110", "units": "%ftp"}, "distance": "500", "text": "High-intensity"}, {"power": {"value": "80", "units": "%ftp"}, "duration": "90", "text": "Recovery"} ]} Free Ride: Include free to indicate a segment without ERG control, optionally with a suggested power range: {"free": true, "power": {"value": "80", "units": "%ftp"}} Comments and Labels: Add descriptive text to label steps: {"text": "Warmup"}

How to use steps: - Set distance or duration as appropriate for step - Use "reps" with nested steps to define repeat intervals (as in example above) - Define one of "power", "hr" or "pace" to define step intensity

Inputs: workout_type (required), name (required), athlete_id, api_key, +5 more. Returns: result

delete_eventB

Delete event for an athlete from Intervals.icu Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) event_id: The Intervals.icu event ID

Inputs: event_id (required), athlete_id, api_key. Returns: result

delete_events_by_date_rangeA

Delete events for an athlete from Intervals.icu in the specified date range.

Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format

Inputs: start_date (required), end_date (required), athlete_id, api_key. Returns: result

get_activitiesA

Get a list of activities for an athlete from Intervals.icu

Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) start_date: Start date in YYYY-MM-DD format (optional, defaults to 30 days ago) end_date: End date in YYYY-MM-DD format (optional, defaults to today) limit: Maximum number of activities to return (optional, defaults to 10) include_unnamed: Whether to include unnamed activities (optional, defaults to False)

Inputs: athlete_id, api_key, start_date, end_date, +2 more. Returns: result

get_activity_detailsA

Get detailed information for a specific activity from Intervals.icu

Args: activity_id: The Intervals.icu activity ID api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided)

Inputs: activity_id (required), api_key. Returns: result

get_activity_intervalsA

Get interval data for a specific activity from Intervals.icu

This endpoint returns detailed metrics for each interval in an activity, including power, heart rate, cadence, speed, and environmental data. It also includes grouped intervals if applicable.

Args: activity_id: The Intervals.icu activity ID api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided)

Inputs: activity_id (required), api_key. Returns: result

get_activity_streamsA

Get stream data for a specific activity from Intervals.icu

This endpoint returns time-series data for an activity, including metrics like power, heart rate, cadence, altitude, distance, temperature, and velocity data.

Args: activity_id: The Intervals.icu activity ID api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) stream_types: Comma-separated list of stream types to retrieve (optional, defaults to all available types) Available types: time, watts, heartrate, cadence, altitude, distance, core_temperature, skin_temperature, velocity_smooth

Inputs: activity_id (required), api_key, stream_types. Returns: result

get_event_by_idB

Get detailed information for a specific event from Intervals.icu

Args: event_id: The Intervals.icu event ID athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided)

Inputs: event_id (required), athlete_id, api_key. Returns: result

get_eventsA

Get events for an athlete from Intervals.icu

Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) start_date: Start date in YYYY-MM-DD format (optional, defaults to today) end_date: End date in YYYY-MM-DD format (optional, defaults to 30 days from today)

Inputs: athlete_id, api_key, start_date, end_date. Returns: result

get_wellness_dataB

Get wellness data for an athlete from Intervals.icu

Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) start_date: Start date in YYYY-MM-DD format (optional, defaults to 30 days ago) end_date: End date in YYYY-MM-DD format (optional, defaults to today)

Inputs: athlete_id, api_key, start_date, end_date. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: add_or_update_event creates/updates events, delete_event and delete_events_by_date_range handle deletion, get_activities and get_events retrieve lists, get_event_by_id and get_activity_details fetch specific items, get_activity_intervals and get_activity_streams provide specialized data, and get_wellness_data covers a separate domain. The descriptions clearly differentiate between events and activities, and between summary and detailed data.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case: add_or_update_event, delete_event, delete_events_by_date_range, get_activities, get_activity_details, get_activity_intervals, get_activity_streams, get_event_by_id, get_events, get_wellness_data. The verbs (add_or_update, delete, get) are used predictably, and nouns (event, activity, wellness_data) are clearly specified, making the naming highly consistent and readable.

    Tool Count5/5

    With 10 tools, this server is well-scoped for managing athlete data in Intervals.icu, covering events, activities, and wellness data. Each tool serves a specific function (e.g., CRUD for events, detailed queries for activities), and none seem redundant or missing for the domain. This count aligns with typical server sizes (3-15 tools) and supports comprehensive workflows without being overwhelming.

    Completeness4/5

    The tool set provides strong coverage for the Intervals.icu domain, including CRUD for events (add/update, delete, get), detailed activity retrieval (list, details, intervals, streams), and wellness data. Minor gaps exist, such as no update or delete tools for activities (only get operations) and no tools for athlete management (e.g., list athletes), but agents can likely work around these with the available event and data tools.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers