@indaco/garmin-personal-mcp 0.1.1 → 0.2.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 +99 -93
- package/dist/dashboard.html +1 -1
- package/dist/index.js +2339 -481
- package/package.json +1 -1
- package/prompts/dashboard-setup.md +3 -3
- package/prompts/training-dashboard-freeform.md +4 -0
- package/prompts/training-dashboard.md +8 -0
package/README.md
CHANGED
|
@@ -18,49 +18,59 @@
|
|
|
18
18
|
|
|
19
19
|
<p align="center">
|
|
20
20
|
<b><a href="#quick-start">Quick start</a></b> ·
|
|
21
|
-
<b><a href="#
|
|
22
|
-
<b><a href="#dashboard-setup">Dashboard setup</a></b> ·
|
|
21
|
+
<b><a href="#what-you-can-ask">What you can ask</a></b> ·
|
|
23
22
|
<b><a href="#tools">Tools</a></b> ·
|
|
24
|
-
<b><a href="#
|
|
25
|
-
<b><a href="guide/dashboard.md">Dashboard guide</a></b> ·
|
|
23
|
+
<b><a href="#dashboard">Dashboard</a></b> ·
|
|
26
24
|
<b><a href="guide/how-it-works.md">How it works</a></b> ·
|
|
27
25
|
<b><a href="guide/troubleshooting.md">Troubleshooting</a></b>
|
|
28
26
|
</p>
|
|
29
27
|
|
|
28
|
+
<p align="center">
|
|
29
|
+
An MCP server that lets your assistant read your Garmin data: activities, laps, strength sets,
|
|
30
|
+
sleep, HRV and more. Ask questions in the chat, or let the server build a training dashboard.
|
|
31
|
+
</p>
|
|
32
|
+
|
|
30
33
|
<p align="center">
|
|
31
34
|
<img src="assets/dashboard.gif" alt="The training dashboard: the All board, load against recovery, the Run board, strength trends, edit mode (drag a widget to a new place, hide a widget, add widgets from the catalogue to an empty board), and the light and high-contrast themes" width="800">
|
|
32
35
|
</p>
|
|
33
36
|
<p align="center">
|
|
34
|
-
<sub><i>
|
|
37
|
+
<sub><i>One thing you can build: the training dashboard, with demo data.</i></sub>
|
|
35
38
|
</p>
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
## What you can ask
|
|
41
|
+
|
|
42
|
+
With this server, you can ask your assistant:
|
|
43
|
+
|
|
44
|
+
- Activities: "List my last 5 activities, with pace and heart rate."
|
|
45
|
+
- Activities: "How much time did I spend in each HR zone on my runs this month?"
|
|
46
|
+
- Laps: "Show the laps of my last run."
|
|
47
|
+
- Strength: "Compare my sets of this week with the week before."
|
|
48
|
+
- Strength: "Which muscles did I train most this week?"
|
|
49
|
+
- Workouts: "Did I do the reps and rests my workout planned?"
|
|
50
|
+
- Recovery: "How did I sleep this week, and how was my HRV?"
|
|
51
|
+
- Recovery: "Show my steps, stress and Body Battery for the last 7 days."
|
|
52
|
+
- Recovery: "Did my Body Battery recover overnight this week, and which days drained it most?"
|
|
53
|
+
- Body: "How has my weight changed over the last 3 months?"
|
|
54
|
+
- All together: "My run on Saturday felt hard. Compare it with my sleep and HRV of the nights
|
|
55
|
+
before."
|
|
38
56
|
|
|
39
57
|
## Features
|
|
40
58
|
|
|
41
59
|
- **Official and read-only**: uses the Garmin Connect Personal API. It writes nothing back.
|
|
42
60
|
- **Nothing to install**: runs with `npx`.
|
|
43
|
-
- **Laps and strength sets**: read from the original .FIT files.
|
|
44
|
-
- **Recovery data**: HRV, sleep and
|
|
45
|
-
- **
|
|
46
|
-
|
|
47
|
-
[let the assistant design the whole page](#presets-or-freeform).
|
|
48
|
-
- **Your layout stays**: [training-dashboard-update](#training-dashboard-update) adds only the
|
|
49
|
-
new data.
|
|
50
|
-
- **A page for you or for your coach**: [dashboard-setup](#dashboard-setup) makes a personal page,
|
|
51
|
-
or a page to share with your coach or personal trainer. You select the sports and the data. The
|
|
52
|
-
data that you do not select is not in the file.
|
|
53
|
-
- **Extend it**: [dashboard-widget](#dashboard-widget) makes a new widget from your idea.
|
|
54
|
-
[dashboard-language](#dashboard-language) adds a language.
|
|
61
|
+
- **Laps and strength sets**: read from the original .FIT files, with the muscles of each set.
|
|
62
|
+
- **Recovery data**: HRV, sleep, heart rate, stress and Body Battery.
|
|
63
|
+
- **All of the Personal API**: [`garminGet`](#tools) reads the endpoints that have no tool of
|
|
64
|
+
their own.
|
|
55
65
|
- **All stdio clients**: Claude Desktop, Claude Code, Codex and all other MCP clients that use
|
|
56
66
|
stdio. Tested with Claude Desktop and Claude Code.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
-
|
|
67
|
+
- **Dashboard in less than a minute**: [training-dashboard](#training-dashboard) shows your
|
|
68
|
+
training load next to recovery, in widgets that you can move, resize, hide and add.
|
|
69
|
+
[training-dashboard-update](#training-dashboard-update) adds only the new data, and your layout
|
|
70
|
+
stays.
|
|
71
|
+
- **Dashboard for you or for your coach**: [dashboard-setup](#dashboard-setup) makes a page with
|
|
72
|
+
only the sports and the data that you select. [dashboard-widget](#dashboard-widget) and
|
|
73
|
+
[dashboard-language](#dashboard-language) add a widget or a language.
|
|
64
74
|
|
|
65
75
|
## Quick start
|
|
66
76
|
|
|
@@ -136,15 +146,46 @@ show MCP prompts. In these clients, ask for the dashboard in your own words. The
|
|
|
136
146
|
Ask "list my last 5 activities". The first time that a garmin-personal tool asks for permission, answer
|
|
137
147
|
**Allow always** in Claude Desktop. In Claude Code, use `/permissions` and add `mcp__garmin-personal`.
|
|
138
148
|
|
|
139
|
-
##
|
|
149
|
+
## Tools
|
|
140
150
|
|
|
141
|
-
|
|
142
|
-
|
|
151
|
+
| Tool | What it gives |
|
|
152
|
+
| --------------------- | ---------------------------------------------------------------------- |
|
|
153
|
+
| `listActivities` | a summary of each activity, with pace, HR, training load and effect |
|
|
154
|
+
| `getActivity` | the details of one activity |
|
|
155
|
+
| `getActivityLaps` | the laps of an activity, from its .FIT file |
|
|
156
|
+
| `getActivitySets` | the strength sets of an activity, with the muscles, from its .FIT file |
|
|
157
|
+
| `getActivityWorkouts` | the planned workout of an activity: steps, targets and notes |
|
|
158
|
+
| `downloadActivityFit` | saves the .FIT file of an activity in the data folder |
|
|
159
|
+
| `getHrvRange` | HRV during the night |
|
|
160
|
+
| `getDailyHeartRate` | the heart rate of a day, with the resting HR |
|
|
161
|
+
| `getSleep` | the sleep of a night, or of up to 14 nights |
|
|
162
|
+
| `getWeight` | weight and body composition for a range of dates |
|
|
163
|
+
| `getBodyBattery` | how Body Battery charged and drained, for up to 14 days |
|
|
164
|
+
| `getHeartRateZones` | your HR zones |
|
|
165
|
+
| `getFitnessAge` | fitness age against actual age |
|
|
166
|
+
| `getDailySummary` | steps, stress and Body Battery, for a day or a range |
|
|
167
|
+
| `getDashboardData` | all the data of the dashboard in one call, with a local cache |
|
|
168
|
+
| `writeDashboard` | writes the dashboard page |
|
|
169
|
+
| `editDashboard` | changes the layout, the custom widgets and the languages of the page |
|
|
170
|
+
| `garminGet` | all other GET endpoints of the Personal API |
|
|
143
171
|
|
|
144
|
-
|
|
172
|
+
[Tools](guide/tools.md) gives the endpoints, the details of each tool and the data that the
|
|
173
|
+
Personal API does not have.
|
|
174
|
+
|
|
175
|
+
## Dashboard
|
|
176
|
+
|
|
177
|
+
The server makes a training dashboard with these prompts. In Claude Desktop, the prompts are in
|
|
178
|
+
the **+** menu of the message box, under _garmin-personal_. In Claude Code, they are slash commands.
|
|
145
179
|
|
|
146
|
-
|
|
147
|
-
|
|
180
|
+
| Prompt | What it does | Claude Code example |
|
|
181
|
+
| ------------------------------------------------------- | -------------------------------------- | --------------------------------------------------- |
|
|
182
|
+
| [training-dashboard](#training-dashboard) | makes the page | `/garmin-personal:training-dashboard 8` |
|
|
183
|
+
| [training-dashboard-update](#training-dashboard-update) | adds the new data, your layout stays | `/garmin-personal:training-dashboard-update` |
|
|
184
|
+
| [dashboard-setup](#dashboard-setup) | makes a page for you or for your coach | `/garmin-personal:dashboard-setup` |
|
|
185
|
+
| [dashboard-widget](#dashboard-widget) | makes a new widget from your idea | `/garmin-personal:dashboard-widget my longest ride` |
|
|
186
|
+
| [dashboard-language](#dashboard-language) | adds a language to the page | `/garmin-personal:dashboard-language German` |
|
|
187
|
+
|
|
188
|
+
The prompts remove all spaces around an argument, also the no-break space from a phone keyboard.
|
|
148
189
|
|
|
149
190
|
### training-dashboard
|
|
150
191
|
|
|
@@ -161,18 +202,16 @@ The page is one HTML file, `garmin-dashboard.html` in the data folder. It works
|
|
|
161
202
|
- `freeform` lets the assistant design the whole page. This takes much longer, and each page looks
|
|
162
203
|
different.
|
|
163
204
|
|
|
164
|
-
| Client | How to run it |
|
|
165
|
-
| -------------- | --------------------------------------------------------------------------- |
|
|
166
|
-
| Claude Desktop | **+** → _garmin-personal_ → `training-dashboard` → set the arguments → send |
|
|
167
|
-
| Claude Code | `/garmin-personal:training-dashboard 8` |
|
|
168
|
-
|
|
169
205
|
In Claude Code, the arguments are in order and separated by spaces: first `weeks`, then `layout`.
|
|
170
206
|
You can also give only the layout: `/garmin-personal:training-dashboard freeform`.
|
|
171
207
|
|
|
172
208
|
The assistant gives you the path of the page and the command to open it. The page has a board for
|
|
173
|
-
all your training, a Recovery board and a board for each sport, with 11 themes
|
|
174
|
-
|
|
175
|
-
|
|
209
|
+
all your training, a Recovery board and a board for each sport, with 11 themes, in English and the
|
|
210
|
+
language of your Garmin profile. The assistant asks if you want one more language. The page uses
|
|
211
|
+
the training load, HR zones and training effect from Garmin. It labels each value that it
|
|
212
|
+
calculates as an estimate, and a missing value shows as "n/a". Distances, paces,
|
|
213
|
+
elevation and weights use the units of your Garmin profile: metric, or miles and pounds for
|
|
214
|
+
Statute US and Statute UK (Statute UK keeps elevation in metres).
|
|
176
215
|
|
|
177
216
|
[The dashboard guide](guide/dashboard.md) tells what each board shows and how to change the layout.
|
|
178
217
|
[The widget catalogue](guide/widgets.md) lists every widget.
|
|
@@ -190,11 +229,6 @@ your languages stay. Reload the page to see the new data.
|
|
|
190
229
|
In Claude Code: `/garmin-personal:training-dashboard-update coach.html` updates `coach.html`. A
|
|
191
230
|
value that ends in `.html` is the file, also in the first place.
|
|
192
231
|
|
|
193
|
-
| Client | How to run it |
|
|
194
|
-
| -------------- | -------------------------------------------------------------- |
|
|
195
|
-
| Claude Desktop | **+** → _garmin-personal_ → `training-dashboard-update` → send |
|
|
196
|
-
| Claude Code | `/garmin-personal:training-dashboard-update` |
|
|
197
|
-
|
|
198
232
|
The first call sends approximately 35 requests to Garmin. Later calls use the local cache and send
|
|
199
233
|
approximately 8.
|
|
200
234
|
|
|
@@ -213,11 +247,6 @@ is not in the file, so you can send the file safely. A personal page and a share
|
|
|
213
247
|
files side by side. Each page keeps its settings on each update. The argument `weeks` is optional
|
|
214
248
|
(default 12).
|
|
215
249
|
|
|
216
|
-
| Client | How to run it |
|
|
217
|
-
| -------------- | ---------------------------------------------------- |
|
|
218
|
-
| Claude Desktop | **+** → _garmin-personal_ → `dashboard-setup` → send |
|
|
219
|
-
| Claude Code | `/garmin-personal:dashboard-setup` |
|
|
220
|
-
|
|
221
250
|
[Page settings](guide/dashboard.md#page-settings) tells more.
|
|
222
251
|
|
|
223
252
|
### dashboard-widget
|
|
@@ -240,28 +269,21 @@ text without a translation shows in English. To remove an added language, ask yo
|
|
|
240
269
|
remove it: `editDashboard` with `removeLanguages`.
|
|
241
270
|
[Languages](guide/languages.md) tells more.
|
|
242
271
|
|
|
243
|
-
|
|
272
|
+
### Presets or freeform
|
|
244
273
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
| `getActivityLaps` | the laps of an activity, from its .FIT file |
|
|
250
|
-
| `getActivitySets` | the strength sets of an activity, with the muscles, from its .FIT file |
|
|
251
|
-
| `downloadActivityFit` | saves the .FIT file of an activity in the data folder |
|
|
252
|
-
| `getHrvRange` | HRV during the night |
|
|
253
|
-
| `getDailyHeartRate` | the heart rate of a day, with the resting HR |
|
|
254
|
-
| `getSleep` | the sleep of a night, or of up to 14 nights |
|
|
255
|
-
| `getHeartRateZones` | your HR zones |
|
|
256
|
-
| `getFitnessAge` | fitness age against actual age |
|
|
257
|
-
| `getDailySummary` | steps, stress and Body Battery, for a day or a range |
|
|
258
|
-
| `getDashboardData` | all the data of the dashboard in one call, with a local cache |
|
|
259
|
-
| `writeDashboard` | writes the dashboard page |
|
|
260
|
-
| `editDashboard` | changes the layout, the custom widgets and the languages of the page |
|
|
261
|
-
| `garminGet` | all other GET endpoints of the Personal API |
|
|
274
|
+
In many setup guides for Claude and Garmin, Claude reads the data and writes the whole dashboard
|
|
275
|
+
page. With a preset, the server writes the page from a tested template, and Claude writes only the
|
|
276
|
+
coach notes. My measurements for a first build, with Claude Code and Opus
|
|
277
|
+
(other clients and models give other times and costs):
|
|
262
278
|
|
|
263
|
-
|
|
264
|
-
|
|
279
|
+
| First build | Time | Cost |
|
|
280
|
+
| ---------------------- | ------------ | ------------ |
|
|
281
|
+
| Preset | 34 s | $0.16 |
|
|
282
|
+
| Claude writes the page | 24 to 35 min | $6.6 to $9.2 |
|
|
283
|
+
|
|
284
|
+
For a design of your own, use `layout` = `freeform`: Claude writes the page, as in those guides.
|
|
285
|
+
|
|
286
|
+
[Presets or freeform](guide/presets.md) gives the measurements and the limits of the presets.
|
|
265
287
|
|
|
266
288
|
## Configuration
|
|
267
289
|
|
|
@@ -285,22 +307,6 @@ In Claude Code, add `--env GARMIN_DATA_DIR=/path/to/garmin-data` to `claude mcp
|
|
|
285
307
|
[The data folder](guide/tools.md#the-data-folder) lists the files that the server keeps and its
|
|
286
308
|
log.
|
|
287
309
|
|
|
288
|
-
## Presets or freeform
|
|
289
|
-
|
|
290
|
-
In many setup guides for Claude and Garmin, Claude reads the data and writes the whole dashboard
|
|
291
|
-
page. With a preset, the server writes the page from a tested template, and Claude writes only the
|
|
292
|
-
coach notes. My measurements for a first build, with Claude Code and Opus
|
|
293
|
-
(other clients and models give other times and costs):
|
|
294
|
-
|
|
295
|
-
| First build | Time | Cost |
|
|
296
|
-
| ---------------------- | ------------ | ------------ |
|
|
297
|
-
| Preset | 34 s | $0.16 |
|
|
298
|
-
| Claude writes the page | 24 to 35 min | $6.6 to $9.2 |
|
|
299
|
-
|
|
300
|
-
For a design of your own, use `layout` = `freeform`: Claude writes the page, as in those guides.
|
|
301
|
-
|
|
302
|
-
[Presets or freeform](guide/presets.md) gives the measurements and the limits of the presets.
|
|
303
|
-
|
|
304
310
|
## Security
|
|
305
311
|
|
|
306
312
|
The server is read-only. It sends the API key only to the Garmin token endpoint, and it never logs
|
|
@@ -339,17 +345,17 @@ To build a demo site with a year of sample data, run `pnpm build`, then
|
|
|
339
345
|
The idea comes from [apratico/garmin-mcp](https://github.com/apratico/garmin-mcp) by Alessandro
|
|
340
346
|
Praticò: a Java MCP server for the Garmin Personal API, where Claude writes the dashboard. I
|
|
341
347
|
tested it in a fork, [indaco/garmin-mcp](https://github.com/indaco/garmin-mcp), and then made this
|
|
342
|
-
server as a different solution
|
|
343
|
-
|
|
344
|
-
- **No Java**: the server runs with `npx`. You do not need Java 21 and a jar file.
|
|
345
|
-
- **The server writes the page**: in garmin-mcp, Claude writes all of the dashboard HTML on each run. Here the server fills a tested template, and Claude writes only the coach notes. A first build takes seconds, not minutes ([measurements](#presets-or-freeform)).
|
|
346
|
-
- **Updates keep your page**: [training-dashboard-update](#training-dashboard-update) adds only the new data, and your layout stays.
|
|
347
|
-
- **Widgets that you control**: charts for training load, recovery, running and strength. In the page, you drag, resize, hide and add widgets, and select a theme.
|
|
348
|
-
- **Setup by sport**: [dashboard-setup](#dashboard-setup) makes a page with only the sports and the data that you select, for you or for your coach.
|
|
349
|
-
- **Languages and custom widgets**: [dashboard-language](#dashboard-language) and [dashboard-widget](#dashboard-widget) extend the page.
|
|
348
|
+
server as a different solution. It runs with `npx`, without Java, and it writes the dashboard page
|
|
349
|
+
from a tested template.
|
|
350
350
|
|
|
351
351
|
This server uses the same key file as indaco/garmin-mcp and can share its data folder.
|
|
352
352
|
|
|
353
|
+
## How this was built
|
|
354
|
+
|
|
355
|
+
AI agents in Claude Code wrote the code, tests and docs of this project. I chose the design,
|
|
356
|
+
reviewed each change and tested the server with my own Garmin data. The rules that the agents
|
|
357
|
+
follow are in [AGENTS.md](AGENTS.md).
|
|
358
|
+
|
|
353
359
|
## License
|
|
354
360
|
|
|
355
361
|
This project uses the [MIT License](LICENSE). `dist/index.js` and the dashboard page include
|