Skip to main content
Glama

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

许可证:MIT 铁匠徽章

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

特征

  • 锻炼管理:获取、创建和更新锻炼

  • 日常管理:访问和管理锻炼计划

  • 练习模板:浏览可用的练习模板

  • 文件夹组织:管理常规文件夹

Related MCP server: AgentMode

先决条件

  • 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 请求。

致谢

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chrisdoc/hevy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server