hevy-mcp 1.16.0 → 1.17.1
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 +2 -1
- package/dist/cli.js +76 -61
- package/dist/cli.js.map +1 -1
- package/dist/index.js +76 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,7 +130,8 @@ pnpm start -- --hevy-api-key=your_hevy_api_key_here
|
|
|
130
130
|
`hevy-mcp` ships with Sentry monitoring baked into the built MCP server so
|
|
131
131
|
that usage and errors from published builds can be observed.
|
|
132
132
|
|
|
133
|
-
The server initializes `@sentry/node` with a fixed DSN
|
|
133
|
+
The server initializes `@sentry/node` with a fixed DSN, release name derived
|
|
134
|
+
from the package version, and tracing settings
|
|
134
135
|
directly in the code (see `src/index.ts`), and wraps the underlying
|
|
135
136
|
`McpServer` with `Sentry.wrapMcpServerWithSentry` so requests and tool calls
|
|
136
137
|
are captured by Sentry automatically. The configuration uses
|
package/dist/cli.js
CHANGED
|
@@ -9,10 +9,6 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
9
9
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
10
|
import { z as z6 } from "zod";
|
|
11
11
|
|
|
12
|
-
// package.json
|
|
13
|
-
var name = "hevy-mcp";
|
|
14
|
-
var version = "1.15.0";
|
|
15
|
-
|
|
16
12
|
// src/tools/folders.ts
|
|
17
13
|
import { z } from "zod";
|
|
18
14
|
|
|
@@ -743,7 +739,7 @@ function registerWebhookTools(server, hevyClient) {
|
|
|
743
739
|
"API client not initialized. Please provide HEVY_API_KEY."
|
|
744
740
|
);
|
|
745
741
|
}
|
|
746
|
-
if (!
|
|
742
|
+
if (!hevyClient.getWebhookSubscription) {
|
|
747
743
|
throw new Error(
|
|
748
744
|
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
749
745
|
);
|
|
@@ -776,7 +772,7 @@ function registerWebhookTools(server, hevyClient) {
|
|
|
776
772
|
);
|
|
777
773
|
}
|
|
778
774
|
const { url, authToken } = args;
|
|
779
|
-
if (!
|
|
775
|
+
if (!hevyClient.createWebhookSubscription) {
|
|
780
776
|
throw new Error(
|
|
781
777
|
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
782
778
|
);
|
|
@@ -806,7 +802,7 @@ function registerWebhookTools(server, hevyClient) {
|
|
|
806
802
|
"API client not initialized. Please provide HEVY_API_KEY."
|
|
807
803
|
);
|
|
808
804
|
}
|
|
809
|
-
if (!
|
|
805
|
+
if (!hevyClient.deleteWebhookSubscription) {
|
|
810
806
|
throw new Error(
|
|
811
807
|
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
812
808
|
);
|
|
@@ -960,32 +956,31 @@ function registerWorkoutTools(server, hevyClient) {
|
|
|
960
956
|
);
|
|
961
957
|
}
|
|
962
958
|
const { title, description, startTime, endTime, isPrivate, exercises } = args;
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
)
|
|
987
|
-
}
|
|
959
|
+
const workoutPayload = {
|
|
960
|
+
title,
|
|
961
|
+
description: description || null,
|
|
962
|
+
start_time: startTime,
|
|
963
|
+
end_time: endTime,
|
|
964
|
+
routine_id: args.routineId ?? null,
|
|
965
|
+
is_private: isPrivate,
|
|
966
|
+
exercises: exercises.map(
|
|
967
|
+
(exercise) => ({
|
|
968
|
+
exercise_template_id: exercise.exerciseTemplateId,
|
|
969
|
+
superset_id: exercise.supersetId ?? null,
|
|
970
|
+
notes: exercise.notes ?? null,
|
|
971
|
+
sets: exercise.sets.map((set) => ({
|
|
972
|
+
type: set.type,
|
|
973
|
+
weight_kg: set.weight ?? set.weightKg ?? null,
|
|
974
|
+
reps: set.reps ?? null,
|
|
975
|
+
distance_meters: set.distance ?? set.distanceMeters ?? null,
|
|
976
|
+
duration_seconds: set.duration ?? set.durationSeconds ?? null,
|
|
977
|
+
rpe: set.rpe ?? null,
|
|
978
|
+
custom_metric: set.customMetric ?? null
|
|
979
|
+
}))
|
|
980
|
+
})
|
|
981
|
+
)
|
|
988
982
|
};
|
|
983
|
+
const requestBody = { workout: workoutPayload };
|
|
989
984
|
const data = await hevyClient.createWorkout(requestBody);
|
|
990
985
|
if (!data) {
|
|
991
986
|
return createEmptyResponse(
|
|
@@ -1049,32 +1044,31 @@ function registerWorkoutTools(server, hevyClient) {
|
|
|
1049
1044
|
isPrivate,
|
|
1050
1045
|
exercises
|
|
1051
1046
|
} = args;
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
)
|
|
1076
|
-
}
|
|
1047
|
+
const workoutPayload = {
|
|
1048
|
+
title,
|
|
1049
|
+
description: description || null,
|
|
1050
|
+
start_time: startTime,
|
|
1051
|
+
end_time: endTime,
|
|
1052
|
+
routine_id: routineId ?? null,
|
|
1053
|
+
is_private: isPrivate,
|
|
1054
|
+
exercises: exercises.map(
|
|
1055
|
+
(exercise) => ({
|
|
1056
|
+
exercise_template_id: exercise.exerciseTemplateId,
|
|
1057
|
+
superset_id: exercise.supersetId ?? null,
|
|
1058
|
+
notes: exercise.notes ?? null,
|
|
1059
|
+
sets: exercise.sets.map((set) => ({
|
|
1060
|
+
type: set.type,
|
|
1061
|
+
weight_kg: set.weight ?? set.weightKg ?? null,
|
|
1062
|
+
reps: set.reps ?? null,
|
|
1063
|
+
distance_meters: set.distance ?? set.distanceMeters ?? null,
|
|
1064
|
+
duration_seconds: set.duration ?? set.durationSeconds ?? null,
|
|
1065
|
+
rpe: set.rpe ?? null,
|
|
1066
|
+
custom_metric: set.customMetric ?? null
|
|
1067
|
+
}))
|
|
1068
|
+
})
|
|
1069
|
+
)
|
|
1077
1070
|
};
|
|
1071
|
+
const requestBody = { workout: workoutPayload };
|
|
1078
1072
|
const data = await hevyClient.updateWorkout(workoutId, requestBody);
|
|
1079
1073
|
if (!data) {
|
|
1080
1074
|
return createEmptyResponse(
|
|
@@ -1384,10 +1378,21 @@ function createClient(apiKey, baseUrl = "https://api.hevyapp.com") {
|
|
|
1384
1378
|
getRoutineFolder: (folderId) => getV1RoutineFoldersFolderid(folderId, headers, {
|
|
1385
1379
|
client
|
|
1386
1380
|
}),
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1381
|
+
getWebhookSubscription: async () => {
|
|
1382
|
+
throw new Error(
|
|
1383
|
+
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
1384
|
+
);
|
|
1385
|
+
},
|
|
1386
|
+
createWebhookSubscription: async (_data) => {
|
|
1387
|
+
throw new Error(
|
|
1388
|
+
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
1389
|
+
);
|
|
1390
|
+
},
|
|
1391
|
+
deleteWebhookSubscription: async () => {
|
|
1392
|
+
throw new Error(
|
|
1393
|
+
"Webhook subscription API not available. Please regenerate the client from the updated OpenAPI spec."
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1391
1396
|
};
|
|
1392
1397
|
}
|
|
1393
1398
|
|
|
@@ -1397,9 +1402,19 @@ function createClient2(apiKey, baseUrl) {
|
|
|
1397
1402
|
}
|
|
1398
1403
|
|
|
1399
1404
|
// src/index.ts
|
|
1405
|
+
var isBuiltArtifact = true ? true : false;
|
|
1406
|
+
if (isBuiltArtifact && false) {
|
|
1407
|
+
throw new Error(
|
|
1408
|
+
"Build-time variables __HEVY_MCP_NAME__ and __HEVY_MCP_VERSION__ must be defined."
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1411
|
+
var name = true ? "hevy-mcp" : "hevy-mcp";
|
|
1412
|
+
var version = true ? "1.17.0" : "dev";
|
|
1400
1413
|
dotenvx.config({ quiet: true });
|
|
1414
|
+
var sentryRelease = process.env.SENTRY_RELEASE ?? `${name}@${version}`;
|
|
1401
1415
|
var sentryConfig = {
|
|
1402
1416
|
dsn: "https://ce696d8333b507acbf5203eb877bce0f@o4508975499575296.ingest.de.sentry.io/4509049671647312",
|
|
1417
|
+
release: sentryRelease,
|
|
1403
1418
|
// Tracing must be enabled for MCP monitoring to work
|
|
1404
1419
|
tracesSampleRate: 1,
|
|
1405
1420
|
sendDefaultPii: false
|