ergzone-mcp 1.3.1 → 1.4.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/README.md CHANGED
@@ -56,6 +56,7 @@ Prefer not to store your password? Use `ERGZONE_SESSION_TOKEN` instead (copied f
56
56
 
57
57
  | Tool | What it does |
58
58
  |------|------|
59
+ | `version` | server name + version |
59
60
  | `auth_check` | who am I |
60
61
  | `update_profile` | set max HR, resting HR, weight, weight unit |
61
62
  | `list_workouts` / `get_workout` | browse workouts |
@@ -69,6 +70,7 @@ Prefer not to store your password? Use `ERGZONE_SESSION_TOKEN` instead (copied f
69
70
  Just talk to Claude in plain language:
70
71
 
71
72
  - **Check it works** — *"Am I connected to ErgZone? Who am I?"*
73
+ - **Version** — *"What ErgZone MCP version is running?"*
72
74
  - **Browse** — *"List my ErgZone workouts."*
73
75
  - **Build (preview, nothing saved)** — *"Show me an SPM ladder from 16 to 30 spm, 1 min each."*
74
76
  - **Create** — *"Create a workout 'Tuesday tempo' with 3 × 2 min at 22 spm, 1 min rest."*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ergzone-mcp",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Unofficial MCP server for ErgZone (Concept2 rowing). Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tools.mjs CHANGED
@@ -1,9 +1,28 @@
1
1
  // MCP tool definitions (Tier 1: core training + builder + basic analysis).
2
2
  // Each tool: { name, description, inputSchema, handler, write?, destructive? }
3
3
 
4
+ import { readFileSync } from 'node:fs';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { dirname, join } from 'node:path';
7
+
4
8
  import { gql, todayISO, resolveTrackId } from './client.mjs';
5
9
  import { resolveIntervals, validateIntervals } from './intervals.mjs';
6
10
 
11
+ // Server version, read once at load. Source of truth is manifest.json (CI syncs it
12
+ // to the real release version before packing the .mcpb); fall back to package.json.
13
+ const SERVER_VERSION = (() => {
14
+ const root = join(dirname(fileURLToPath(import.meta.url)), '..');
15
+ for (const file of ['manifest.json', 'package.json']) {
16
+ try {
17
+ const v = JSON.parse(readFileSync(join(root, file), 'utf8')).version;
18
+ if (v && v !== '0.0.0' && v !== '0.0.0-development') return v;
19
+ } catch {
20
+ /* ignore, try next */
21
+ }
22
+ }
23
+ return '0.0.0-development';
24
+ })();
25
+
7
26
  // ---- analysis helpers ----
8
27
 
9
28
  // Concept2 watts from pace (sec/500m). Formula: 2.80 / (pace/500)^3.
@@ -34,6 +53,15 @@ const INTERVAL_DEF = `type value spm spmMax rest undefRest notes restNotes sugge
34
53
  const INTERVAL_RESULT = `type value rest distance avgPace avgSpm maxSpm avgWatts maxWatts calories avgHr maxHr minHr hrZones strokeCount rateConsistency driveLength driveTime recoveryTime avgForce peakForce avgDragFactor`;
35
54
 
36
55
  export const TOOLS = [
56
+ {
57
+ name: 'version',
58
+ description: 'Return the ergzone-mcp server name and version.',
59
+ inputSchema: { type: 'object', properties: {} },
60
+ async handler() {
61
+ return { name: 'ergzone-mcp', version: SERVER_VERSION };
62
+ },
63
+ },
64
+
37
65
  {
38
66
  name: 'auth_check',
39
67
  description: 'Verify the token and show the logged-in user (id, name, email, max/resting HR, weight).',