Hevy连接器添加福利群:解决AI开发者的「MCP实战痛点」这是一个 Model Context Protocol (MCP) 服务器实现,它与 Hevy 健身跟踪应用及其 API接口。此服务器使 AI 助手能够通过 Hevy API(需要 PRO 订阅)访问和管理锻炼数据、训练计划、练习模板等。
要通过 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

要将此 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 工具:
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 进行代码格式化和检查:
npm run check
API 客户端是使用 Kiota 从 OpenAPI 规范生成的:
npm run export-specs npm run build:client
该项目根据 MIT 许可证发布 - 详情请参阅 LICENSE 文件。
欢迎贡献!请随时提交 Pull Request。