@indaco/garmin-personal-mcp 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alessandro Praticò
4
+ Copyright (c) 2026 indaco
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,356 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">
2
+ <img src="assets/logo.svg" alt="" width="48" align="absmiddle" />
3
+ garmin-personal-mcp
4
+ </h1>
2
5
 
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.
6
+ <p align="center"><b>Your Garmin training in Claude, Codex or any MCP client, through the official Personal API. Read-only, nothing to install.</b></p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/@indaco/garmin-personal-mcp"><img src="https://img.shields.io/npm/v/@indaco/garmin-personal-mcp.svg" alt="npm version" /></a>
10
+ <a href="https://codecov.io/gh/indaco/garmin-personal-mcp"><img src="https://codecov.io/gh/indaco/garmin-personal-mcp/branch/main/graph/badge.svg" alt="Code coverage" /></a>
11
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22-brightgreen.svg" alt="Node.js 22 or later" /></a>
12
+ <a href="tsconfig.json"><img src="https://img.shields.io/badge/TypeScript-strict-3178c6.svg" alt="TypeScript strict" /></a>
13
+ <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-stdio%20server-8a2be2.svg" alt="MCP stdio server" /></a>
14
+ <a href="https://developer.garmin.com/gc-developer-program/personal/"><img src="https://img.shields.io/badge/Garmin-Personal%20API-007cc3.svg" alt="Garmin Connect Personal API" /></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT" /></a>
16
+ <a href="https://www.jetify.com/devbox/docs/contributor-quickstart/"><img src="https://www.jetify.com/img/devbox/shield_galaxy.svg" alt="Built with Devbox" /></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <b><a href="#quick-start">Quick start</a></b> &middot;
21
+ <b><a href="#prompts">Prompts</a></b> &middot;
22
+ <b><a href="#dashboard-setup">Dashboard setup</a></b> &middot;
23
+ <b><a href="#tools">Tools</a></b> &middot;
24
+ <b><a href="#presets-or-freeform">Presets or freeform</a></b> &middot;
25
+ <b><a href="guide/dashboard.md">Dashboard guide</a></b> &middot;
26
+ <b><a href="guide/how-it-works.md">How it works</a></b> &middot;
27
+ <b><a href="guide/troubleshooting.md">Troubleshooting</a></b>
28
+ </p>
29
+
30
+ <p align="center">
31
+ <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
+ </p>
33
+ <p align="center">
34
+ <sub><i>The training dashboard with demo data.</i></sub>
35
+ </p>
36
+
37
+ MCP server for the official Garmin Connect Personal API.
38
+
39
+ ## Features
40
+
41
+ - **Official and read-only**: uses the Garmin Connect Personal API. It writes nothing back.
42
+ - **Nothing to install**: runs with `npx`.
43
+ - **Laps and strength sets**: read from the original .FIT files.
44
+ - **Recovery data**: HRV, sleep and heart rate.
45
+ - **Dashboard in less than a minute**: [training-dashboard](#training-dashboard) shows your
46
+ training load next to recovery, in widgets that you can move, resize, hide and add. You can also
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.
55
+ - **All stdio clients**: Claude Desktop, Claude Code, Codex and all other MCP clients that use
56
+ stdio. Tested with Claude Desktop and Claude Code.
57
+
58
+ With this server, you can ask your assistant:
59
+
60
+ - "List my last 5 activities, with pace and heart rate."
61
+ - "Show the laps of my last run."
62
+ - "Compare my sets of this week with the week before."
63
+ - "How did I sleep this week, and how was my HRV?"
64
+
65
+ ## Quick start
66
+
67
+ You need Node.js 22 or later (`node --version` shows the version) and a Garmin Connect account
68
+ with access to the [Personal API](https://developer.garmin.com/gc-developer-program/personal/).
69
+
70
+ ### 1. Create a personal API key
71
+
72
+ 1. Open Garmin Connect web at <https://connect.garmin.com/app/settings/personalApiToken>.
73
+ 2. Select _Create Key_, accept the terms, select the expiry (1 year at most) and select _Create_.
74
+ 3. Garmin shows the key **only one time**. Save it in a file that only you can read:
75
+
76
+ ```bash
77
+ mkdir -p ~/.config/garmin-mcp
78
+ nano ~/.config/garmin-mcp/api-key # paste the key and save
79
+ chmod 600 ~/.config/garmin-mcp/api-key
80
+ ```
81
+
82
+ You can also give the key in the environment variable `GARMIN_PERSONAL_API_KEY`.
83
+
84
+ ### 2. Connect your client
85
+
86
+ **Claude Desktop**: select Settings → Developer → _Edit Config_. Add a top-level `mcpServers` key
87
+ next to the keys that the file has, not in `preferences`:
88
+
89
+ ```json
90
+ {
91
+ "mcpServers": {
92
+ "garmin-personal": {
93
+ "command": "npx",
94
+ "args": ["-y", "@indaco/garmin-personal-mcp@latest"]
95
+ }
96
+ }
97
+ }
98
+ ```
99
+
100
+ Then quit Claude Desktop **fully**, including the tray icon, and start it again.
101
+
102
+ **Claude Code**: this command adds the server to all your projects:
103
+
104
+ ```bash
105
+ claude mcp add garmin-personal --scope user -- npx -y @indaco/garmin-personal-mcp@latest
106
+ claude mcp list # garmin-personal: ... ✔ Connected
107
+ ```
108
+
109
+ Use `--scope project` to write a `.mcp.json` file that you can share in the current repository.
110
+
111
+ **Codex**: this command adds the server:
112
+
113
+ ```bash
114
+ codex mcp add garmin-personal -- npx -y @indaco/garmin-personal-mcp@latest
115
+ ```
116
+
117
+ You can also add it to `~/.codex/config.toml`. The first `npx` download can take longer than the
118
+ default start time, so set a longer one:
119
+
120
+ ```toml
121
+ [mcp_servers.garmin-personal]
122
+ command = "npx"
123
+ args = ["-y", "@indaco/garmin-personal-mcp@latest"]
124
+ startup_timeout_sec = 60
125
+ ```
126
+
127
+ Codex does not send your shell environment to the server. Use the key file, or add
128
+ `env = { GARMIN_PERSONAL_API_KEY = "..." }` to the table.
129
+
130
+ **Other clients** (Gemini CLI, VS Code, Cursor and others): in the MCP configuration of the client,
131
+ set the command `npx` and the arguments `-y @indaco/garmin-personal-mcp@latest`. Some clients do not
132
+ show MCP prompts. In these clients, ask for the dashboard in your own words. The tools are the same.
133
+
134
+ ### 3. Ask your assistant
135
+
136
+ Ask "list my last 5 activities". The first time that a garmin-personal tool asks for permission, answer
137
+ **Allow always** in Claude Desktop. In Claude Code, use `/permissions` and add `mcp__garmin-personal`.
138
+
139
+ ## Prompts
140
+
141
+ In Claude Desktop, the prompts are in the **+** menu of the message box, under _garmin-personal_. In
142
+ Claude Code, they are slash commands such as `/garmin-personal:training-dashboard`.
143
+
144
+ The prompts remove all spaces around an argument, also the no-break space from a phone keyboard.
145
+
146
+ After an update of the server, the prompts and tools change only in a new Claude Code session. In
147
+ Claude Desktop, they change after a full restart.
148
+
149
+ ### training-dashboard
150
+
151
+ The server writes the dashboard page from its template, and the assistant writes the coach notes.
152
+ The page is one HTML file, `garmin-dashboard.html` in the data folder. It works offline.
153
+
154
+ | Argument | Values | Default |
155
+ | -------- | --------------------------------- | -------- |
156
+ | `weeks` | 1 to 52 (a larger value gives 52) | 12 |
157
+ | `layout` | `preset`, `blank` or `freeform` | `preset` |
158
+
159
+ - `preset` gives the built-in widgets on each board.
160
+ - `blank` gives empty boards: you add the widgets that you want.
161
+ - `freeform` lets the assistant design the whole page. This takes much longer, and each page looks
162
+ different.
163
+
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
+ In Claude Code, the arguments are in order and separated by spaces: first `weeks`, then `layout`.
170
+ You can also give only the layout: `/garmin-personal:training-dashboard freeform`.
171
+
172
+ 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 and English and
174
+ Italian texts. It uses the training load, HR zones and training effect from Garmin. It labels each
175
+ value that it calculates as an estimate, and a missing value shows as "n/a".
176
+
177
+ [The dashboard guide](guide/dashboard.md) tells what each board shows and how to change the layout.
178
+ [The widget catalogue](guide/widgets.md) lists every widget.
179
+
180
+ ### training-dashboard-update
181
+
182
+ This prompt replaces the data and the coach notes of the page. Your layout, your custom widgets and
183
+ your languages stay. Reload the page to see the new data.
184
+
185
+ | Argument | Values | Default |
186
+ | -------- | ----------------------------------------------------------------------- | ----------------------- |
187
+ | `weeks` | the weeks to cover | the weeks of the page |
188
+ | `path` | the dashboard file, for example `garmin-dashboard-coach.html` (`.html`) | `garmin-dashboard.html` |
189
+
190
+ In Claude Code: `/garmin-personal:training-dashboard-update coach.html` updates `coach.html`. A
191
+ value that ends in `.html` is the file, also in the first place.
192
+
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
+ The first call sends approximately 35 requests to Garmin. Later calls use the local cache and send
199
+ approximately 8.
200
+
201
+ ### dashboard-setup
202
+
203
+ The assistant asks you some questions, then writes a page with your answers. First, it asks who the
204
+ page is for:
205
+
206
+ - **Personal**: a page for you, with all your data.
207
+ - **Shared**: a page for your coach or personal trainer. You select each type of data to include,
208
+ for example HR zones yes, fitness age and sleep no.
209
+
210
+ Then the assistant asks for the file (any name or path), the title, the headline, the sports, the
211
+ languages and the themes. The server writes only the data that you select into the file. Other data
212
+ is not in the file, so you can send the file safely. A personal page and a shared page can be two
213
+ files side by side. Each page keeps its settings on each update. The argument `weeks` is optional
214
+ (default 12).
215
+
216
+ | Client | How to run it |
217
+ | -------------- | ---------------------------------------------------- |
218
+ | Claude Desktop | **+** → _garmin-personal_ → `dashboard-setup` → send |
219
+ | Claude Code | `/garmin-personal:dashboard-setup` |
220
+
221
+ [Page settings](guide/dashboard.md#page-settings) tells more.
222
+
223
+ ### dashboard-widget
224
+
225
+ This prompt makes a new widget from your idea, for example "my longest ride of each month". The
226
+ assistant writes a small widget, and `editDashboard` stores it in the page. The widget stays after
227
+ each update. The argument `idea` is required. The argument `path` is optional: it is the file of the
228
+ page, for example `coach.html`. In Claude Code:
229
+ `/garmin-personal:dashboard-widget my longest ride each month coach.html`. Reload the page to see
230
+ the widget.
231
+ [Custom widgets](guide/custom-widgets.md) tells more.
232
+
233
+ ### dashboard-language
234
+
235
+ This prompt adds a language to the dashboard. The assistant translates the texts of the page, and
236
+ `editDashboard` stores them in the page. The argument `language` is optional: the default is the
237
+ language of the conversation. The argument `path` is optional: it is the file of the page, for
238
+ example `coach.html`. In Claude Code: `/garmin-personal:dashboard-language German coach.html`. A
239
+ text without a translation shows in English. To remove an added language, ask your assistant to
240
+ remove it: `editDashboard` with `removeLanguages`.
241
+ [Languages](guide/languages.md) tells more.
242
+
243
+ ## Tools
244
+
245
+ | Tool | What it gives |
246
+ | --------------------- | ---------------------------------------------------------------------- |
247
+ | `listActivities` | a summary of each activity, with pace, HR, training load and effect |
248
+ | `getActivity` | the details of one activity |
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 |
262
+
263
+ [Tools](guide/tools.md) gives the endpoints, the details of each tool and the data that the
264
+ Personal API does not have.
265
+
266
+ ## Configuration
267
+
268
+ All the settings are environment variables, and all of them are optional.
269
+
270
+ | Variable | Default | Meaning |
271
+ | ------------------------- | ---------------------------------------- | -------------------------------------------------------- |
272
+ | `GARMIN_PERSONAL_API_KEY` | not set | the personal API key. It has priority over the key file. |
273
+ | `GARMIN_API_KEY_FILE` | `~/.config/garmin-mcp/api-key` | the file with the API key |
274
+ | `GARMIN_DATA_DIR` | `~/workspace/garmin-data` | the data folder |
275
+ | `GARMIN_BASE_URL` | `https://personal.connectapi.garmin.com` | the Personal API host |
276
+
277
+ To set a variable in Claude Desktop, add an `env` object next to `args`:
278
+
279
+ ```json
280
+ "env": { "GARMIN_DATA_DIR": "/absolute/path/to/garmin-data" }
281
+ ```
282
+
283
+ In Claude Code, add `--env GARMIN_DATA_DIR=/path/to/garmin-data` to `claude mcp add`.
284
+
285
+ [The data folder](guide/tools.md#the-data-folder) lists the files that the server keeps and its
286
+ log.
287
+
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
+ ## Security
305
+
306
+ The server is read-only. It sends the API key only to the Garmin token endpoint, and it never logs
307
+ or returns the key or the access token. It refuses a key that has spaces or line breaks in it, and
308
+ it removes the key and the token from network error messages. If you saw your API key in a chat,
309
+ revoke the key on the [API key page](https://connect.garmin.com/app/settings/personalApiToken) and
310
+ create a new one. Your .FIT files can have your GPS track, so keep the data folder private.
311
+
312
+ [SECURITY.md](SECURITY.md) tells how the server protects your data and how to report a
313
+ vulnerability. Do not open a public issue for a vulnerability.
314
+
315
+ The Personal API is for personal use that is not commercial, under the terms of Garmin. Garmin
316
+ does not endorse this project, and the project has no affiliation with Garmin.
317
+
318
+ ## Problems and solutions
319
+
320
+ | Problem | Solution |
321
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
322
+ | The server does not start | Make sure that Node.js is version 22 or later: `node --version`. |
323
+ | Claude Desktop does not find `npx` | GUI apps do not read your shell profile. Use the absolute path of `npx` (`which npx`) as the `command`. |
324
+ | Changes have no effect | The client keeps the old server process. Restart the client: a new Claude Code session, or quit and start Claude Desktop again. |
325
+
326
+ [Problems and solutions](guide/troubleshooting.md) has more problems, the log files, and commands
327
+ that test the key and the server.
328
+
329
+ ## Contributing
330
+
331
+ Read [CONTRIBUTING.md](CONTRIBUTING.md). It tells how to run the server from source, and it has
332
+ the commands, the test rules and the code map.
333
+
334
+ To build a demo site with a year of sample data, run `pnpm build`, then
335
+ `node scripts/demo-data.mjs`. The script writes `demo-site/index.html` and `demo-site/demo-data.json`.
336
+
337
+ ## Credits
338
+
339
+ The idea comes from [apratico/garmin-mcp](https://github.com/apratico/garmin-mcp) by Alessandro
340
+ Praticò: a Java MCP server for the Garmin Personal API, where Claude writes the dashboard. I
341
+ 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.
350
+
351
+ This server uses the same key file as indaco/garmin-mcp and can share its data folder.
352
+
353
+ ## License
354
+
355
+ This project uses the [MIT License](LICENSE). `dist/index.js` and the dashboard page include
356
+ other libraries with their own licenses: [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md) lists them.