Skip to main content
Glama

hevy-mcp

ClaudeをHevyのワークアウトログに接続します。

hevy-mcpは、Model Context Protocolサーバーです。これを使用すると、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日間の上半身/下半身の筋肥大スプリットを作成して保存して。」

  • ルーチン編集 — 「『プッシュデイA』のダンベルショルダープレスを、バーベルオーバーヘッドプレス(5回×4セット)に変更して。」

  • 分析 — 「主要なリフトの1RMを推定し、過去90日間のスクワットの進捗をグラフ化して。」


Related MCP server: hevy-mcp

要件

  • Hevy PROサブスクリプション(開発者APIの利用に必要です)。

  • Hevy APIキー — 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

mcpServersの下にhevyエントリを追加します(ファイルが存在しない場合は作成してください):

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

hevy-mcpがPATH上にない場合(uv-toolのインストールがClaude Desktopランチャーで認識されないことがあります)、which hevy-mcpで取得できる絶対パスを使用してください(例: /Users/you/.local/bin/hevy-mcp)。

3. Claude Desktopの再起動

完全に終了(macOSでは⌘Q)してから再起動します。ツールインジケーターが表示され、hevyサーバーが接続されていることが確認できるはずです。

4. 試してみる

「hevyツールを使って、過去3回のワークアウトを取得して要約して。」

Claudeが実際のワークアウトを表示すれば完了です。🎉


代替手段 — claude.ai (リモートコネクタ)

Claude Desktopではなくブラウザでclaude.aiを使用している場合は、hevy-mcpをHTTPサービスとして実行し、カスタムコネクタとして追加します。

1. HTTPS環境でサーバーを実行する

最も簡単な方法は、Fly.io / Render / RailwayでDockerを使用することです:

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で、設定 → コネクタ → カスタムコネクタを追加に移動し、/mcpで終わるパブリックHTTPS URL(例: 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

エクササイズの閲覧/検索。

Webhook

create_webhook_subscription, get_webhook_subscription, delete_webhook_subscription

キーごとに1つのサブスクリプション(Hevyの制限)。

分析

estimate_one_rep_max

トップセットからのEpley/Brzycki式による1RM推定。

volume_by_muscle_group

指定期間内の筋肉グループごとの総負荷量。

progression_trend

単一リフトの1RM推移と週次傾斜。

内部構造:

  • スマートキャッシング — エクササイズライブラリは一度取得されると24時間キャッシュされ、あいまい検索はメモリ上で実行されます。

  • レート制限対応 — 429エラー時にバックオフし、Retry-Afterを尊重します。

  • べき等な書き込み — 同じフォルダ内に重複するタイトルのルーチンを作成する場合、Claudeに確認を求めます。

  • LLMフレンドリーなエラー — すべてのエラーは { error, hint } として返されます。ヒントには次の具体的なツール呼び出しが提案されます。

  • APIキーのログ記録なし — APIキーをログに記録することはありません。


トラブルシューティング

最も一般的な原因は、claude_desktop_config.jsonのcommandがランチャーのPATH上にないことです。"command": "hevy-mcp"をwhich hevy-mcp(Windowsの場合はwhere hevy-mcp)で取得した絶対パスに置き換えてください。その後、Claude Desktopを再起動してください。

  • キーがargsブロックではなくenvブロックに貼り付けられているか確認してください。

  • Hevy PROサブスクリプションが有効であることを確認してください。

  • https://hevy.com/settings?developer でキーを再生成して試してください。

search_exercise_templatesはあいまい検索ですが、完璧ではありません。Claudeが間違ったエクササイズを選択した場合は、「より具体的な名前で再検索して」と指示するか、equipmentフィルター(例: "barbell")を渡すようにしてください。

エクササイズライブラリは最初の検索時に取得されます(初回のみ約200ms)。それ以降の呼び出しはメモリ内のキャッシュにヒットします。キャッシュは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。

謝辞

このプロジェクトの設計は、コミュニティによる2つの先行実装 chrisdoc/hevy-mcp (TypeScript) と SrdjanCodes/hevy-mcp (Python) から着想を得ています。フォークではありませんが、異なる言語や機能セットが必要な場合は一見の価値があります。

hevy-mcpはコミュニティプロジェクトであり、Hevyとは提携しておらず、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