Rebrand to KuentaGYM, and start a new profile in pounds and Spanish
The app is now KuentaGYM everywhere a user can see it, and a fresh profile no longer starts on upstream's English/kg defaults. Both are this fork's decisions, so both are pinned by tests rather than left to a find-and-replace. Rename (1,270 references, 149 files) - Visible surfaces: the Login/Home/mobile-onboarding wordmark, the Settings version line, the printed plan, the PWA title + manifest, and the 17 branded strings across all 14 locale packs. - Infrastructure: repo links, the container images and the release endpoints now name git.dploy.lol/dsantillan/kuentagym; .gitea/workflows/docker-publish.yml publishes to this forge's registry instead of gitea.com. - The Android/iOS application id stays ch.duartesantos.opengym on purpose: changing it would make the mobile app a different app that could never update an installed copy. Three things the mechanical pass would have broken, fixed here - The update check asked gitlab.com for upstream's releases and would have installed upstream's APK, putting the old name back on the phone. It now reads this fork's Gitea releases API (the assets shape differs), with the tests rewritten to the payload Gitea actually returns. - Renaming the mobile state/pairing files (opengym-state.json, opengym-remote.json) would lose the on-device copy of a history whose WebView storage may have been evicted, and silently unpair the device. Both are read under their old names and written forward under the new ones. - Renaming the exported plan-file marker (openGym_plan) rejected every plan shared before the rename as "not a plan file". Both markers are accepted. Defaults: pounds and Spanish - DEF.unit = 'lb', DEF.lang = 'es', plus every fallback that independently assumed en/kg (the <html lang> attribute, the Settings pickers, the Store, the MCP, the Coach payload). - Server-generated push copy existed only in English and pt-BR, so a Spanish profile would have been notified in English; Spanish added. - The demo seed states unit: 'kg' — its seeded numbers are kilograms, and inheriting the new default would have introduced an 82.4 lb lifter benching 60. - The module-level language in i18n-core stays English: it is the only language whose strings need no pack, so `t()`, dates, numbers and lists agree before a pack loads. Starting there on 'es' formats a Spanish-shaped UI with English strings. Also - api/package.json's test glob missed push-messages.test.js and verify-error.test.js, which sat beside the modules they cover and never ran. - README, docs/, website/ and the issue templates no longer describe upstream's GitLab/GitHub pipeline, Discord, sponsorship or public demo as if they were this fork's; upstream history and attribution are preserved (NOTICE.md).
This commit is contained in:
1 parent
f91cde15a1
commit
87bfd6d4c4
152 files changed
+1784
-1604
No files matched your search
+13
-12
@@ -1,13 +1,13 @@
|
||||
# openGym MCP server
|
||||
# KuentaGYM MCP server
|
||||
|
||||
A [Model Context Protocol](https://modelcontextprotocol.io) bridge that lets an external LLM
|
||||
application (Claude Desktop, Cursor, Cline, Continue, etc.) read your openGym profile —
|
||||
application (Claude Desktop, Cursor, Cline, Continue, etc.) read your KuentaGYM profile —
|
||||
routines, workouts, body-weight log, estimated 1RMs, and muscle balance — directly from your
|
||||
self-hosted `./data` directory.
|
||||
|
||||
It is read-only, runs locally as a stdio process spawned by the LLM client, adds no new
|
||||
container, and requires no extra authentication. The LLM never sees passkeys, VAPID keys, or
|
||||
session secrets — it can only read the same `state-<uid>.json` files the openGym api already
|
||||
session secrets — it can only read the same `state-<uid>.json` files the KuentaGYM api already
|
||||
writes.
|
||||
|
||||
The numbers it answers with are computed by the **same pure functions the React UI uses**
|
||||
@@ -36,7 +36,7 @@ to answer for — its user id is in `./data/db.json` under `users[].id`:
|
||||
node src/index.js
|
||||
|
||||
# multi-user instance, or just to be explicit:
|
||||
OPENGYM_UID=<your-uid> OPENGYM_DATA=/path/to/openGym/data node src/index.js
|
||||
KUENTAGYM_UID=<your-uid> KUENTAGYM_DATA=/path/to/KuentaGYM/data node src/index.js
|
||||
```
|
||||
|
||||
### 3. Register with your LLM client
|
||||
@@ -47,12 +47,12 @@ Add the server to your LLM client's MCP config. For Claude Desktop, edit
|
||||
```jsonc
|
||||
{
|
||||
"mcpServers": {
|
||||
"opengym": {
|
||||
"kuentagym": {
|
||||
"command": "node",
|
||||
"args": ["/absolute/path/to/openGym/mcp/src/index.js"],
|
||||
"args": ["/absolute/path/to/KuentaGYM/mcp/src/index.js"],
|
||||
"env": {
|
||||
"OPENGYM_DATA": "/absolute/path/to/openGym/data",
|
||||
"OPENGYM_UID": "<your-uid>" // optional — auto-detected if you have one profile
|
||||
"KUENTAGYM_DATA": "/absolute/path/to/KuentaGYM/data",
|
||||
"KUENTAGYM_UID": "<your-uid>" // optional — auto-detected if you have one profile
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ Add the server to your LLM client's MCP config. For Claude Desktop, edit
|
||||
For Cursor and other MCP-compatible clients, see the client's MCP docs — the same `command` +
|
||||
`args` + `env` shape is what every stdio MCP server expects.
|
||||
|
||||
Restart the client; you should see the openGym tools appear with "serving profile \<name\>" on
|
||||
Restart the client; you should see the KuentaGYM tools appear with "serving profile \<name\>" on
|
||||
the server's stderr.
|
||||
|
||||
## Tools
|
||||
@@ -120,8 +120,9 @@ dependencies landed in `frontend/`, no public exports changed.
|
||||
cd mcp && npm test
|
||||
```
|
||||
|
||||
58 cases seeding state from `frontend/src/lib/demoSeed.js` (the same deterministic fixture
|
||||
the public demo runs on). Pins JSON shape and the user-facing edge cases: rest-day override,
|
||||
58 cases seeding state from `frontend/src/lib/demoSeed.js` (the same deterministic fixture a demo
|
||||
build — `VITE_DEMO=1` — seeds its example profile from; no demo is deployed for this fork). Pins
|
||||
JSON shape and the user-facing edge cases: rest-day override,
|
||||
missing routine, zero-workout history, no synced state, superset links, three 1RM formulas.
|
||||
"Today" is pinned via `vi.useFakeTimers({ now: ..., toFake: ['Date'] })` so date-dependent
|
||||
tools see consistent values regardless of when the suite runs. The pure lib functions have
|
||||
@@ -141,4 +142,4 @@ their own 92 tests in `frontend/src/lib/*.test.js`.
|
||||
|
||||
## License
|
||||
|
||||
AGPL-3.0-or-later, same as openGym.
|
||||
AGPL-3.0-or-later, same as KuentaGYM.
|
||||
Generated
+3
-3
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "opengym-mcp",
|
||||
"name": "kuentagym-mcp",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "opengym-mcp",
|
||||
"name": "kuentagym-mcp",
|
||||
"version": "0.1.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
@@ -13,7 +13,7 @@
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"bin": {
|
||||
"opengym-mcp": "src/index.js"
|
||||
"kuentagym-mcp": "src/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitest/coverage-v8": "^4.1.11",
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "opengym-mcp",
|
||||
"name": "kuentagym-mcp",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "MCP (Model Context Protocol) bridge for openGym — lets an external LLM read your routines, workouts, body-weight log, estimated 1RMs and muscle balance from your self-hosted data. Read-only, stdio transport; no extra container.",
|
||||
"description": "MCP (Model Context Protocol) bridge for KuentaGYM — lets an external LLM read your routines, workouts, body-weight log, estimated 1RMs and muscle balance from your self-hosted data. Read-only, stdio transport; no extra container.",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
"opengym-mcp": "src/index.js"
|
||||
"kuentagym-mcp": "src/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node src/index.js",
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
/* openGym MCP server — stdio transport. The LLM client (Claude Desktop, Cursor, …) spawns
|
||||
/* KuentaGYM MCP server — stdio transport. The LLM client (Claude Desktop, Cursor, …) spawns
|
||||
this process locally, talks JSON-RPC over stdin/stdout, tears it down when the session ends.
|
||||
No extra container, no new outbound network — your data stays in a folder you control. */
|
||||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
||||
@@ -8,19 +8,19 @@ import { TOOLS } from './tools.js'
|
||||
import { init, getUser } from './state.js'
|
||||
|
||||
const server = new McpServer({
|
||||
name: 'opengym',
|
||||
name: 'kuentagym',
|
||||
version: '0.1.0'
|
||||
})
|
||||
|
||||
// Fail fast on bad config so a misnamed OPENGYM_DATA doesn't silently answer every call with
|
||||
// Fail fast on bad config so a misnamed KUENTAGYM_DATA doesn't silently answer every call with
|
||||
// the no-state sentinel. Always register every tool so the LLM sees the full list at
|
||||
// handshake, even when state didn't resolve.
|
||||
try {
|
||||
init()
|
||||
const u = getUser()
|
||||
console.error(`[opengym-mcp] serving profile ${u.name} (${u.id})`)
|
||||
console.error(`[kuentagym-mcp] serving profile ${u.name} (${u.id})`)
|
||||
} catch (e) {
|
||||
console.error(`[opengym-mcp] ${e.message}`)
|
||||
console.error(`[kuentagym-mcp] ${e.message}`)
|
||||
// Don't exit — keep the tool listings up so the user sees a useful error after fixing their
|
||||
// env and restarting.
|
||||
}
|
||||
|
||||
+13
-11
@@ -1,10 +1,10 @@
|
||||
/* opengym-mcp state — reads ./data/state-<uid>.json + db.json (read-only). Cached with an
|
||||
/* kuentagym-mcp state — reads ./data/state-<uid>.json + db.json (read-only). Cached with an
|
||||
fs.watch + mtime fallback so a session the api server just wrote is visible on the next
|
||||
tool call without a restart. */
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
const DATA_DIR = process.env.OPENGYM_DATA || path.join(process.cwd(), 'data')
|
||||
const DATA_DIR = process.env.KUENTAGYM_DATA || path.join(process.cwd(), 'data')
|
||||
|
||||
// null = no state file (brand-new account); undefined = not yet loaded.
|
||||
let _state = undefined
|
||||
@@ -23,13 +23,13 @@ function stateFile(uid) {
|
||||
return path.join(DATA_DIR, 'state-' + uid.replace(/[^a-zA-Z0-9_-]/g, '') + '.json')
|
||||
}
|
||||
|
||||
// Pick the uid: OPENGYM_UID env, else the only state-* file, else the only user in db.json.
|
||||
// Pick the uid: KUENTAGYM_UID env, else the only state-* file, else the only user in db.json.
|
||||
// Throws listing the options if ambiguous. The sanitiser on stateFile() keeps a sneaky
|
||||
// '..' in OPENGYM_UID harmless.
|
||||
// '..' in KUENTAGYM_UID harmless.
|
||||
function resolveUid() {
|
||||
const envUid = (process.env.OPENGYM_UID || '').trim()
|
||||
const envUid = (process.env.KUENTAGYM_UID || '').trim()
|
||||
if (envUid) {
|
||||
if (!/^[a-zA-Z0-9_-]+$/.test(envUid)) throw new Error(`OPENGYM_UID contains characters that aren't safe in a filename: ${JSON.stringify(envUid)}`)
|
||||
if (!/^[a-zA-Z0-9_-]+$/.test(envUid)) throw new Error(`KUENTAGYM_UID contains characters that aren't safe in a filename: ${JSON.stringify(envUid)}`)
|
||||
return envUid
|
||||
}
|
||||
const files = fs.readdirSync(DATA_DIR)
|
||||
@@ -39,16 +39,16 @@ function resolveUid() {
|
||||
if (files.length === 0) {
|
||||
reloadDb()
|
||||
if (_db.users.length === 1) return _db.users[0].id
|
||||
if (_db.users.length === 0) throw new Error(`no openGym users found in ${path.join(DATA_DIR, 'db.json')} — sign in at least once on a device`)
|
||||
if (_db.users.length === 0) throw new Error(`no KuentaGYM users found in ${path.join(DATA_DIR, 'db.json')} — sign in at least once on a device`)
|
||||
// Multiple users in db.json but no state files yet — list their ids, not the (empty)
|
||||
// files list. Hit when accounts exist but none has signed in on a device.
|
||||
throw new Error(
|
||||
`multiple openGym users found — set OPENGYM_UID to one of: ${_db.users.map(u => u.id).join(', ')}\n` +
|
||||
`multiple KuentaGYM users found — set KUENTAGYM_UID to one of: ${_db.users.map(u => u.id).join(', ')}\n` +
|
||||
` (look them up in ${path.join(DATA_DIR, 'db.json')} under "users"[].id)`
|
||||
)
|
||||
}
|
||||
throw new Error(
|
||||
`multiple openGym users found — set OPENGYM_UID to one of: ${files.join(', ')}\n` +
|
||||
`multiple KuentaGYM users found — set KUENTAGYM_UID to one of: ${files.join(', ')}\n` +
|
||||
` (look them up in ${path.join(DATA_DIR, 'db.json')} under "users"[].id)`
|
||||
)
|
||||
}
|
||||
@@ -56,7 +56,7 @@ function resolveUid() {
|
||||
// Idempotent. Picks the uid, loads db.json, attaches the watcher, primes state.
|
||||
export function init() {
|
||||
if (_uid !== null) return
|
||||
if (!fs.existsSync(DATA_DIR)) throw new Error(`OPENGYM_DATA dir does not exist: ${DATA_DIR}`)
|
||||
if (!fs.existsSync(DATA_DIR)) throw new Error(`KUENTAGYM_DATA dir does not exist: ${DATA_DIR}`)
|
||||
_uid = resolveUid()
|
||||
reloadDb()
|
||||
const file = stateFile(_uid)
|
||||
@@ -126,9 +126,11 @@ export function _seedStateForTests(state) {
|
||||
if (_watcher) { _watcher.close(); _watcher = null }
|
||||
}
|
||||
|
||||
// Mirrors DEF in frontend/src/store/useStore.js, so the MCP reports the same unit and language a
|
||||
// profile with no saved value is shown in. Only ever a fallback: a real state file carries both.
|
||||
function defaultsShape() {
|
||||
return {
|
||||
unit: 'kg', restSec: 90, sound: true, lang: 'en',
|
||||
unit: 'lb', restSec: 90, sound: true, lang: 'es',
|
||||
theme: 'dark', accent: 'lime', body: 'male', targetW: null,
|
||||
bodyweight: [], routines: [], week: {}, dayPlan: {},
|
||||
exWeights: {}, workouts: [], customEx: [], gifSize: 'full',
|
||||
|
||||
+10
-10
@@ -83,13 +83,13 @@ function prTable(S, formula) {
|
||||
/** list_routines — names + counts of each routine in the user's plan. */
|
||||
export const listRoutines = {
|
||||
name: 'list_routines',
|
||||
description: 'List the workout routines saved in the user\'s openGym profile (the same list the Plan screen shows). Each routine is a named set of exercises with set/rep targets. Use this to discover the plan structure before diving into a specific routine or today\'s workout.',
|
||||
description: 'List the workout routines saved in the user\'s KuentaGYM profile (the same list the Plan screen shows). Each routine is a named set of exercises with set/rep targets. Use this to discover the plan structure before diving into a specific routine or today\'s workout.',
|
||||
schema: {},
|
||||
handler: () => {
|
||||
const S = getState()
|
||||
if (!S) return noState()
|
||||
return {
|
||||
unit: S.unit || 'kg',
|
||||
unit: S.unit || 'lb',
|
||||
routines: (S.routines || []).map(r => ({
|
||||
id: r.id,
|
||||
name: r.name,
|
||||
@@ -120,7 +120,7 @@ export const getRoutine = {
|
||||
policy: policyFor(null, r, 'reps'),
|
||||
policy_name: policyName(policyFor(null, r, 'reps')),
|
||||
exclude_from_progression: r.excludeFromProgression === true,
|
||||
unit: S.unit || 'kg',
|
||||
unit: S.unit || 'lb',
|
||||
exercises: (r.ex || []).map((cfg, i) => {
|
||||
const ex = exerciseOf(cfg.id, S)
|
||||
const mode = modeOf(cfg)
|
||||
@@ -146,7 +146,7 @@ export const getRoutine = {
|
||||
policy: policyFor(cfg, r, mode),
|
||||
policy_override: cfg.prog || null,
|
||||
superset_group: cfg.sg || null,
|
||||
summary: exLine(cfg, S.unit || 'kg')
|
||||
summary: exLine(cfg, S.unit || 'lb')
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -156,7 +156,7 @@ export const getRoutine = {
|
||||
/** get_week_plan — what's scheduled each weekday + today. */
|
||||
export const getWeekPlan = {
|
||||
name: 'get_week_plan',
|
||||
description: 'Show the user\'s weekly plan: which routine (if any) is assigned to each weekday, keyed by JS getDay() (Sunday=0, Monday=1, … Saturday=6 — the same convention the openGym state file uses). Also reports today\'s date and what routine applies today, accounting for one-off overrides the user may have set for a specific date (a "rest" override cancels the day).',
|
||||
description: 'Show the user\'s weekly plan: which routine (if any) is assigned to each weekday, keyed by JS getDay() (Sunday=0, Monday=1, … Saturday=6 — the same convention the KuentaGYM state file uses). Also reports today\'s date and what routine applies today, accounting for one-off overrides the user may have set for a specific date (a "rest" override cancels the day).',
|
||||
schema: {},
|
||||
handler: () => {
|
||||
const S = getState()
|
||||
@@ -207,7 +207,7 @@ export const listWorkouts = {
|
||||
return true
|
||||
}).slice(0, lim)
|
||||
return {
|
||||
unit: S.unit || 'kg',
|
||||
unit: S.unit || 'lb',
|
||||
total_count: all.length,
|
||||
returned_count: filtered.length,
|
||||
workouts: filtered.map(w => ({
|
||||
@@ -282,7 +282,7 @@ export const getWorkout = {
|
||||
date: w.d,
|
||||
routine_id: w.routineId || null,
|
||||
routine_name: w.name || null,
|
||||
unit: S.unit || 'kg',
|
||||
unit: S.unit || 'lb',
|
||||
bodyweight_at_workout: w.bw || null,
|
||||
volume: workoutVolume(w),
|
||||
sets_done: setsDone(w),
|
||||
@@ -316,7 +316,7 @@ export const getBodyweight = {
|
||||
}).sort((a, b) => (a.d || '').localeCompare(b.d || ''))
|
||||
const latest = bw.length ? bw[bw.length - 1] : null
|
||||
return {
|
||||
unit: S.unit || 'kg',
|
||||
unit: S.unit || 'lb',
|
||||
goal,
|
||||
count: bw.length,
|
||||
latest: latest ? { date: latest.d, weight: latest.w, delta_vs_goal: goal != null ? Math.round((latest.w - goal) * 10) / 10 : null } : null,
|
||||
@@ -463,7 +463,7 @@ export const previewSession = {
|
||||
if (!r) return { date: iso, routine_id: null, routine_name: null, rest_day: true, note: 'no routine is scheduled for this date (rest day)', exercises: [] }
|
||||
}
|
||||
|
||||
const unit = S.unit || 'kg'
|
||||
const unit = S.unit || 'lb'
|
||||
// The same builder the app starts a session with (sheets.jsx beginWorkout → session-start.js):
|
||||
// prescription, step, progression-off targets, deload routines and warm-up ramps all come from
|
||||
// there, so the preview cannot drift from what the screen shows.
|
||||
@@ -571,7 +571,7 @@ export const TOOLS = [
|
||||
|
||||
function noState() {
|
||||
return {
|
||||
error: 'no synced state yet — sign in at least once from a device so the openGym api can save a state file for this profile',
|
||||
error: 'no synced state yet — sign in at least once from a device so the KuentaGYM api can save a state file for this profile',
|
||||
unit: 'kg'
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user