hevy-mcp 1.10.16 → 1.11.10
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/README.md +24 -20
- package/dist/index.js +398 -377
- package/dist/index.js.map +1 -1
- package/package.json +39 -34
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ A Model Context Protocol (MCP) server implementation that interfaces with the [H
|
|
|
16
16
|
## Prerequisites
|
|
17
17
|
|
|
18
18
|
- Node.js (v20 or higher)
|
|
19
|
-
-
|
|
19
|
+
- pnpm (via Corepack)
|
|
20
20
|
- A Hevy API key
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
@@ -36,7 +36,8 @@ git clone https://github.com/chrisdoc/hevy-mcp.git
|
|
|
36
36
|
cd hevy-mcp
|
|
37
37
|
|
|
38
38
|
# Install dependencies
|
|
39
|
-
|
|
39
|
+
corepack use pnpm@10.22.0
|
|
40
|
+
pnpm install
|
|
40
41
|
|
|
41
42
|
# Create .env file from sample
|
|
42
43
|
cp .env.sample .env
|
|
@@ -67,7 +68,7 @@ Make sure to replace `your-api-key-here` with your actual Hevy API key.
|
|
|
67
68
|
You can supply your Hevy API key in two ways:
|
|
68
69
|
|
|
69
70
|
1. Environment variable (`HEVY_API_KEY`)
|
|
70
|
-
2. Command-line argument (`--hevy-api-key=your_key` or `hevy-api-key=your_key` after `--` when using
|
|
71
|
+
2. Command-line argument (`--hevy-api-key=your_key` or `hevy-api-key=your_key` after `--` when using pnpm scripts)
|
|
71
72
|
|
|
72
73
|
Create a `.env` file in the project root (you can copy from [.env.sample](.env.sample)) with the following content if using the environment variable approach:
|
|
73
74
|
|
|
@@ -78,13 +79,13 @@ HEVY_API_KEY=your_hevy_api_key_here
|
|
|
78
79
|
Replace `your_hevy_api_key_here` with your actual Hevy API key. If you prefer the command argument approach you can skip setting the environment variable and start the server with for example:
|
|
79
80
|
|
|
80
81
|
```bash
|
|
81
|
-
|
|
82
|
+
pnpm start -- --hevy-api-key=your_hevy_api_key_here
|
|
82
83
|
```
|
|
83
84
|
|
|
84
85
|
Or in HTTP mode:
|
|
85
86
|
|
|
86
87
|
```bash
|
|
87
|
-
|
|
88
|
+
pnpm start -- --http --hevy-api-key=your_hevy_api_key_here
|
|
88
89
|
```
|
|
89
90
|
|
|
90
91
|
## Transport Modes
|
|
@@ -96,7 +97,7 @@ The MCP server supports two transport modes:
|
|
|
96
97
|
The default mode uses stdio transport, which is suitable for integration with MCP clients like Claude Desktop and Cursor:
|
|
97
98
|
|
|
98
99
|
```bash
|
|
99
|
-
|
|
100
|
+
pnpm start
|
|
100
101
|
# or
|
|
101
102
|
node dist/index.js
|
|
102
103
|
```
|
|
@@ -104,17 +105,16 @@ node dist/index.js
|
|
|
104
105
|
### HTTP Transport
|
|
105
106
|
|
|
106
107
|
The server can also run in HTTP mode for remote access or web-based integrations:
|
|
107
|
-
|
|
108
108
|
```bash
|
|
109
109
|
# Start in HTTP mode (env var)
|
|
110
|
-
|
|
110
|
+
pnpm start -- --http
|
|
111
111
|
# Start in HTTP mode (CLI arg)
|
|
112
|
-
|
|
112
|
+
pnpm start -- --http --hevy-api-key=your_hevy_api_key_here
|
|
113
113
|
# Or using node directly
|
|
114
114
|
node dist/index.js --http --hevy-api-key=your_hevy_api_key_here
|
|
115
115
|
|
|
116
116
|
# Using environment variable
|
|
117
|
-
MCP_TRANSPORT=http
|
|
117
|
+
MCP_TRANSPORT=http pnpm start
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
#### HTTP Configuration
|
|
@@ -152,7 +152,7 @@ The HTTP transport includes session management for stateful connections. Each cl
|
|
|
152
152
|
### Development
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
|
-
|
|
155
|
+
pnpm run dev
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
This starts the MCP server in development mode with hot reloading.
|
|
@@ -160,8 +160,8 @@ This starts the MCP server in development mode with hot reloading.
|
|
|
160
160
|
### Production
|
|
161
161
|
|
|
162
162
|
```bash
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
pnpm run build
|
|
164
|
+
pnpm start
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
### Docker
|
|
@@ -298,7 +298,7 @@ hevy-mcp/
|
|
|
298
298
|
This project uses Biome for code formatting and linting:
|
|
299
299
|
|
|
300
300
|
```bash
|
|
301
|
-
|
|
301
|
+
pnpm run check
|
|
302
302
|
```
|
|
303
303
|
|
|
304
304
|
### Testing
|
|
@@ -308,7 +308,7 @@ npm run check
|
|
|
308
308
|
To run all tests (unit and integration), use:
|
|
309
309
|
|
|
310
310
|
```bash
|
|
311
|
-
|
|
311
|
+
pnpm test
|
|
312
312
|
```
|
|
313
313
|
|
|
314
314
|
> **Note:** If the `HEVY_API_KEY` environment variable is set, integration tests will also run. If not, only unit tests will run.
|
|
@@ -318,13 +318,13 @@ npm test
|
|
|
318
318
|
To run only unit tests (excluding integration tests):
|
|
319
319
|
|
|
320
320
|
```bash
|
|
321
|
-
|
|
321
|
+
pnpm vitest run --exclude tests/integration/**
|
|
322
322
|
```
|
|
323
323
|
|
|
324
324
|
Or with coverage:
|
|
325
325
|
|
|
326
326
|
```bash
|
|
327
|
-
|
|
327
|
+
pnpm vitest run --coverage --exclude tests/integration/**
|
|
328
328
|
```
|
|
329
329
|
|
|
330
330
|
#### Run Only Integration Tests
|
|
@@ -332,7 +332,7 @@ npx vitest run --coverage --exclude tests/integration/**
|
|
|
332
332
|
To run only the integration tests (requires a valid `HEVY_API_KEY`):
|
|
333
333
|
|
|
334
334
|
```bash
|
|
335
|
-
|
|
335
|
+
pnpm vitest run tests/integration
|
|
336
336
|
```
|
|
337
337
|
|
|
338
338
|
**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.
|
|
@@ -359,12 +359,16 @@ If the secret is not set, the integration tests step will be skipped with a mess
|
|
|
359
359
|
The API client is generated from the OpenAPI specification using [Kubb](https://kubb.dev/):
|
|
360
360
|
|
|
361
361
|
```bash
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
pnpm run export-specs
|
|
363
|
+
pnpm run build:client
|
|
364
364
|
```
|
|
365
365
|
|
|
366
366
|
Kubb generates TypeScript types, API clients, Zod schemas, and mock data from the OpenAPI specification.
|
|
367
367
|
|
|
368
|
+
### Troubleshooting
|
|
369
|
+
|
|
370
|
+
- **Rollup optional dependency missing**: If you see an error similar to `Cannot find module @rollup/rollup-linux-x64-gnu`, set the environment variable `ROLLUP_SKIP_NODEJS_NATIVE_BUILD=true` before running `pnpm run build`. This forces Rollup to use the pure JavaScript fallback and avoids the npm optional dependency bug on some Linux runners.
|
|
371
|
+
|
|
368
372
|
## License
|
|
369
373
|
|
|
370
374
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|