Hevy MCP

by chrisdoc
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Used for environment variable configuration to store the Hevy API key.

  • Utilized for code formatting and linting in the development process of the MCP server.

  • Used for version control of the MCP server codebase.

hevy-mcp:Hevy Fitness API 的模型上下文协议服务器

模型上下文协议 (MCP) 服务器实现,可与Hevy 健身追踪应用及其API交互。该服务器使 AI 助手能够通过 Hevy API(需要 PRO 订阅)访问和管理锻炼数据、例程、锻炼模板等。

特征

  • 锻炼管理:获取、创建和更新锻炼
  • 日常管理:访问和管理锻炼计划
  • 练习模板:浏览可用的练习模板
  • 文件夹组织:管理常规文件夹

先决条件

  • Node.js(v20 或更高版本)
  • npm 或 yarn
  • Hevy API 密钥

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 hevy-mcp:

npx -y @smithery/cli install @chrisdoc/hevy-mcp --client claude

手动安装

# Clone the repository git clone https://github.com/chrisdoc/hevy-mcp.git cd hevy-mcp # Install dependencies npm install # Create .env file from sample cp .env.sample .env # Edit .env and add your Hevy API key

与 Cursor 集成

要将此 MCP 服务器与 Cursor 一起使用,您需要通过添加以下配置来更新您的~/.cursor/mcp.json文件:

{ "hevy-mcp-server": { "command": "npx", "args": ["-y", "hevy-mcp"], "env": { "HEVY_API_KEY": "your-api-key-here" } } }

确保将your-api-key-here替换为您的实际 Hevy API 密钥。

配置

在项目根目录中创建一个.env文件,其内容如下:

HEVY_API_KEY=your_hevy_api_key_here

your_hevy_api_key_here替换为您的实际 Hevy API 密钥。

用法

发展

npm run dev

这将以开发模式启动 MCP 服务器并进行热重载。

生产

npm run build npm start

可用的 MCP 工具

该服务器实现了以下 MCP 工具:

健身工具

  • get-workouts :获取并格式化锻炼数据
  • get-workout :通过 ID 获取单次锻炼
  • create-workout :创建新的锻炼计划
  • update-workout :更新现有的锻炼
  • get-workout-count :获取锻炼总数
  • get-workout-events :获取锻炼更新/删除事件

常规工具

  • get-routines :获取并格式化例程数据
  • create-routine :创建一个新的例程
  • update-routine :更新现有例程
  • get-routine :通过 ID 获取单个例程

练习模板工具

  • get-exercise-templates :获取练习模板
  • get-exercise-template :通过 ID 获取模板

常规文件夹工具

  • get-routine-folders :获取例程文件夹
  • create-routine-folder :创建新文件夹
  • get-routine-folder :通过 ID 获取文件夹

项目结构

hevy-mcp/ ├── .env # Environment variables (API keys) ├── src/ │ ├── index.ts # Main entry point │ ├── tools/ # Directory for MCP tool implementations │ │ ├── workouts.ts # Workout-related tools │ │ ├── routines.ts # Routine-related tools │ │ ├── templates.ts # Exercise template tools │ │ └── folders.ts # Routine folder tools │ ├── generated/ # API client (generated code) │ │ ├── client/ # Kiota-generated client │ └── utils/ # Helper utilities │ ├── formatters.ts # Data formatting helpers │ └── validators.ts # Input validation helpers ├── scripts/ # Build and utility scripts └── tests/ # Test suite

发展

代码风格

该项目使用 Biome 进行代码格式化和 linting:

npm run check

生成 API 客户端

API 客户端是使用 Kiota 根据 OpenAPI 规范生成的:

npm run export-specs npm run build:client

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

致谢

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

一个模型上下文协议 (MCP) 服务器实现,可与 Hevy 健身追踪应用及其 API 交互。该服务器使 AI 助手能够通过 Hevy API(需要 PRO 订阅)访问和管理锻炼数据、例程、运动模板等。

  1. Features
    1. Prerequisites
      1. Installation
        1. Installing via Smithery
        2. Manual Installation
        3. Integration with Cursor
      2. Configuration
        1. Usage
          1. Development
          2. Production
        2. Available MCP Tools
          1. Workout Tools
          2. Routine Tools
          3. Exercise Template Tools
          4. Routine Folder Tools
        3. Project Structure
          1. Development
            1. Code Style
            2. Generating API Client
          2. License
            1. Contributing
              1. Acknowledgements
                ID: vl8qtbflvm