hevy-mcp 4.1.2 → 4.1.3
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/dist/cli.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{src-Wa4VP4Na.mjs → src-CBiQ6f-q.mjs} +22 -31
- package/package.json +3 -2
- package/server.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
(function() {
|
|
5
5
|
try {
|
|
6
6
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
|
|
7
|
-
e.SENTRY_RELEASE = { id: "hevy-mcp@4.1.
|
|
7
|
+
e.SENTRY_RELEASE = { id: "hevy-mcp@4.1.3" };
|
|
8
8
|
var n = new e.Error().stack;
|
|
9
9
|
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "625c4c9c-e20d-40b3-96b1-4e799ef130f3", e._sentryDebugIdIdentifier = "sentry-dbid-625c4c9c-e20d-40b3-96b1-4e799ef130f3");
|
|
10
10
|
} catch (e) {}
|
|
11
11
|
})();
|
|
12
|
-
import { a as createSafeErrorDiagnostic, i as MissingHevyApiKeyError, n as runServer, o as flushTelemetry } from "./src-
|
|
12
|
+
import { a as createSafeErrorDiagnostic, i as MissingHevyApiKeyError, n as runServer, o as flushTelemetry } from "./src-CBiQ6f-q.mjs";
|
|
13
13
|
//#region src/cli.ts
|
|
14
14
|
runServer().catch(async (error) => {
|
|
15
15
|
if (error instanceof MissingHevyApiKeyError) console.error(error.message);
|
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ type NodeTransport = "stdio" | "http";
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
declare function createNodeMcpServer({ apiKey }: {
|
|
7
7
|
apiKey: string;
|
|
8
|
-
}, transport?: NodeTransport): Promise<import("@modelcontextprotocol/
|
|
8
|
+
}, transport?: NodeTransport): Promise<import("@modelcontextprotocol/server").McpServer>;
|
|
9
9
|
declare function runStdioServer(): Promise<void>;
|
|
10
10
|
declare function runServer(): Promise<void>;
|
|
11
11
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
(function() {
|
|
5
5
|
try {
|
|
6
6
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
|
|
7
|
-
e.SENTRY_RELEASE = { id: "hevy-mcp@4.1.
|
|
7
|
+
e.SENTRY_RELEASE = { id: "hevy-mcp@4.1.3" };
|
|
8
8
|
var n = new e.Error().stack;
|
|
9
9
|
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e9496b31-626b-4ad1-9416-47ba4ffd2995", e._sentryDebugIdIdentifier = "sentry-dbid-e9496b31-626b-4ad1-9416-47ba4ffd2995");
|
|
10
10
|
} catch (e) {}
|
|
11
11
|
})();
|
|
12
|
-
import { n as runServer, r as runStdioServer, t as createNodeMcpServer } from "./src-
|
|
12
|
+
import { n as runServer, r as runStdioServer, t as createNodeMcpServer } from "./src-CBiQ6f-q.mjs";
|
|
13
13
|
export { createNodeMcpServer, runServer, runStdioServer };
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
(function() {
|
|
5
5
|
try {
|
|
6
6
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {};
|
|
7
|
-
e.SENTRY_RELEASE = { id: "hevy-mcp@4.1.
|
|
7
|
+
e.SENTRY_RELEASE = { id: "hevy-mcp@4.1.3" };
|
|
8
8
|
var n = new e.Error().stack;
|
|
9
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
9
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "112c763b-1652-4fb5-8237-94b6a8ef1122", e._sentryDebugIdIdentifier = "sentry-dbid-112c763b-1652-4fb5-8237-94b6a8ef1122");
|
|
10
10
|
} catch (e) {}
|
|
11
11
|
})();
|
|
12
12
|
import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -19,15 +19,14 @@ import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
|
19
19
|
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
20
20
|
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
21
21
|
import { MeterProvider, PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|
22
|
-
import { StdioServerTransport } from "@modelcontextprotocol/
|
|
22
|
+
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
23
23
|
import { z } from "zod";
|
|
24
|
-
import { McpServer } from "@modelcontextprotocol/
|
|
24
|
+
import { McpServer, deserializeMessage } from "@modelcontextprotocol/server";
|
|
25
25
|
import { z as z$1 } from "zod/v4";
|
|
26
26
|
import { isIP } from "node:net";
|
|
27
27
|
import { createServer } from "node:http";
|
|
28
|
-
import {
|
|
28
|
+
import { NodeStreamableHTTPServerTransport } from "@modelcontextprotocol/node";
|
|
29
29
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
30
|
-
import { deserializeMessage } from "@modelcontextprotocol/sdk/shared/stdio.js";
|
|
31
30
|
import { mkdir, readFile, rename, unlink, writeFile } from "node:fs/promises";
|
|
32
31
|
import { homedir } from "node:os";
|
|
33
32
|
import { dirname, join } from "node:path";
|
|
@@ -81,11 +80,11 @@ function sanitizeSentryMcpSpan(span) {
|
|
|
81
80
|
* OTel Collector → Honeycomb: performance traces, metrics
|
|
82
81
|
*/
|
|
83
82
|
const name$1 = "hevy-mcp";
|
|
84
|
-
const version$1 = "4.1.
|
|
83
|
+
const version$1 = "4.1.3";
|
|
85
84
|
const telemetryEnabled = process.env.HEVY_MCP_TELEMETRY !== "0";
|
|
86
85
|
const collectorToken = "NH9vOela-HYreQxAbJa68cjEmORoEKM57EvneUDVcOo";
|
|
87
86
|
const COLLECTOR_ENDPOINT = "https://otel.chrisdoc.dev/v1";
|
|
88
|
-
const sentryRelease = process.env.SENTRY_RELEASE ?? `hevy-mcp@4.1.
|
|
87
|
+
const sentryRelease = process.env.SENTRY_RELEASE ?? `hevy-mcp@4.1.3`;
|
|
89
88
|
const resource = resourceFromAttributes({
|
|
90
89
|
"service.name": name$1,
|
|
91
90
|
"service.version": version$1
|
|
@@ -1507,7 +1506,7 @@ function registerWorkoutPrompts(server, observer) {
|
|
|
1507
1506
|
server.registerPrompt("analyze-workout-progress", {
|
|
1508
1507
|
title: "Analyze Workout Progress",
|
|
1509
1508
|
description: "Analyze recent workout and body-measurement trends.",
|
|
1510
|
-
argsSchema: { weeks: z.coerce.number().int().min(1).max(12).default(4).optional().describe("Number of recent weeks to analyze (1-12).") }
|
|
1509
|
+
argsSchema: z.object({ weeks: z.coerce.number().int().min(1).max(12).default(4).optional().describe("Number of recent weeks to analyze (1-12).") })
|
|
1511
1510
|
}, withPromptObservation("analyze-workout-progress", observer, ({ weeks = 4 }) => ({ messages: [{
|
|
1512
1511
|
role: "user",
|
|
1513
1512
|
content: {
|
|
@@ -1524,10 +1523,10 @@ function registerWorkoutPrompts(server, observer) {
|
|
|
1524
1523
|
server.registerPrompt("create-workout-from-routine", {
|
|
1525
1524
|
title: "Create Workout From Routine",
|
|
1526
1525
|
description: "Create a completed workout from an existing routine.",
|
|
1527
|
-
argsSchema: {
|
|
1526
|
+
argsSchema: z.object({
|
|
1528
1527
|
routineId: z.string().min(1).optional().describe("Routine ID to use as a guide."),
|
|
1529
1528
|
startTime: utcSecondTimestamp.optional().describe("Workout start time in UTC as YYYY-MM-DDTHH:mm:ssZ.")
|
|
1530
|
-
}
|
|
1529
|
+
})
|
|
1531
1530
|
}, withPromptObservation("create-workout-from-routine", observer, ({ routineId, startTime }) => ({ messages: [{
|
|
1532
1531
|
role: "user",
|
|
1533
1532
|
content: {
|
|
@@ -2600,7 +2599,7 @@ function registerHevyResources(server, runtime) {
|
|
|
2600
2599
|
//#endregion
|
|
2601
2600
|
//#region ../core/src/server-metadata.ts
|
|
2602
2601
|
const SERVER_NAME = "hevy-mcp";
|
|
2603
|
-
const SERVER_VERSION = "4.1.
|
|
2602
|
+
const SERVER_VERSION = "4.1.3";
|
|
2604
2603
|
const SERVER_INSTRUCTIONS = [
|
|
2605
2604
|
"Hevy MCP connects clients to the authenticated user's Hevy workout-tracking data, including workouts, routines, exercise templates, routine folders, body measurements, and profile information. HEVY_API_KEY must contain a valid Hevy API key for local stdio use.",
|
|
2606
2605
|
"Safety: all get-* and search-* tools are read-only. create-* and update-* tools mutate Hevy data. Creates are additive and non-idempotent, so repeating one can create duplicates. Updates can overwrite existing data. Delete operations are not available.",
|
|
@@ -2660,16 +2659,13 @@ function registerToolDefinition(server, runtime, definition) {
|
|
|
2660
2659
|
kind: definition.kind,
|
|
2661
2660
|
operation: definition.operation
|
|
2662
2661
|
});
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
return;
|
|
2671
|
-
}
|
|
2672
|
-
server.tool(definition.name, definition.description, definition.inputSchema, definition.annotations, callback);
|
|
2662
|
+
const config = {
|
|
2663
|
+
description: definition.description,
|
|
2664
|
+
inputSchema: z.object(definition.inputSchema),
|
|
2665
|
+
annotations: definition.annotations,
|
|
2666
|
+
...definition.kind === "read" ? { outputSchema: z.object(definition.outputSchema) } : {}
|
|
2667
|
+
};
|
|
2668
|
+
server.registerTool(definition.name, config, callback);
|
|
2673
2669
|
}
|
|
2674
2670
|
//#endregion
|
|
2675
2671
|
//#region ../core/src/utils/tool-annotations.ts
|
|
@@ -4399,18 +4395,13 @@ function createCountingServer(server) {
|
|
|
4399
4395
|
let count = 0;
|
|
4400
4396
|
return {
|
|
4401
4397
|
server: new Proxy(server, { get(target, property, receiver) {
|
|
4402
|
-
if (property === "tool") return (...args) => {
|
|
4403
|
-
const result = target.tool(...args);
|
|
4404
|
-
count += 1;
|
|
4405
|
-
return result;
|
|
4406
|
-
};
|
|
4407
4398
|
if (property === "registerTool") {
|
|
4408
|
-
const registerTool = (
|
|
4409
|
-
|
|
4399
|
+
const registerTool = target.registerTool.bind(target);
|
|
4400
|
+
return (...args) => {
|
|
4401
|
+
const result = Reflect.apply(registerTool, target, args);
|
|
4410
4402
|
count += 1;
|
|
4411
4403
|
return result;
|
|
4412
4404
|
};
|
|
4413
|
-
return registerTool;
|
|
4414
4405
|
}
|
|
4415
4406
|
return Reflect.get(target, property, receiver);
|
|
4416
4407
|
} }),
|
|
@@ -4812,7 +4803,7 @@ async function startStreamableHttpServer(options, apiKey, createMcpServer) {
|
|
|
4812
4803
|
let session;
|
|
4813
4804
|
let mcpServer;
|
|
4814
4805
|
let connected = false;
|
|
4815
|
-
const transport = new
|
|
4806
|
+
const transport = new NodeStreamableHTTPServerTransport({
|
|
4816
4807
|
sessionIdGenerator: randomUUID,
|
|
4817
4808
|
onsessioninitialized: (id) => {
|
|
4818
4809
|
if (session) sessions.set(id, session);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hevy-mcp",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Model Context Protocol (MCP) server implementation that interfaces with the Hevy fitness tracking app and its API.",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"build:standalone": "cross-env HEVY_MCP_BUILD_MODE=standalone tsdown -c tsdown.config.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@modelcontextprotocol/
|
|
37
|
+
"@modelcontextprotocol/node": "^2.0.0",
|
|
38
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
38
39
|
"@opentelemetry/api": "^1.9.1",
|
|
39
40
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
|
|
40
41
|
"@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
|
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/chrisdoc/hevy-mcp",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "4.1.
|
|
10
|
+
"version": "4.1.3",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "hevy-mcp",
|
|
15
|
-
"version": "4.1.
|
|
15
|
+
"version": "4.1.3",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
},
|