- Explore MCP Servers
- hevy-mcp
Hevy Mcp
What is Hevy Mcp
hevy-mcp is a Model Context Protocol (MCP) server implementation that connects with the Hevy fitness tracking app and its API, allowing AI assistants to access and manage workout data, routines, and exercise templates.
Use cases
Use cases for hevy-mcp include developing AI assistants for personalized workout plans, managing fitness routines for users, and integrating fitness tracking capabilities into other applications.
How to use
To use hevy-mcp, you can install it via Smithery or manually by cloning the repository, installing dependencies, and configuring your Hevy API key in a .env file. Integration with Cursor requires updating the mcp.json configuration file.
Key features
Key features include workout management (fetching, creating, and updating workouts), routine management, browsing exercise templates, and organizing routine folders.
Where to use
hevy-mcp is primarily used in fitness and health applications, particularly those that require integration with the Hevy fitness tracking app for managing workout data.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Hevy Mcp
hevy-mcp is a Model Context Protocol (MCP) server implementation that connects with the Hevy fitness tracking app and its API, allowing AI assistants to access and manage workout data, routines, and exercise templates.
Use cases
Use cases for hevy-mcp include developing AI assistants for personalized workout plans, managing fitness routines for users, and integrating fitness tracking capabilities into other applications.
How to use
To use hevy-mcp, you can install it via Smithery or manually by cloning the repository, installing dependencies, and configuring your Hevy API key in a .env file. Integration with Cursor requires updating the mcp.json configuration file.
Key features
Key features include workout management (fetching, creating, and updating workouts), routine management, browsing exercise templates, and organizing routine folders.
Where to use
hevy-mcp is primarily used in fitness and health applications, particularly those that require integration with the Hevy fitness tracking app for managing workout data.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
hevy-mcp: Model Context Protocol Server for Hevy Fitness API
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).
Features
- Workout Management: Fetch, create, and update workouts
- Routine Management: Access and manage workout routines
- Exercise Templates: Browse available exercise templates
- Folder Organization: Manage routine folders
Prerequisites
- Node.js (v20 or higher)
- npm or yarn
- A Hevy API key
Installation
Installing via Smithery
To install hevy-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @chrisdoc/hevy-mcp --client claude
Manual Installation
# 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
Integration with Cursor
To use this MCP server with Cursor, you need to update your ~/.cursor/mcp.json file by adding the following configuration:
{
"hevy-mcp-server": {
"command": "npx",
"args": [
"-y",
"hevy-mcp"
],
"env": {
"HEVY_API_KEY": "your-api-key-here"
}
}
}
Make sure to replace your-api-key-here with your actual Hevy API key.
Configuration
Create a .env file in the project root (you can copy from .env.sample) with the following content:
HEVY_API_KEY=your_hevy_api_key_here
Replace your_hevy_api_key_here with your actual Hevy API key.
Usage
Development
npm run dev
This starts the MCP server in development mode with hot reloading.
Production
npm run build npm start
Available MCP Tools
The server implements the following MCP tools for interacting with the Hevy API:
Workout Tools
get-workouts: Fetch and format workout dataget-workout: Get a single workout by IDcreate-workout: Create a new workoutupdate-workout: Update an existing workoutget-workout-count: Get the total count of workoutsget-workout-events: Get workout update/delete events
Routine Tools
get-routines: Fetch and format routine datacreate-routine: Create a new routineupdate-routine: Update an existing routineget-routine: Get a single routine by ID
Exercise Template Tools
get-exercise-templates: Fetch exercise templatesget-exercise-template: Get a template by ID
Routine Folder Tools
get-routine-folders: Fetch routine folderscreate-routine-folder: Create a new folderget-routine-folder: Get a folder by ID
Project Structure
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/ # Kubb-generated client │ │ │ ├── api/ # API client methods │ │ │ ├── types/ # TypeScript types │ │ │ ├── schemas/ # Zod schemas │ │ │ └── mocks/ # Mock data │ └── utils/ # Helper utilities │ ├── formatters.ts # Data formatting helpers │ └── validators.ts # Input validation helpers ├── scripts/ # Build and utility scripts └── tests/ # Test suite ├── integration/ # Integration tests with real API │ └── hevy-mcp.integration.test.ts # MCP server integration tests
Development Guide
Code Style
This project uses Biome for code formatting and linting:
npm run check
Testing
Run All Tests
To run all tests (unit and integration), use:
npm test
Note: If the
HEVY_API_KEYenvironment variable is set, integration tests will also run. If not, only unit tests will run.
Run Only Unit Tests
To run only unit tests (excluding integration tests):
npx vitest run --exclude tests/integration/**
Or with coverage:
npx vitest run --coverage --exclude tests/integration/**
Run Only Integration Tests
To run only the integration tests (requires a valid HEVY_API_KEY):
npx vitest run tests/integration
Note: The integration tests will fail if the HEVY_API_KEY environment variable is not set. This is by design to ensure that the tests are always run with a valid API key.
GitHub Actions Configuration
For GitHub Actions:
- Unit tests will always run on every push and pull request
- Integration tests will only run if the
HEVY_API_KEYsecret is set in the repository settings
To set up the HEVY_API_KEY secret:
- Go to your GitHub repository
- Click on “Settings” > “Secrets and variables” > “Actions”
- Click on “New repository secret”
- Set the name to
HEVY_API_KEYand the value to your Hevy API key - Click “Add secret”
If the secret is not set, the integration tests step will be skipped with a message indicating that the API key is missing.
Generating API Client
The API client is generated from the OpenAPI specification using Kubb:
npm run export-specs npm run build:client
Kubb generates TypeScript types, API clients, Zod schemas, and mock data from the OpenAPI specification.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Acknowledgements
- Model Context Protocol for the MCP SDK
- Hevy for their fitness tracking platform and API
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.











