@dynamicsninja/garminconnect-mcp 0.7.0 → 0.8.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/NOTICE +16 -16
- package/README.md +155 -36
- package/dist/cli.js +348 -47
- package/dist/cli.js.map +1 -1
- package/package.json +7 -2
package/NOTICE
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
garminconnect-js
|
|
2
|
-
|
|
3
|
-
This project began as a TypeScript port of two MIT-licensed Python projects, and
|
|
4
|
-
still derives substantial parts of its endpoint surface and auth flow from them:
|
|
5
|
-
|
|
6
|
-
python-garminconnect — https://github.com/cyberjunky/python-garminconnect
|
|
7
|
-
Copyright (c) Ron Klinkien and contributors
|
|
8
|
-
|
|
9
|
-
garth — https://github.com/matin/garth
|
|
10
|
-
Copyright (c) Matin Tamizi and contributors
|
|
11
|
-
|
|
12
|
-
The endpoint surface follows python-garminconnect. The SSO and OAuth flow
|
|
13
|
-
follows garth. Neither project is affiliated with this one.
|
|
14
|
-
|
|
15
|
-
Garmin and Garmin Connect are trademarks of Garmin Ltd. This project is not
|
|
16
|
-
affiliated with, endorsed by, or supported by Garmin.
|
|
1
|
+
garminconnect-js
|
|
2
|
+
|
|
3
|
+
This project began as a TypeScript port of two MIT-licensed Python projects, and
|
|
4
|
+
still derives substantial parts of its endpoint surface and auth flow from them:
|
|
5
|
+
|
|
6
|
+
python-garminconnect — https://github.com/cyberjunky/python-garminconnect
|
|
7
|
+
Copyright (c) Ron Klinkien and contributors
|
|
8
|
+
|
|
9
|
+
garth — https://github.com/matin/garth
|
|
10
|
+
Copyright (c) Matin Tamizi and contributors
|
|
11
|
+
|
|
12
|
+
The endpoint surface follows python-garminconnect. The SSO and OAuth flow
|
|
13
|
+
follows garth. Neither project is affiliated with this one.
|
|
14
|
+
|
|
15
|
+
Garmin and Garmin Connect are trademarks of Garmin Ltd. This project is not
|
|
16
|
+
affiliated with, endorsed by, or supported by Garmin.
|
package/README.md
CHANGED
|
@@ -10,45 +10,121 @@ through an [MCP](https://modelcontextprotocol.io) server built on
|
|
|
10
10
|
Claude previews the workout, waits for your OK, saves it to your Garmin workout library, schedules
|
|
11
11
|
it, and pushes it to your device.
|
|
12
12
|
|
|
13
|
+
Unofficial: not made by, or affiliated with, Garmin.
|
|
14
|
+
|
|
15
|
+
## What you need
|
|
16
|
+
|
|
17
|
+
- [Node.js](https://nodejs.org) 18 or newer (`node --version` to check).
|
|
18
|
+
- A Garmin Connect account.
|
|
19
|
+
- [Claude Desktop](https://claude.ai/download), or any other MCP client (see
|
|
20
|
+
[Other MCP clients](#other-mcp-clients)).
|
|
21
|
+
|
|
13
22
|
## Set up
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
### Easiest: the Claude Desktop Extension
|
|
16
25
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
1. Download `garminconnect-mcp-<version>.mcpb` from the
|
|
27
|
+
[latest release](https://github.com/DynamicsNinja/garminconnect-js/releases/latest).
|
|
28
|
+
2. Double-click it (or drag it onto Claude Desktop's Settings → Extensions) and choose **Install**.
|
|
29
|
+
3. Ask Claude something about your Garmin data. The first time, Claude opens a Garmin sign-in page
|
|
30
|
+
in your browser; sign in there (with your MFA code if you use one) and tell Claude you're done.
|
|
20
31
|
|
|
21
|
-
|
|
22
|
-
`~/.garminconnect-mcp/tokens` and renews itself as long as you use it at least once every 30 days.
|
|
32
|
+
Optional settings (tool groups, download folder) are under Settings → Extensions → Garmin Connect.
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
`claude_desktop_config.json`:
|
|
34
|
+
### Other ways to install: npm
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
"mcpServers": {
|
|
30
|
-
"garmin": { "command": "npx", "args": ["-y", "@dynamicsninja/garminconnect-mcp"] }
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
36
|
+
#### 1. Install
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
```sh
|
|
39
|
+
npm install -g @dynamicsninja/garminconnect-mcp
|
|
40
|
+
```
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
Install it once rather than running it through `npx`: Claude Desktop starts several copies of a
|
|
43
|
+
server at the same moment, and parallel `npx` installs into one cache folder can break each other
|
|
44
|
+
(`ERR_MODULE_NOT_FOUND … ajv/dist/2020.js`).
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
#### 2. Sign in to Garmin
|
|
47
|
+
|
|
48
|
+
In a terminal (your password never passes through Claude):
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
garminconnect-mcp login
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
It asks for your Garmin email, password and, if you use it, your MFA code. The session is saved to
|
|
55
|
+
`~/.garminconnect-mcp/tokens` and renews itself as long as it is used at least once every 30 days.
|
|
56
|
+
|
|
57
|
+
#### 3. Add it to Claude Desktop
|
|
58
|
+
|
|
59
|
+
Settings → Developer → **Edit Config**, and add a `garmin` entry to `claude_desktop_config.json`.
|
|
60
|
+
Point `node` at the installed server. To find the path, run `npm root -g` and append
|
|
61
|
+
`/@dynamicsninja/garminconnect-mcp/dist/cli.js`.
|
|
62
|
+
|
|
63
|
+
**Windows** (use forward slashes):
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"garmin": {
|
|
69
|
+
"command": "node",
|
|
70
|
+
"args": ["C:/Users/<you>/AppData/Roaming/npm/node_modules/@dynamicsninja/garminconnect-mcp/dist/cli.js"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**macOS / Linux**:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"garmin": {
|
|
82
|
+
"command": "node",
|
|
83
|
+
"args": ["/usr/local/lib/node_modules/@dynamicsninja/garminconnect-mcp/dist/cli.js"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If `node` itself is not found (common with nvm), use its full path from `which node` as `command`.
|
|
90
|
+
|
|
91
|
+
#### 4. Restart Claude Desktop
|
|
92
|
+
|
|
93
|
+
**Quit it completely**: tray / menu-bar icon → Quit. Closing the window leaves it running, and it
|
|
94
|
+
will not read the new config. Start it again, open a new chat, and the Garmin tools appear under
|
|
95
|
+
the tools icon in the message box.
|
|
41
96
|
|
|
42
|
-
|
|
43
|
-
sport the builder supports (running, cycling, swimming, strength, HIIT, yoga, pilates, mobility,
|
|
44
|
-
cardio, rucking, multi-sport). Workouts are checked before anything is sent: an unknown exercise
|
|
45
|
-
name or a malformed step is reported back to Claude with exactly where the problem is.
|
|
46
|
-
- **Everything else in garminconnect-js**: sleep, HRV, stress, training readiness and status, race
|
|
47
|
-
predictions, activities (list, details, download, upload files), gear, courses, devices, badges,
|
|
48
|
-
weigh-ins, and more. One tool per library method.
|
|
97
|
+
## Using it
|
|
49
98
|
|
|
50
|
-
|
|
51
|
-
|
|
99
|
+
Just ask. Some things to try:
|
|
100
|
+
|
|
101
|
+
- "Create a strength workout: 3 rounds of 10 back squats at 60 kg, 12 push-ups and a 1-minute
|
|
102
|
+
plank, 90 s rest between rounds."
|
|
103
|
+
- "Build a swim set for a 25 m pool: 400 easy, 8×100 free on 15 s rest, 200 cool-down."
|
|
104
|
+
- "Schedule that workout for Thursday and send it to my watch."
|
|
105
|
+
- "How did I sleep last night, and what's my training readiness today?"
|
|
106
|
+
- "Summarise my last run: distance, pace, average heart rate and training effect."
|
|
107
|
+
- "What are my race predictions, and how has my HRV trended this month?"
|
|
108
|
+
|
|
109
|
+
**Workouts are always previewed first.** Claude shows the workout in readable form (steps, targets,
|
|
110
|
+
paces in /km and /mi) and saves nothing until you confirm. Exercise names are checked against
|
|
111
|
+
Garmin's catalogue, and a mistake in a workout comes back to Claude with exactly where it is, so
|
|
112
|
+
it can fix it.
|
|
113
|
+
|
|
114
|
+
**Claude Desktop asks before each tool call.** You can allow a tool once or always. Tools that
|
|
115
|
+
delete or overwrite data (deleting activities, workouts, gear, weigh-ins, and so on) are marked
|
|
116
|
+
destructive, and Claude is told to confirm with you before using them.
|
|
117
|
+
|
|
118
|
+
## What it can do
|
|
119
|
+
|
|
120
|
+
- **`sign_in_to_garmin`**: signs you in through a page that opens in your browser, MFA included —
|
|
121
|
+
no terminal needed. See [Easiest: the Claude Desktop Extension](#easiest-the-claude-desktop-extension) above.
|
|
122
|
+
- **Workouts**: `preview_workout`, `create_workout`, `update_workout`, `search_exercises`, for
|
|
123
|
+
running, cycling, swimming, strength, HIIT, yoga, pilates, mobility, cardio, rucking and
|
|
124
|
+
multi-sport; plus listing, scheduling, sending to your watch and deleting.
|
|
125
|
+
- **Everything else in garminconnect-js**: sleep, HRV, stress, Body Battery, training readiness and
|
|
126
|
+
status, race predictions, activities (list, details, download, upload files), gear, courses,
|
|
127
|
+
devices, badges, weigh-ins, and more. One tool per library method.
|
|
52
128
|
|
|
53
129
|
**Not exposed:** `logout` (it would delete your saved session), the raw-JSON workout uploads (the
|
|
54
130
|
checked `create_workout` replaces them), and the raw GraphQL passthrough unless you opt in.
|
|
@@ -59,20 +135,63 @@ checked `create_workout` replaces them), and the raw GraphQL passthrough unless
|
|
|
59
135
|
|---|---|---|
|
|
60
136
|
| `GARMIN_MCP_TOKEN_DIR` | `~/.garminconnect-mcp/tokens` | Where the session is saved |
|
|
61
137
|
| `GARMIN_MCP_DOWNLOAD_DIR` | `~/Downloads/garmin` | Where downloaded files (FIT, GPX, …) go |
|
|
62
|
-
| `GARMIN_MCP_GROUPS` | all | Comma-separated tool groups: `wellness`, `activities`, `metrics`, `workouts`, `gear`, `courses`, `devices`, `badges-challenges`, `body-composition-weight`, `womens-health`, `golf`, `profile-and-misc`. The workout-builder tools are always on. Fewer groups means less of Claude's context used. |
|
|
138
|
+
| `GARMIN_MCP_GROUPS` | all | Comma-separated tool groups: `wellness`, `activities`, `metrics`, `workouts`, `gear`, `courses`, `devices`, `badges-challenges`, `body-composition-weight`, `womens-health`, `golf`, `profile-and-misc`. Matched case-insensitively; an unknown name is ignored (and if none you list are valid, everything loads). The workout-builder tools are always on. Fewer groups means less of Claude's context used. |
|
|
63
139
|
| `GARMIN_MCP_ENABLE_GRAPHQL` | off | Set to `1` to expose `query_garmin_graphql` |
|
|
64
140
|
|
|
65
|
-
Set them under `"env"` in the
|
|
141
|
+
Set them under `"env"` in the config entry, for example:
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
"garmin": {
|
|
145
|
+
"command": "node",
|
|
146
|
+
"args": ["…/dist/cli.js"],
|
|
147
|
+
"env": { "GARMIN_MCP_GROUPS": "workouts,metrics,wellness,activities" }
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
If you change `GARMIN_MCP_TOKEN_DIR`, sign in with the same value
|
|
152
|
+
(`GARMIN_MCP_TOKEN_DIR=/path/to/dir garminconnect-mcp login`), or the server won't find your
|
|
153
|
+
session.
|
|
154
|
+
|
|
155
|
+
## Troubleshooting
|
|
156
|
+
|
|
157
|
+
- **The tools don't appear.** Make sure Claude Desktop was fully quit and restarted (step 4). Then
|
|
158
|
+
Settings → Developer → `garmin` shows the server's status and a link to its log.
|
|
159
|
+
- **"Not logged in to Garmin"** or **"session expired"**: ask Claude to sign in again (it calls
|
|
160
|
+
`sign_in_to_garmin`), or run `garminconnect-mcp login` again. The running server picks up the new
|
|
161
|
+
session on the next request; no restart needed.
|
|
162
|
+
- **Sign-in page didn't open**: Claude's reply includes the link; open it in any browser on this
|
|
163
|
+
computer. It expires after 15 minutes — ask Claude to sign in again.
|
|
164
|
+
- **`ERR_MODULE_NOT_FOUND`** after trying `npx`: delete the `_npx` folder in your npm cache
|
|
165
|
+
(`npm config get cache` shows where) and use the global install above.
|
|
166
|
+
- **"Garmin is rate limiting requests"**: Garmin throttles bursts of calls. Wait a minute and ask
|
|
167
|
+
again.
|
|
168
|
+
- **HTTP 412 when saving anything (EU accounts)**: grant upload consent in Garmin Connect's
|
|
169
|
+
settings once; until then Garmin refuses every write.
|
|
170
|
+
- **Very detailed activity data looks cut off**: a single tool result is capped at 100,000
|
|
171
|
+
characters, and per-second activity data (`get_activity_details`) is usually larger. Ask for a
|
|
172
|
+
summary instead, or download the activity file (`download_activity`) and open it elsewhere.
|
|
173
|
+
|
|
174
|
+
## Updating
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
npm install -g @dynamicsninja/garminconnect-mcp@latest
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
then quit and restart Claude Desktop. Your saved session is kept.
|
|
181
|
+
|
|
182
|
+
## Other MCP clients
|
|
183
|
+
|
|
184
|
+
Any client that can start a stdio server works. The command is `garminconnect-mcp` (or
|
|
185
|
+
`node …/dist/cli.js`). For example, in Claude Code:
|
|
66
186
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
won't find the session you signed in with.
|
|
187
|
+
```sh
|
|
188
|
+
claude mcp add garmin -- garminconnect-mcp
|
|
189
|
+
```
|
|
71
190
|
|
|
72
191
|
## Good to know
|
|
73
192
|
|
|
74
193
|
- Dates are calendar dates in UTC (`YYYY-MM-DD`).
|
|
75
194
|
- Everything runs on your machine. Your Garmin session stays in your token folder and is sent only
|
|
76
|
-
to Garmin.
|
|
77
|
-
- Garmin Connect's API is unofficial and can change
|
|
195
|
+
to Garmin. See [PRIVACY.md](PRIVACY.md) for the full picture.
|
|
196
|
+
- Garmin Connect's API is unofficial and can change. This server is released in lockstep with
|
|
78
197
|
garminconnect-js, and each release is tested against the library version it contains.
|