garmin-coach-mcp
MCP server for reading and querying Garmin Connect data, including activities, strength history, recovery, trends, and optionally creating workouts.
README
garmin-coach-mcp
An MCP server that lets Claude read and answer questions about your Garmin Connect data — recent activities, per-set strength history, sleep and recovery, and simple trends — and optionally build workouts back onto your watch.
It runs two ways from the same code:
| Mode | Transport | Where | Use it for |
|---|---|---|---|
| Local | stdio | Your PC, launched on demand by Claude Code | Day-to-day work at your desk |
| Hosted | streamable HTTP | Azure Container Apps | Asking from your phone, PC switched off |
Local mode is the default. Nothing listens on a socket and no secret is involved —
the server is a subprocess Claude Code owns. Hosted mode is opt-in via
GARMIN_COACH_TRANSPORT=http and refuses to start without a shared secret.
Note: This uses
python-garminconnect, which talks to Garmin's unofficial API. It works well for personal use but isn't sanctioned by Garmin and can break if Garmin changes their backend.
Layout
├── src/garmin_coach_mcp/ the server
│ ├── server.py tool definitions + transport selection
│ ├── config.py environment-driven settings
│ ├── http_app.py hosted transport + shared-secret gate
│ ├── garmin_client.py cached, token-authenticated Garmin client
│ ├── analysis.py strength-history and trend computations
│ ├── strength_workout.py Garmin workout payload builder
│ └── login.py one-time interactive Garmin login
├── infra/ Bicep for the hosted deployment
├── tests/ secret-gate and config tests
├── docs/
│ ├── local-setup.md run it on your PC
│ ├── remote-setup.md deploy it to Azure with Microsoft sign-in
│ └── architecture.md design decisions and what was learned deploying it
├── scripts/check_secrets.py pre-commit credential scanner
└── .env.example every setting, documented
Your own data stays out of the repo.
.gitignoreexcludes.azure/(which holds live secrets), the Garmin token, anddocs/body-composition/+training/if you keep personal records alongside the code. Runpython scripts/check_secrets.pybefore publishing, or enable it as a hook withgit config core.hooksPath .githooks.
Tools
Read (9)
| Tool | What it answers |
|---|---|
garmin_status |
Is the connection working? Whose account? |
list_activities(limit, activity_type) |
"Show my last N workouts" |
get_activity(activity_id) |
Detailed metrics for one activity |
get_exercise_sets(activity_id) |
Per-set exercise / reps / weight / est. 1RM |
get_strength_history(exercise_name, weeks) |
"Is my squat going up?" |
get_recovery(date) |
Sleep + daily stats + training readiness |
get_trends(metric, weeks, sample_days) |
Resting HR, steps, stress over time |
suggest_next_weight(exercise_name, ...) |
Progressive-overload recommendation |
list_workouts(limit) |
Saved workouts (name + id) |
Write (3) — set GARMIN_COACH_READONLY=1 to drop these from the manifest entirely.
| Tool | What it does |
|---|---|
create_strength_workout(name, exercises, schedule_date) |
Build a strength workout on Garmin (experimental) |
schedule_workout(workout_id, date) |
Put an existing workout on your calendar |
delete_workout(workout_id) |
Undo / remove a workout |
Strength answers only have data if you log Strength activities with weights on your watch.
create_strength_workoutuses Garmin's unofficial workout schema — check the result in the Garmin Connect app anddelete_workoutif it's wrong.
Quick start (local)
cd C:\Projects\garmin-coach-mcp
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .
.\.venv\Scripts\garmin-coach-login.exe # one time, caches a token
claude mcp add garmin-coach -s user -- C:\Projects\garmin-coach-mcp\.venv\Scripts\python.exe -m garmin_coach_mcp.server
Full walkthrough: docs/local-setup.md.
Quick start (hosted)
azd env new garmin-coach --subscription <id> --location westus2
azd env set MCP_SECRET (python -c "import secrets; print(secrets.token_urlsafe(32))")
azd up
Then seed the Garmin token onto the file share and add the connector. Full walkthrough: docs/remote-setup.md.
Configuration
| Variable | Default | Meaning |
|---|---|---|
GARMIN_COACH_TRANSPORT |
stdio |
stdio or http |
GARMIN_COACH_SECRET |
— | Required for http. Minimum 32 chars |
GARMIN_COACH_HOST |
0.0.0.0 |
HTTP bind address |
GARMIN_COACH_PORT |
8080 |
HTTP port |
GARMIN_COACH_READONLY |
off | Hide the three write tools |
GARMINTOKENS |
~/.garminconnect |
Where the Garmin OAuth token lives |
GARMIN_COACH_ALLOWED_HOSTS |
localhost only | Host headers the MCP SDK will accept |
GARMIN_COACH_TENANT_ID |
— | Entra tenant issuing tokens |
GARMIN_COACH_CLIENT_ID |
— | Entra app ID; required audience on tokens |
GARMIN_COACH_ALLOWED_OIDS |
— | Object IDs permitted to call the server |
GARMIN_COACH_PUBLIC_URL |
— | This server's public URL, for RFC 9728 metadata |
The last four are all-or-nothing: set together they enable Microsoft sign-in; set partially the server refuses to start rather than advertising an auth flow that can't issue usable tokens.
Tests
.\.venv\Scripts\python.exe tests\test_http_gate.py
These cover the shared-secret gate — the only thing between the public internet and your Garmin account when hosted — plus the configuration guards that stop the server starting in an unsafe combination.
Troubleshooting
garmin_not_authenticated— rungarmin-coach-login(token missing or expired). Hosted: re-run it locally, then re-upload the token to the file share.- Server not connecting locally — confirm the venv path in
claude mcp list; the command must point at.venv\Scripts\python.exe. - No strength data — the workout must be logged as a Strength activity with
weights on the watch for
get_exercise_sets/get_strength_historyto return anything. - Hosted returns 404 for everything — the secret in the URL doesn't match
GARMIN_COACH_SECRET. A wrong secret is deliberately indistinguishable from a wrong path.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。