hevy-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +140 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2107 -0
- package/dist/index.js.map +1 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Christoph Kieslich
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# hevy-mcp: Model Context Protocol Server for Hevy Fitness API
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
|
|
5
|
+
A Model Context Protocol (MCP) server implementation that interfaces with the [Hevy fitness tracking app](https://www.hevyapp.com/) and its [API](https://api.hevyapp.com/docs/). This server enables AI assistants to access and manage workout data, routines, exercise templates, and more through the Hevy API (requires PRO subscription).
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Workout Management**: Fetch, create, and update workouts
|
|
10
|
+
- **Routine Management**: Access and manage workout routines
|
|
11
|
+
- **Exercise Templates**: Browse available exercise templates
|
|
12
|
+
- **Folder Organization**: Manage routine folders
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- Node.js (v20 or higher)
|
|
17
|
+
- npm or yarn
|
|
18
|
+
- A Hevy API key
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Clone the repository
|
|
24
|
+
git clone https://github.com/chrisdoc/hevy-mcp.git
|
|
25
|
+
cd hevy-mcp
|
|
26
|
+
|
|
27
|
+
# Install dependencies
|
|
28
|
+
npm install
|
|
29
|
+
|
|
30
|
+
# Create .env file from sample
|
|
31
|
+
cp .env.sample .env
|
|
32
|
+
# Edit .env and add your Hevy API key
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
Create a `.env` file in the project root with the following content:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
API_KEY=your_hevy_api_key_here
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Replace `your_hevy_api_key_here` with your actual Hevy API key.
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Development
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm run dev
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This starts the MCP server in development mode with hot reloading.
|
|
54
|
+
|
|
55
|
+
### Production
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm run build
|
|
59
|
+
npm start
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Available MCP Tools
|
|
63
|
+
|
|
64
|
+
The server implements the following MCP tools:
|
|
65
|
+
|
|
66
|
+
### Workout Tools
|
|
67
|
+
- `get-workouts`: Fetch and format workout data
|
|
68
|
+
- `get-workout`: Get a single workout by ID
|
|
69
|
+
- `create-workout`: Create a new workout
|
|
70
|
+
- `update-workout`: Update an existing workout
|
|
71
|
+
- `get-workout-count`: Get the total count of workouts
|
|
72
|
+
- `get-workout-events`: Get workout update/delete events
|
|
73
|
+
|
|
74
|
+
### Routine Tools
|
|
75
|
+
- `get-routines`: Fetch and format routine data
|
|
76
|
+
- `create-routine`: Create a new routine
|
|
77
|
+
- `update-routine`: Update an existing routine
|
|
78
|
+
- `get-routine`: Get a single routine by ID
|
|
79
|
+
|
|
80
|
+
### Exercise Template Tools
|
|
81
|
+
- `get-exercise-templates`: Fetch exercise templates
|
|
82
|
+
- `get-exercise-template`: Get a template by ID
|
|
83
|
+
|
|
84
|
+
### Routine Folder Tools
|
|
85
|
+
- `get-routine-folders`: Fetch routine folders
|
|
86
|
+
- `create-routine-folder`: Create a new folder
|
|
87
|
+
- `get-routine-folder`: Get a folder by ID
|
|
88
|
+
|
|
89
|
+
## Project Structure
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
hevy-mcp/
|
|
93
|
+
├── .env # Environment variables (API keys)
|
|
94
|
+
├── src/
|
|
95
|
+
│ ├── index.ts # Main entry point
|
|
96
|
+
│ ├── tools/ # Directory for MCP tool implementations
|
|
97
|
+
│ │ ├── workouts.ts # Workout-related tools
|
|
98
|
+
│ │ ├── routines.ts # Routine-related tools
|
|
99
|
+
│ │ ├── templates.ts # Exercise template tools
|
|
100
|
+
│ │ └── folders.ts # Routine folder tools
|
|
101
|
+
│ ├── generated/ # API client (generated code)
|
|
102
|
+
│ │ ├── client/ # Kiota-generated client
|
|
103
|
+
│ └── utils/ # Helper utilities
|
|
104
|
+
│ ├── formatters.ts # Data formatting helpers
|
|
105
|
+
│ └── validators.ts # Input validation helpers
|
|
106
|
+
├── scripts/ # Build and utility scripts
|
|
107
|
+
└── tests/ # Test suite
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Development
|
|
111
|
+
|
|
112
|
+
### Code Style
|
|
113
|
+
|
|
114
|
+
This project uses Biome for code formatting and linting:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm run check
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Generating API Client
|
|
121
|
+
|
|
122
|
+
The API client is generated from the OpenAPI specification using Kiota:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm run export-specs
|
|
126
|
+
npm run build:client
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
This project is licensed under the ISC License - see the LICENSE file for details.
|
|
132
|
+
|
|
133
|
+
## Contributing
|
|
134
|
+
|
|
135
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
136
|
+
|
|
137
|
+
## Acknowledgements
|
|
138
|
+
|
|
139
|
+
- [Model Context Protocol](https://github.com/modelcontextprotocol) for the MCP SDK
|
|
140
|
+
- [Hevy](https://www.hevyapp.com/) for their fitness tracking platform and API
|
package/dist/index.d.ts
ADDED