Garmin MCP
[npm]
[CI]
[MCP registry]
Ask your AI assistant how your training is really going. Garmin MCP is an unofficial, open-source MCP server for your Garmin Connect data: training load, form and morning readiness computed on your machine with methods from published sports-science literature, with citations; 21 tools designed around the questions athletes ask, not a mirror of Garmin's API; a local SQLite cache that downloads only what a question needs; and structured workouts that go from the answer to your Garmin calendar and watch. It also reads activities, health, sleep, training status, body composition, gear, devices and the workout library.
Works with Claude Code, Claude Desktop, Codex, Antigravity CLI, opencode and any other MCP client (stdio or streamable HTTP).
Documentation: endurancetools.github.io/garmin-mcp (getting started per client, what to ask, configuration, troubleshooting). Contributing and development: DEVELOPMENT.md.
Unofficial. Garmin and Garmin Connect are trademarks of Garmin Ltd. or its subsidiaries; this project is not affiliated with or endorsed by Garmin. The training analytics (get_load, get_readiness) are training information, not medical advice.
Why Garmin MCP
- Answers you can check. Training load (TSS from power, pace, heart rate or session RPE), fitness, fatigue and form (CTL/ATL/TSB), ACWR, intensity distribution and morning readiness from your own HRV, resting heart rate, sleep and load against your own baselines, with methods from published sports-science literature, with citations. Every answer returns the values and rules it used, and you can change them. Methods and evidence
- Designed tools, not an API mirror. 21 tools built around questions like "review my week" or "can I train hard today?", so one call answers one question. The whole tool list costs the model about 8,600 tokens of context, and the first tool call was the right one in 48 of 48 tool-selection scenarios. Designed tools
- Local and private. You sign in on Garmin's own page, so your password never passes through the tool. What it downloads stays in a local database on your computer, answers come back from it in milliseconds, downloads are paced to stay gentle with Garmin, and tool answers go only to the AI client you connect. What is stored where
- From answer to watch. Ask for "6×400 m with 90 s rest on Thursday": you see the steps and estimated duration first, nothing is saved until you agree, and then it goes to your Garmin calendar and syncs to the watch. Workouts and calendar
Getting started
Requirements: Node.js 22 or newer, a Garmin Connect account, and Chrome, Edge, Brave or Chromium for the sign-in window (there is a terminal fallback).
1. Sign in once. This opens Garmin's own sign-in page in your browser. Your password never passes through the tool; only the tokens Garmin issues are stored, in ~/.garmin-mcp.
2. Add the server to your client.
3. Ask. Nothing is downloaded until a question needs it. For example:
- "How did I sleep this week?" or "How did my HRV trend over the summer?"
- "Review my training week" or "Summarise my block from 2026-08-04 to 2026-09-28"
- "Am I fatigued? What is my form right now?"
- "When is my next race?" or "What is planned this week?"
- "Build me 6×400 m with 90 s rest for Thursday" (you see the steps first, nothing is saved until you agree)
- "Rename activity 21001 to Parkrun PB"
Optional: pre-load a range so the first questions answer instantly.
How it fetches data
Logging in and starting the server download nothing. When a question needs days that are not in the local database, the tool downloads exactly that range, waits up to 20 s and answers; anything left keeps downloading in the background and the answer says so (meta.source is partial). Everything downloaded stays in the local database: stored days are never downloaded again unless you pass --force, so repeating a question costs nothing.
To stay gentle with Garmin, long ranges go in 7-day chunks, newest first, with a random 1-11 s pause after each chunk that actually downloaded something, at most 600 requests per day. A 429 or a Cloudflare challenge pauses all downloads for 6 h. An interrupted sync continues where it left off.
With GARMIN_AUTO_FETCH=false nothing is downloaded unless you run garmin sync or the garmin_sync tool; read tools then return the missing range in meta.sync_hint and the model asks you first.
Measured on a real account after a 90-day sync (433 requests in about an hour): answers come from the local database in 1-110 ms.
Tools
delete_activity, delete_workout, delete_weigh_in and overwriting a saved workout (create_workout with workout_id) are only available with GARMIN_ENABLE_DESTRUCTIVE=true.
Resources: garmin://profile, garmin://gear, garmin://devices, garmin://activity-types, garmin://sync-status, and the templates garmin://activity/{id} and garmin://workout/{id} with id completion. Prompts: weekly_review, plan_next_week.
Every response is { data, meta: { source: cache|live|partial|local, fetched_at, coverage?, sync_hint? } }, as JSON text and as structuredContent matching the tool's outputSchema; failures are { error: { code, message, hint } }.
Formulas, defaults and limits of the analytics tools: docs/analytics.md. Which Garmin Connect data is covered, and what is still missing: docs/coverage.md.
CLI
garmin-mcp-cli shares the core with the server and is handy for setup and checks:
load, readiness and thresholds print the same results as the get_load, get_readiness and get_thresholds tools: markdown tables by default, the tool's { data, meta } envelope with --json. They read the local database only and never download; missing days come back as a note with the garmin sync command that fills them. import-activities adds activities from Garmin Connect CSV exports (English or Polish headers) for dates the synced activities do not cover, and thresholds export/import keep a copy of the threshold history in a CSV file.
Run it with npx -y garmin-mcp-cli <command> or install it globally (npm i -g garmin-mcp-cli).
Signing in
garmin login opens Garmin's real sign-in page in your installed Chrome, Edge, Brave or Chromium (a temporary profile, removed afterwards). You sign in there, including MFA or a CAPTCHA if Garmin asks; the tool only catches the one-time ticket Garmin redirects to afterwards and exchanges it for tokens. Cloudflare sees a real browser. Set GARMIN_BROWSER_PATH if your browser is not found.
Without a browser (headless server, Docker) or with --strategy curl|fetch, it asks for e-mail, password and MFA in the terminal and talks to Garmin's mobile login API, trying curl-impersonate (optional cuimp package, downloads its binary on first use) and then plain fetch. If that is blocked too, log in with Python and import the tokens; garmin doctor prints the exact command:
Tokens and the database are 0600 inside a 0700 directory; the server refuses to start on looser permissions.
Remote and Docker
Streamable HTTP: GARMIN_MCP_TRANSPORT=streamable-http GARMIN_MCP_HTTP_TOKEN=<secret> npx -y garmin-mcp-server serves POST /mcp with Authorization: Bearer <secret>. Without a token it only binds to 127.0.0.1. Requests whose Host or Origin is not localhost, 127.0.0.1 or [::1] get 403 (DNS rebinding protection); behind a public hostname add it with GARMIN_HTTP_ALLOWED_HOSTS=mcp.example.com.
The server speaks MCP 2026-07-28 (server/discover, list results cached for an hour) and the 2025 revisions through the usual initialize handshake, on stdio and on HTTP, so clients on older MCP SDKs connect unchanged.
Docker: docker build -t garmin-mcp . && docker run -i -v garmin-data:/data garmin-mcp (log in with docker run -it -v garmin-data:/data garmin-mcp login).
Configuration
Precedence: CLI flag > environment > <data dir>/config.json > default. ~, $HOME and ${HOME} are always expanded.
More