hevy-mcp

hevy-mcp

Exposes the Hevy workout API to Claude, enabling users to manage workouts, routines, exercise templates, body measurements, and user info via natural language.

Category
访问服务器

README

Hevy MCP Server

A single-user remote MCP server that exposes the Hevy workout API to Claude (and any OAuth-capable MCP client). It speaks the full MCP protocol over Streamable HTTP at /mcp and is protected by a minimal, stateless OAuth 2.1 flow, so it can be added as a custom connector in the Claude app — including on mobile, on the go.

  • Runtime: Bun or Cloudflare Workers — the same code runs on both, via Hono + @hono/mcp.
  • Auth: single-user OAuth 2.1 (PKCE S256), all state held in signed JWTs — no database.
  • Hevy: a single api-key from an environment variable / secret.

Why OAuth (and not just a token)?

As of 2026 the Claude app's custom-connector UI only accepts OAuth — it does not let you paste a static bearer token or custom header. So this server implements a tiny single-user OAuth provider: when you connect, Claude sends you to a login page where you enter MCP_PASSWORD; on success it receives an access token (a signed JWT) that it then presents to /mcp. Nothing is persisted — the password gates the flow and PKCE + JWT signatures secure it. Because the server supports Dynamic Client Registration, you do not need to fill in any Client ID / Client Secret in Claude — just the server URL.

Prerequisites

  • A Hevy account with API access — the developer API key lives in the Hevy app under Settings → Developer and requires a Hevy Pro subscription.
  • For local development / Bun deploys: Bun ≥ 1.1 (curl -fsSL https://bun.sh/install | bash).
  • For Cloudflare deploys: a Cloudflare account and Node.js ≥ 22 (Wrangler requires it). Bun is not needed on Workers.
  • A public HTTPS URL to deploy to (Coolify/Docker host or Cloudflare). The Claude app connector requires HTTPS — localhost works only for local testing with the MCP Inspector.

Tools

All ~22 Hevy endpoints, read + write:

  • Workouts: list_workouts, get_workout, get_workout_count, get_workout_events, create_workout, update_workout
  • Routines: list_routines, get_routine, create_routine, update_routine
  • Routine folders: list_routine_folders, get_routine_folder, create_routine_folder
  • Exercise templates: list_exercise_templates, get_exercise_template, create_exercise_template
  • Exercise history: get_exercise_history
  • Body measurements: list_body_measurements, get_body_measurement, create_body_measurement, update_body_measurement
  • User: get_user_info

Configuration

Variable Description
HEVY_API_KEY Your Hevy API key (Hevy app → Settings → Developer; requires Hevy Pro).
MCP_PASSWORD The password you type on the OAuth login page when connecting Claude.
JWT_SECRET Random ≥32-char secret for signing JWTs. Generate with openssl rand -hex 32.
PUBLIC_URL Public HTTPS base URL (no trailing slash). Must match the deployed domain.
PORT Port to listen on (default 3000). Ignored on Cloudflare Workers.

Run locally (Bun)

bun install
cp .env.example .env     # then edit values
bun run dev              # or: bun run start

Then point an MCP client at http://localhost:3000/mcp, e.g. the inspector:

npx @modelcontextprotocol/inspector

It discovers the OAuth metadata, opens the login page (enter MCP_PASSWORD), and then lets you list and call tools.

Deploy: Docker (Coolify or any host)

The included Dockerfile runs on oven/bun and has a built-in /health healthcheck.

Generic Docker:

docker build -t hevy-mcp .
docker run -p 3000:3000 \
  -e HEVY_API_KEY=... \
  -e MCP_PASSWORD=... \
  -e JWT_SECRET="$(openssl rand -hex 32)" \
  -e PUBLIC_URL=https://hevy-mcp.example.com \
  hevy-mcp

Put it behind a reverse proxy (Caddy/nginx/Traefik) that terminates TLS, and set PUBLIC_URL to the public HTTPS address.

Coolify:

  1. Create a new resource from this repo (Dockerfile build). Exposed port: 3000.
  2. Set the environment variables above. Set PUBLIC_URL to the domain Coolify assigns after it's assigned (Traefik provisions TLS automatically) — it must match exactly.
  3. Health check path: /health.
  4. Deploy.

Deploy: Cloudflare Workers

The same entry point runs on Workers (env comes from the request binding, not process.env; nodejs_compat is enabled in wrangler.jsonc).

  1. Install deps and log in (needs Node.js ≥ 22):

    bun install            # or: npm install
    npx wrangler login
    
  2. Set PUBLIC_URL in wrangler.jsonc to your Worker's URL. Deploy once to discover it (e.g. https://hevy-mcp.<your-subdomain>.workers.dev), or use a custom domain / route, then update PUBLIC_URL to match and redeploy.

  3. Add the three secrets:

    npx wrangler secret put HEVY_API_KEY
    npx wrangler secret put MCP_PASSWORD
    npx wrangler secret put JWT_SECRET     # e.g. paste `openssl rand -hex 32`
    
  4. Deploy:

    bun run cf:deploy      # = wrangler deploy
    

    Local dev against the real Workers runtime: copy .dev.vars.example to .dev.vars, set PUBLIC_URL=http://localhost:8787 there, then bun run cf:dev.

Connect from Claude

In the Claude app, add a custom connector pointing at https://<your-domain>/mcp. Leave Client ID / Client Secret blank. Complete the OAuth prompt by entering MCP_PASSWORD, and the Hevy tools become available.

Security notes

This repo is safe to keep public: no secrets live in it. Access is guarded entirely by two values you set as env vars / secrets — use a strong MCP_PASSWORD and keep JWT_SECRET private (rotating JWT_SECRET invalidates existing tokens and forces re-authentication).

Implementation notes

  • The server runs statelessly — a fresh MCP server + transport per request — which is simplest and robust for a single user. It does not advertise a server→client SSE stream (GET /mcp); tool calls are request/response.
  • Authorization codes are short-lived (5 min) signed JWTs and are not single-use within that window — an acceptable trade-off for a private, single-user server with no datastore.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选