wimsta-mcp 0.0.0-stage → 1.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -2
  3. package/index.js +181 -0
  4. package/package.json +51 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WIMSTA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,75 @@
1
- # Temporary Holding Version
1
+ # WIMSTA MCP server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/wimsta-mcp)](https://www.npmjs.com/package/wimsta-mcp) [![getwimsta/wimsta-mcp MCP server](https://glama.ai/mcp/servers/getwimsta/wimsta-mcp/badges/score.svg)](https://glama.ai/mcp/servers/getwimsta/wimsta-mcp)
4
+
5
+ Evidence-based body calculators for AI assistants. Ask Claude, Cursor or any
6
+ [MCP](https://modelcontextprotocol.io) client for your BMI, body-fat %, calorie needs or max heart
7
+ rate and get **a range across published formulas, not one made-up number**, with the formulas,
8
+ their original studies and a medical disclaimer.
9
+
10
+ Results come from the public [WIMSTA Calculation API](https://wimsta.com/tools/#calculation-api),
11
+ so they always match the calculators on [wimsta.com](https://wimsta.com). No API key, no account, no tracking.
12
+
13
+ ## Tools
14
+
15
+ | Tool | What it returns |
16
+ |---|---|
17
+ | `bmi` | BMI range: classic Quetelet + Trefethen "new BMI", WHO category |
18
+ | `body_fat` | Body-fat % range across Deurenberg, CUN-BAE, US Navy, RFM, Covert Bailey (whatever your measurements allow), Gallagher category |
19
+ | `bmr` | Basal metabolic rate range: Mifflin–St Jeor, Harris–Benedict 1984/1919, WHO/FAO, Katch–McArdle |
20
+ | `tdee` | Maintenance calories (TDEE) range for an activity level |
21
+ | `max_heart_rate` | Max heart rate range across nine formulas + five training zones |
22
+ | `waist_to_height` | Waist-to-height ratio, Ashwell zone, healthy waist range |
23
+ | `ideal_weight` | Ideal body weight range across seven classic formulas + WHO healthy-weight range |
24
+ | `ffmi` | Fat-Free Mass Index, raw and normalized, neutral band |
25
+ | `body_surface_area` | Body surface area range across eight formulas |
26
+ | `body_shape` | Body-shape type from bust, waist and hip ratios |
27
+ | `body_frame` | Body-frame size from the height ÷ wrist ratio |
28
+ | `protein` | Daily protein bands (RDA, active, preservation, lean-mass) |
29
+ | `water` | Daily water range across five authorities, lifestyle add-ons |
30
+ | `creatine` | Creatine maintenance and loading dose (ISSN) |
31
+ | `one_rep_max` | One-rep max range across Epley, Brzycki, Lombardi, Lander + training table |
32
+ | `vo2max` | VO2max range from Uth, Cooper and Rockport field tests |
33
+ | `running_pace` | Pace / time / distance solver + Riegel race prediction range |
34
+ | `get_formula` | One formula from the open [WIMSTA formula registry](https://wimsta.com/registry/) (CC BY 4.0): equation, citation, validation population, limitations |
35
+ | `list_formulas` | Registry index, or all formulas of a category |
36
+
37
+ Metric units (kg, cm), adults 18–100.
38
+
39
+ ## Install
40
+
41
+ Claude Desktop / Claude Code / Cursor (`mcpServers` config):
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "wimsta": { "command": "npx", "args": ["-y", "wimsta-mcp"] }
47
+ }
48
+ }
49
+ ```
50
+
51
+ Claude Code: `claude mcp add wimsta -- npx -y wimsta-mcp`
52
+
53
+ Requires Node.js 18+.
54
+
55
+ ## Example
56
+
57
+ > "I'm a 35-year-old woman, 168 cm, 65 kg, moderately active. How many calories do I burn a day?"
58
+
59
+ The assistant calls `tdee` and answers with a range (about 2,100–2,200 kcal/day), names the
60
+ formulas behind it and links to each one.
61
+
62
+ ## Why ranges
63
+
64
+ Every body-composition and energy formula was fitted on a particular population and carries an
65
+ error of several percent. Showing the spread between validated equations is more honest than
66
+ picking one. See the [WIMSTA methodology](https://wimsta.com/registry/).
67
+
68
+ ## Disclaimer
69
+
70
+ Estimates, not diagnoses. These tools are for general information and are not a substitute for
71
+ professional medical advice. Talk to a doctor before acting on any result.
72
+
73
+ ## License
74
+
75
+ Code: MIT. Formula registry data: CC BY 4.0, cite as "WIMSTA (wimsta.com)".
package/index.js ADDED
@@ -0,0 +1,181 @@
1
+ #!/usr/bin/env node
2
+ // WIMSTA MCP server: 17 evidence-based body and fitness calculators (BMI, body fat, BMR, TDEE,
3
+ // ideal weight, protein, water, max heart rate, VO2max, one-rep max, running pace…) and the open WIMSTA formula registry.
4
+ // Every number comes from the public WIMSTA Calculation API (https://wimsta.com/tools/#calculation-api),
5
+ // so results always match the calculators on wimsta.com. No API key, no tracking.
6
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
8
+ import { z } from 'zod';
9
+ import { readFileSync } from 'node:fs';
10
+
11
+ const BASE = (process.env.WIMSTA_BASE_URL || 'https://wimsta.com').replace(/\/$/, '');
12
+ const { version } = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
13
+ const UA = `wimsta-mcp/${version} (+https://github.com/getwimsta/wimsta-mcp)`;
14
+
15
+ async function call(path, params = {}) {
16
+ const qs = new URLSearchParams();
17
+ for (const [k, v] of Object.entries(params)) if (v !== undefined && v !== null) qs.set(k, String(v));
18
+ const url = `${BASE}${path}${qs.size ? `?${qs}` : ''}`;
19
+ for (let attempt = 0; attempt < 3; attempt++) {
20
+ const res = await fetch(url, { headers: { 'User-Agent': UA, Accept: 'application/json' } });
21
+ if (res.status === 429 && attempt < 2) {
22
+ const wait = Math.min(Number(res.headers.get('retry-after')) || 1, 5);
23
+ await new Promise((r) => setTimeout(r, wait * 1000 + 250));
24
+ continue;
25
+ }
26
+ const text = await res.text();
27
+ let body;
28
+ try { body = JSON.parse(text); } catch { body = { error: text.slice(0, 300) }; }
29
+ return { ok: res.ok, status: res.status, body };
30
+ }
31
+ }
32
+
33
+ const asResult = ({ ok, status, body }) => ({
34
+ isError: !ok,
35
+ content: [{ type: 'text', text: ok ? JSON.stringify(body, null, 2) : `WIMSTA API error ${status}: ${body.error || JSON.stringify(body)}` }],
36
+ });
37
+
38
+ const sex = z.enum(['female', 'male']).describe('Biological sex used by the published equations');
39
+ const weight = z.number().min(20).max(350).describe('Body weight in kilograms');
40
+ const height = z.number().min(100).max(250).describe('Height in centimetres');
41
+ const age = z.number().int().min(18).max(100).describe('Age in years (adults only)');
42
+ const cm = (lo, hi, what) => z.number().min(lo).max(hi).optional().describe(`${what}, centimetres`);
43
+
44
+ const server = new McpServer({ name: 'wimsta', version });
45
+
46
+ const NOTE = ' Returns a range across several published formulas (not one number), the formulas used with links, page_url (the matching calculator page on wimsta.com, worth sharing with the user), and a medical disclaimer. Estimates, not diagnoses.';
47
+
48
+ server.registerTool('bmi', {
49
+ title: 'BMI (range)',
50
+ description: 'Body Mass Index as a range: classic Quetelet BMI and Trefethen "new BMI", with the WHO category.' + NOTE,
51
+ inputSchema: { weight_kg: weight, height_cm: height },
52
+ }, async (a) => asResult(await call('/api/calc/bmi', a)));
53
+
54
+ server.registerTool('body_fat', {
55
+ title: 'Body fat % (range)',
56
+ description: 'Body-fat percentage as a range across every validated formula the given measurements allow (Deurenberg, CUN-BAE, US Navy, RFM, Covert Bailey), with the Gallagher category. Give as many optional measurements as you have.' + NOTE,
57
+ inputSchema: {
58
+ sex, height_cm: height,
59
+ weight_kg: weight.optional(), age: age.optional(),
60
+ waist_cm: cm(45, 160, 'Natural waist'),
61
+ abdomen_cm: cm(50, 170, 'Abdomen at the navel (US Navy, men)'),
62
+ neck_cm: cm(20, 60, 'Neck'), hip_cm: cm(60, 180, 'Hips'),
63
+ wrist_cm: cm(10, 25, 'Wrist'), forearm_cm: cm(15, 45, 'Forearm'),
64
+ thigh_cm: cm(30, 90, 'Thigh'), calf_cm: cm(20, 60, 'Calf'),
65
+ },
66
+ }, async (a) => asResult(await call('/api/calc/body-fat', a)));
67
+
68
+ const bmrShape = {
69
+ sex, weight_kg: weight, height_cm: height, age,
70
+ body_fat_pct: z.number().min(3).max(65).optional().describe('Body-fat %, if known (adds Katch–McArdle)'),
71
+ };
72
+
73
+ server.registerTool('bmr', {
74
+ title: 'Basal metabolic rate (range)',
75
+ description: 'Basal metabolic rate in kcal/day as a range: Mifflin–St Jeor, Harris–Benedict 1984 and 1919, WHO/FAO, plus Katch–McArdle when body-fat % is given.' + NOTE,
76
+ inputSchema: bmrShape,
77
+ }, async (a) => asResult(await call('/api/calc/bmr', a)));
78
+
79
+ server.registerTool('tdee', {
80
+ title: 'Daily calorie needs / TDEE (range)',
81
+ description: 'Total daily energy expenditure (maintenance calories, kcal/day) = the BMR range × an activity multiplier.' + NOTE,
82
+ inputSchema: {
83
+ ...bmrShape,
84
+ activity: z.enum(['sedentary', 'light', 'moderate', 'extra', 'extreme']).describe('Activity level'),
85
+ },
86
+ }, async (a) => asResult(await call('/api/calc/tdee', a)));
87
+
88
+ server.registerTool('max_heart_rate', {
89
+ title: 'Maximum heart rate and training zones',
90
+ description: 'Maximum heart rate (bpm) as a range across nine published formulas (Fox, Tanaka, Gulati, Gellish, Nes and others) plus five training zones.' + NOTE,
91
+ inputSchema: { age, sex: sex.optional() },
92
+ }, async (a) => asResult(await call('/api/calc/max-heart-rate', a)));
93
+
94
+ server.registerTool('waist_to_height', {
95
+ title: 'Waist-to-height ratio',
96
+ description: 'Waist-to-height ratio (a measurement, not an estimate) with the Ashwell zone and the healthy waist range for the given height. Includes a medical disclaimer.',
97
+ inputSchema: { waist_cm: z.number().min(45).max(160).describe('Natural waist, centimetres'), height_cm: height },
98
+ }, async (a) => asResult(await call('/api/calc/waist-to-height', a)));
99
+
100
+ const bf = z.number().min(3).max(65).describe('Body-fat %');
101
+ const tool = (name, title, description, inputSchema, path) =>
102
+ server.registerTool(name, { title, description, inputSchema }, async (a) => asResult(await call(path, a)));
103
+
104
+ tool('ideal_weight', 'Ideal body weight (range)',
105
+ 'Ideal body weight as a range across seven classic formulas (Hamwi, Devine, Robinson, Miller, Broca, Lorentz, Peterson) plus the WHO healthy-weight range for the height.' + NOTE,
106
+ { sex, height_cm: height }, '/api/calc/ideal-weight');
107
+
108
+ tool('ffmi', 'Fat-Free Mass Index',
109
+ 'Fat-Free Mass Index (lean mass for height), raw and normalized to 1.8 m, with a neutral descriptive band. Needs body-fat %.' + NOTE,
110
+ { sex, weight_kg: weight, height_cm: height, body_fat_pct: bf }, '/api/calc/ffmi');
111
+
112
+ tool('body_surface_area', 'Body surface area (range)',
113
+ 'Body surface area in m² as a range across eight formulas (Mosteller, Du Bois, Haycock, Gehan–George, Boyd, Fujimoto, Takahira, Schlich).' + NOTE,
114
+ { sex, weight_kg: weight, height_cm: height }, '/api/calc/bsa');
115
+
116
+ tool('body_shape', 'Body shape type',
117
+ 'Body-shape type (hourglass, pear, inverted triangle, rectangle, apple) from bust/chest, waist and hip ratios. A descriptive label, not a health verdict.',
118
+ { bust_cm: z.number().min(60).max(160).describe('Bust (chest for men), centimetres'), waist_cm: z.number().min(45).max(160).describe('Natural waist, centimetres'), hip_cm: z.number().min(60).max(180).describe('Hips, centimetres') },
119
+ '/api/calc/body-shape');
120
+
121
+ tool('body_frame', 'Body frame size',
122
+ 'Body-frame size (small / medium / large) from the height ÷ wrist ratio (Grant cut points). A rule of thumb, not a clinical measure.',
123
+ { sex, height_cm: height, wrist_cm: z.number().min(10).max(25).describe('Wrist circumference, centimetres') }, '/api/calc/body-frame');
124
+
125
+ tool('protein', 'Daily protein (range)',
126
+ 'Daily protein in g/day as bands: RDA minimum, active adults, deficit/muscle preservation, and per kg of lean mass when body-fat % is given.' + NOTE,
127
+ { weight_kg: weight, body_fat_pct: bf.optional() }, '/api/calc/protein');
128
+
129
+ const flag = (what) => z.boolean().optional().describe(`Adds a fixed drinking-water bump for ${what}`);
130
+ tool('water', 'Daily water intake (range)',
131
+ 'Daily water need in ml and litres as a range across five authorities (IOM, WHO, EFSA, FNB, sports medicine), with optional lifestyle add-ons.' + NOTE,
132
+ {
133
+ sex, weight_kg: weight,
134
+ activity: z.enum(['sedentary', 'light', 'active', 'moderate', 'very', 'extra', 'extreme']).describe('Activity level'),
135
+ calorie_norm_kcal: z.number().min(800).max(6000).optional().describe('Daily calories, sharpens the FNB source'),
136
+ coffee: flag('coffee'), alcohol: flag('alcohol'), protein_diet: flag('a high-protein diet'), workouts: flag('workouts'),
137
+ hot_climate: flag('a hot climate'), pregnancy: flag('pregnancy'), breastfeeding: flag('breastfeeding'), illness: flag('illness'),
138
+ }, '/api/calc/water');
139
+
140
+ tool('creatine', 'Creatine dose (range)',
141
+ 'Creatine monohydrate dose from body weight: maintenance range (g/day) and the optional loading route, from the ISSN position stand. Not a prescription.',
142
+ { weight_kg: weight }, '/api/calc/creatine');
143
+
144
+ tool('one_rep_max', 'One-rep max (range)',
145
+ 'Estimated one-rep max as a range across Epley, Brzycki, Lombardi and Lander, the median, and a percent-of-1RM training table. Less precise above ~12 reps (flagged).',
146
+ { weight_lifted_kg: z.number().min(1).max(1000).describe('Weight lifted, kilograms'), reps: z.number().int().min(1).max(36).describe('Repetitions completed') },
147
+ '/api/calc/one-rep-max');
148
+
149
+ tool('vo2max', 'VO2max estimate (range)',
150
+ 'VO2max (ml/kg/min) as a range across the field methods you give data for: Uth heart-rate ratio, Cooper 12-minute run, Rockport 1-mile walk. Typically ±10–15% of a lab value.' + NOTE,
151
+ {
152
+ hr_rest_bpm: z.number().min(30).max(120).optional().describe('Resting heart rate (Uth; needs hr_max_bpm, or age + sex)'),
153
+ hr_max_bpm: z.number().min(120).max(230).optional().describe('Measured max heart rate (Uth)'),
154
+ cooper_m: z.number().min(600).max(5000).optional().describe('Metres covered in a 12-minute run (Cooper)'),
155
+ walk_min: z.number().min(5).max(60).optional().describe('Minutes to walk 1 mile (Rockport; also needs finish_hr_bpm, weight_kg, age, sex)'),
156
+ finish_hr_bpm: z.number().min(50).max(230).optional().describe('Heart rate at the end of the walk (Rockport)'),
157
+ weight_kg: weight.optional(), age: age.optional(), sex: sex.optional(),
158
+ }, '/api/calc/vo2max');
159
+
160
+ tool('running_pace', 'Running pace, time, distance',
161
+ 'Running pace solver: give any two of distance, time and pace to get the third plus speed. Optionally predicts a race time at another distance as a range (Riegel 1.06–1.08).',
162
+ {
163
+ distance_km: z.number().min(0.1).max(1000).optional().describe('Distance, km'),
164
+ time_min: z.number().min(0.5).max(6000).optional().describe('Time in decimal minutes, e.g. 25.5'),
165
+ pace_min_per_km: z.number().min(1).max(60).optional().describe('Pace in decimal minutes per km, e.g. 5.5'),
166
+ target_distance_km: z.number().min(0.1).max(1000).optional().describe('Predict a race time at this distance'),
167
+ }, '/api/calc/running-pace');
168
+
169
+ server.registerTool('get_formula', {
170
+ title: 'Look up a formula in the WIMSTA registry',
171
+ description: 'Get one formula from the open WIMSTA formula registry (CC BY 4.0): equation, original study citation, population it was validated on, known limitations. Call list_formulas first to find ids.',
172
+ inputSchema: { id: z.string().min(1).describe('Formula id, e.g. "cun-bae", "tanaka", "harris-benedict-1984"') },
173
+ }, async ({ id }) => asResult(await call('/api/formulas', { id })));
174
+
175
+ server.registerTool('list_formulas', {
176
+ title: 'List formulas in the WIMSTA registry',
177
+ description: 'List the formulas in the open WIMSTA formula registry (CC BY 4.0), optionally filtered by category. Without a category returns the index of ids and categories.',
178
+ inputSchema: { category: z.string().optional().describe('Category to filter by, one of body-fat, body-fat-ranges, bmi, waist-to-height, max-heart-rate, bmr; omit for the full index') },
179
+ }, async ({ category }) => asResult(await call('/api/formulas', { category })));
180
+
181
+ await server.connect(new StdioServerTransport());
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "wimsta-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "MCP server with 17 evidence-based body and fitness calculators: BMI, body fat %, BMR, TDEE, ideal weight, protein, water, max heart rate, VO2max, one-rep max, running pace and more, as honest ranges across published formulas, plus the open WIMSTA formula registry. No API key.",
5
+ "mcpName": "io.github.getwimsta/wimsta",
6
+ "type": "module",
7
+ "bin": {
8
+ "wimsta-mcp": "index.js"
9
+ },
10
+ "main": "index.js",
11
+ "files": [
12
+ "index.js",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "dependencies": {
20
+ "@modelcontextprotocol/sdk": "^1.32.2",
21
+ "zod": "^4.0.0"
22
+ },
23
+ "keywords": [
24
+ "bmi",
25
+ "bmr",
26
+ "body-fat",
27
+ "calorie-calculator",
28
+ "creatine",
29
+ "fitness",
30
+ "health",
31
+ "heart-rate",
32
+ "ideal-weight",
33
+ "mcp",
34
+ "model-context-protocol",
35
+ "nutrition",
36
+ "one-rep-max",
37
+ "protein",
38
+ "running-pace",
39
+ "tdee",
40
+ "vo2max",
41
+ "water-intake"
42
+ ],
43
+ "homepage": "https://wimsta.com/tools/#calculation-api",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/getwimsta/wimsta-mcp.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/getwimsta/wimsta-mcp/issues"
50
+ },
51
+ "author": "WIMSTA (https://wimsta.com)",
52
+ "license": "MIT"
53
+ }