Skip to main content
Glama

hevy-mcp

Подключите Claude к своему журналу тренировок Hevy.

hevy-mcp — это сервер протокола контекста модели (MCP), который позволяет Claude (в приложении для рабочего стола или на сайте claude.ai) просматривать ваши тренировки, составлять новые программы, сохранять их в библиотеку Hevy и анализировать тенденции ваших тренировок — это тот же уровень доступа, который получают пользователи ChatGPT через официальную интеграцию Hevy.

CI PyPI Python License: MIT

You: "Build me a 4-day upper/lower hypertrophy split focused on the muscle groups
      I've trained least over the last 30 days, and save it in a folder called
      'Hypertrophy Block 1'."

Claude: ✓ checked your last 30 days of training (lats and rear delts are behind)
        ✓ created folder "Hypertrophy Block 1"
        ✓ resolved 22 exercises against Hevy's library
        ✓ saved 4 routines: Upper A, Lower A, Upper B, Lower B
        Open the Hevy app to start any of them.

Что можно попросить сделать Claude

  • Оглянуться назад — «Покажи мои последние 10 тренировок и скажи, какие группы мышц я обделял вниманием».

  • Планировать вперед — «Основываясь на моей истории жима лежа, какой рабочий вес будет оптимальным на завтра?»

  • Составлять программы — «Составь мне 4-дневный сплит на гипертрофию (верх/низ) и сохрани его».

  • Редактировать программы — «В программе 'День жима А' замени жим гантелей на жим штанги стоя, 4 подхода по 5 повторений».

  • Анализировать — «Оцени мой одноповторный максимум (1ПМ) в основных упражнениях и построй график прогресса в приседаниях за последние 90 дней».


Related MCP server: hevy-mcp

Требования

  • Подписка Hevy PRO (требуется для API разработчика).

  • Ваш API-ключ Hevy — получите его на странице https://hevy.com/settings?developer.

  • Python 3.11+ или Docker.

  • Claude Desktop или рабочее пространство claude.ai, поддерживающее пользовательские коннекторы.


Быстрый старт — Claude Desktop (5 минут)

1. Установка

# Easiest, with uv (https://docs.astral.sh/uv/):
uv tool install hevy-mcp

# Or with pipx:
pipx install hevy-mcp

# Or with plain pip:
python -m pip install hevy-mcp

2. Добавление в Claude Desktop

Откройте файл конфигурации Claude Desktop:

  • macOS — ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows — %APPDATA%\Claude\claude_desktop_config.json

  • Linux — ~/.config/Claude/claude_desktop_config.json

Добавьте запись hevy в раздел mcpServers (создайте файл, если он не существует):

{
  "mcpServers": {
    "hevy": {
      "command": "hevy-mcp",
      "env": {
        "HEVY_API_KEY": "sk_live_paste_your_key_here"
      }
    }
  }
}

Если hevy-mcp отсутствует в вашем PATH (иногда инструменты, установленные через uv, не подхватываются лаунчером Claude Desktop), используйте абсолютный путь, который можно узнать командой which hevy-mcp — например, /Users/you/.local/bin/hevy-mcp.

3. Перезапуск Claude Desktop

Полностью закройте приложение (⌘Q на macOS) и откройте снова. Вы должны увидеть индикатор инструментов, показывающий, что сервер hevy подключен.

4. Попробуйте

«Используй инструмент hevy, чтобы получить мои последние 3 тренировки и сделать их краткий обзор».

Если Claude покажет ваши реальные тренировки, значит, всё готово. 🎉


Альтернатива — claude.ai (удаленный коннектор)

Если вы используете claude.ai в браузере вместо Claude Desktop, запустите hevy-mcp как HTTP-сервис и добавьте его в качестве пользовательского коннектора.

1. Запустите сервер там, где есть HTTPS

Самый простой путь — Docker на Fly.io / Render / Railway:

docker build -t hevy-mcp .
docker run --rm -p 8000:8000 -e HEVY_API_KEY=sk_live_... hevy-mcp

Или напрямую через CLI:

hevy-mcp --http --host 0.0.0.0 --port 8000

Эндпоинт MCP находится по адресу /mcp.

2. Добавьте его как пользовательский коннектор

В claude.ai перейдите в Settings → Connectors → Add custom connector и используйте ваш публичный HTTPS URL, заканчивающийся на /mcp (например, https://hevy-mcp.fly.dev/mcp).

Примечание для нескольких пользователей

Если один и тот же деплой будут использовать несколько человек, не вшивайте HEVY_API_KEY в переменные окружения контейнера — вместо этого передавайте его в заголовке каждого запроса. Сервер считывает X-Hevy-Api-Key, если он присутствует, и использует его вместо переменной окружения. Обычно для этого перед сервером ставится небольшой обратный прокси-сервер (Cloudflare Worker, Nginx), внедряющий аутентификацию.


Что он умеет (полный список инструментов)

Группа

Инструмент

Что делает

Тренировки

list_workouts

Постраничный просмотр истории тренировок, начиная с новых.

get_workout

Полная информация об одной тренировке — каждый подход, повторение, вес, RPE, заметки.

get_workout_count

Общее количество записанных тренировок.

get_workout_events

Поток событий создания/обновления/удаления с указанной метки времени.

create_workout

Запись завершенной тренировки.

update_workout

Редактирование уже записанной тренировки.

Программы

list_routines, get_routine

Чтение ваших сохраненных программ.

create_routine

Сохранение новой программы (с защитой от дублирования названий).

update_routine

Изменение существующей программы.

Папки

list_routine_folders, get_routine_folder, create_routine_folder

Организация программ по папкам.

Библиотека упражнений

search_exercise_templates

Нечеткий поиск по библиотеке Hevy (~400 упражнений) по названию, оборудованию или мышцам.

list_exercise_templates, get_exercise_template

Просмотр/поиск упражнений.

Вебхуки

create_webhook_subscription, get_webhook_subscription, delete_webhook_subscription

Одна подписка на ключ (ограничение Hevy).

Аналитика

estimate_one_rep_max

Расчет 1ПМ по формулам Эпли/Бржицки на основе ваших лучших рабочих подходов.

volume_by_muscle_group

Тоннаж на группу мышц за определенный период.

progression_trend

Временной ряд 1ПМ для одного упражнения с недельным наклоном тренда.

Технические особенности:

  • Умное кэширование — библиотека упражнений загружается один раз и кэшируется на 24 часа; нечеткий поиск выполняется в оперативной памяти.

  • Учет ограничений частоты запросов — делает паузу при получении 429 ошибки и учитывает Retry-After.

  • Идемпотентная запись — при создании программы с дублирующимся названием в той же папке Claude попросит подтверждение перед созданием копии.

  • Ошибки, понятные для LLM — каждая ошибка возвращается в формате { error, hint }. Подсказка (hint) предлагает следующий конкретный вызов инструмента.

  • Никогда не логирует ваш API-ключ.


Устранение неполадок

Самая частая причина: command в claude_desktop_config.json отсутствует в PATH лаунчера. Замените "command": "hevy-mcp" на абсолютный путь, полученный через which hevy-mcp (или where hevy-mcp в Windows). Перезапустите Claude Desktop.

  • Проверьте, что вы вставили ключ в блок env (а не в блок args).

  • Убедитесь, что ваша подписка Hevy PRO активна.

  • Обновите ключ на странице https://hevy.com/settings?developer и попробуйте снова.

search_exercise_templates использует нечеткий поиск, но это не магия. Если Claude выбирает не то упражнение, попросите его «поискать снова с более точным названием» или передайте фильтр equipment (например, «штанга»).

Библиотека упражнений загружается при первом поиске (единоразово, ~200 мс). Все последующие вызовы используют кэш в памяти. Кэш живет 24 часа.


Разработка

git clone https://github.com/Vellarasan/hevy-mcp.git
cd hevy-mcp
uv sync --extra dev          # creates .venv and installs deps
pytest -q                    # offline tests (no real API needed)

# Run against your real Hevy account:
HEVY_API_KEY=sk_live_... python smoke_test.py

# Stdio (Claude Desktop):
hevy-mcp

# HTTP (claude.ai):
hevy-mcp --http --port 8000

Более подробную информацию см. в CONTRIBUTING.md.

Структура проекта

hevy-mcp/
├── src/hevy_mcp/
│   ├── server.py        # transport bootstrap (stdio + streamable-http)
│   ├── hevy_client.py   # async httpx client w/ retries & error mapping
│   ├── schemas.py       # Pydantic models
│   ├── cache.py         # 24-hour TTL cache
│   ├── errors.py        # HevyApiError + tool_guard
│   ├── formatters.py    # JSON → readable text
│   └── tools/           # workouts, routines, folders, templates, webhooks, analytics
├── tests/
└── Dockerfile

Релизы

См. CHANGELOG.md. Релизы с тегами автоматически публикуются в PyPI.

Лицензия

MIT.

Благодарности

Дизайн этого проекта опирается на идеи двух предыдущих сообществ: chrisdoc/hevy-mcp (TypeScript) и SrdjanCodes/hevy-mcp (Python). Это не форк, но стоит взглянуть, если вам нужен другой язык или набор функций.

hevy-mcp — это проект сообщества, он не связан с Hevy и не поддерживается ими.

Available Tools

22 tools
create_routineA

Create a new routine.

Required routine shape: { title, folder_id?, notes?, exercises: [ { exercise_template_id, rest_seconds?, notes?, sets: [ { type, weight_kg?, reps?, rpe? } ] } ] }

WORKFLOW for natural-language requests:

  1. Resolve every exercise name to a template id with search_exercise_templates.

  2. (Optional) Create or look up the target folder with the folder tools.

  3. Call this tool. If a routine with the same title already exists in the folder you'll get back a duplicate_of payload — confirm with the user, then re-call with force=True (or call update_routine instead).

Inputs: routine (required), force. Returns: object

create_routine_folderA

Create a new routine folder. Returns the new folder including its id, which you can pass to create_routine as folder_id.

Inputs: title (required). Returns: object

create_webhook_subscriptionA

Create or replace the user's webhook subscription.

  • url: HTTPS endpoint Hevy will POST events to.

  • event_type: e.g. "workout_created". Hevy only accepts one subscription per key.

Inputs: url (required), event_type. Returns: object

create_workoutA

Log a completed workout to Hevy.

workout shape: { title, description?, start_time, end_time, is_private?, exercises: [ { exercise_template_id, notes?, superset_id?, sets: [ { type, weight_kg?, reps?, rpe?, distance_meters?, duration_seconds? } ] } ] }

Resolve exercise_template_id values via search_exercise_templates before calling this tool — never invent IDs.

Inputs: workout (required). Returns: object

delete_webhook_subscriptionA

Delete the active webhook subscription.

Inputs: no named parameters. Returns: object

estimate_one_rep_maxA

Estimate the user's 1RM on a given exercise from their recent top sets.

Walks the user's workouts (newest first), gathers every set of the target exercise, and applies a strength formula:

  • "epley": weight * (1 + reps/30)

  • "brzycki": weight * 36 / (37 - reps)

Returns the highest e1RM observed plus the contributing set, plus a short recent history. Skips warmups and reps>15 (formulas are unreliable past that).

Inputs: exercise_template_id (required), method, max_pages. Returns: object

get_exercise_templateA

Fetch a single exercise template by id (the Hevy library entry, not a logged set).

Inputs: template_id (required). Returns: object

get_routineB

Fetch a single routine with every exercise and target set.

Inputs: routine_id (required). Returns: object

get_routine_folderA

Fetch a single routine folder by id.

Inputs: folder_id (required). Returns: object

get_webhook_subscriptionA

Return the user's current webhook subscription, if any.

Inputs: no named parameters. Returns: object

get_workoutA

Fetch a single workout with every set, rep, weight, RPE, and note.

Use this when the user asks about a specific workout or wants to compare sets across sessions. Pair with list_workouts to discover the id first.

Inputs: workout_id (required). Returns: object

get_workout_countA

Total number of workouts the user has logged. Cheap; safe to call eagerly.

Inputs: no named parameters. Returns: object

get_workout_eventsA

Stream of workout change events (created/updated/deleted).

Use to detect new workouts since a previous interaction without re-paginating the full list. The since parameter is ISO-8601 (e.g. 2025-01-01T00:00:00Z).

Inputs: page, page_size, since. Returns: object

list_exercise_templatesA

Paginated browse of the Hevy exercise library (~400 entries). Cached for 24h.

Prefer search_exercise_templates when looking up a specific exercise — it's far faster than scanning pages.

Inputs: page, page_size. Returns: object

list_routine_foldersB

List the user's routine folders (e.g. 'Push/Pull/Legs', 'Hypertrophy Block').

Inputs: page, page_size. Returns: object

list_routinesB

List the user's saved routines (templates they follow). Paginated.

Inputs: page, page_size. Returns: object

list_workoutsA

List the user's workouts in reverse-chronological order.

Use this first when the user asks about "recent workouts", "last N sessions", "what did I train on Monday", etc. Each item is a summary; call get_workout(workout_id) for full set-by-set detail when the user asks about specific weights, RPE, or progression.

Inputs: page, page_size. Returns: object

progression_trendB

Top-set e1RM over time for a single exercise. Returns a per-session series suitable for charting.

Inputs: exercise_template_id (required), since, max_pages. Returns: object

search_exercise_templatesA

Fuzzy-search the Hevy exercise library. Use this before create_routine or create_workout — it returns the exercise_template_id you need.

  • query: free-text exercise name. e.g. "barbell back squat", "incline db press".

  • equipment: optional filter, e.g. "barbell", "dumbbell", "cable", "machine", "bodyweight".

  • muscle_group: optional filter on primary_muscle_group, e.g. "chest", "lats", "quads".

Returns ranked candidates with id, title, equipment, primary_muscle_group, and a match score 0-100. Pick the top hit unless the user disambiguates.

Inputs: query (required), equipment, muscle_group, limit. Returns: object

update_routineA

Update an existing routine in place.

Same payload shape as create_routine.routine, with one important caveat: Hevy's PUT endpoint does NOT accept folder_id, and there is no public API endpoint for moving a routine between folders. If folder_id is present in the payload it is silently stripped and a warning is included in the response. To 'move' a routine, create a new copy in the target folder and delete the old one in the Hevy app.

Inputs: routine_id (required), routine (required). Returns: object

update_workoutA

Replace the contents of an existing logged workout. Same payload shape as create_workout.

Inputs: workout_id (required), workout (required). Returns: object

volume_by_muscle_groupA

Aggregate working-set volume (kg lifted) by primary muscle group over a window.

Useful for "which muscle groups have I been neglecting?" prompts. Volume per set = weight_kg * reps; warmups excluded. Requires the template list to be loaded (it will be cached on first call).

Inputs: since, until, max_pages. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 22 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: routines, folders, workouts, webhooks, exercises, and analytics. No overlapping functionality; an agent can clearly distinguish between them.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., create_routine, list_workouts, get_exercise_template). No mixing of conventions or vague verbs.

    Tool Count4/5

    With 22 tools, the set is slightly larger than typical but well-justified for a fitness tracking API covering CRUD, webhooks, and analytical operations. It remains scoped and manageable.

    Completeness2/5

    Missing delete operations for routines and workouts, and no update/delete for routine folders. This creates dead ends where agents cannot fully manage resources, limiting practical workflow completion.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      A Model Context Protocol (MCP) server implementation that interfaces with the Hevy fitness tracking app and its API. This server enables AI assistants to access and manage workout data, routines, exercise templates, and more through the Hevy API (requires PRO subscription).
      23
      555
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Python MCP server for the Hevy fitness app. Gives Claude full access to your Hevy data. Log workouts, manage routines, track body measurements, browse exercises, and more. Covers all 25 endpoints of the official Hevy API.
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      A Model Context Protocol (MCP) server that provides AI assistants with access to the Hevy fitness tracking API. This allows you to log workouts, manage routines, browse exercises, and track your fitness progress directly through AI chat interfaces.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that connects Claude to the Hevy fitness app, enabling AI-driven personalized strength coaching by reading lifting history and programming workouts.
      MIT