garmin-coach-mcp
Local stdio MCP server providing private Garmin coaching tools for Codex, ChatGPT desktop, and Claude, enabling preview and safe application of training weeks and heart-rate profile updates.
README
Local Garmin Coach MCP
Private, single-user Garmin coaching tools for Codex/ChatGPT desktop and Claude. The server is local stdio only: no Cloudflare, Render, public URL, account service, or hosting cost.
The runtime is based on etweisberg/garmin-connect-mcp at commit 87d0ea059fb67f1ce65ac05100df74c3c3777c84. It keeps the upstream AGPL-3.0 license and Taxuspt attribution in NOTICE.
Prerequisites
- Node.js 20 or newer
- pnpm 10.14.0
- A Garmin Connect account and synced watch
Install
cd /home/talvak/Desktop/repos/garmin-coach-mcp
pnpm install --frozen-lockfile
pnpm exec playwright install chromium
pnpm build
pnpm auth
pnpm auth opens a dedicated visible Chrome profile. Log in manually, complete MFA, then press Enter in the terminal. The browser session stays under ~/.local/share/garmin-coach/browser-profile. Runtime CSRF values are read from the current authenticated page and never persisted or printed. Directories are 0700, files are 0600, password saving is disabled, and no username/password file is created.
Capture Garmin's profile-write contract
Garmin does not publish a stable heart-rate profile write API. The server refuses to guess it.
pnpm capture:profile-contract
The command loads Garmin's current app model, asks it to save the unchanged current default zones, and blocks the resulting PUT before delivery. It validates the route and exact unchanged body, then stores only a redacted method/path/field shape and supported scopes in ~/.local/state/garmin-coach/profile-write-contract.json with mode 0600.
If Garmin's shape cannot be proven, no contract is saved and profile writes remain disabled.
Connect Codex and ChatGPT desktop
Build first, then copy config/codex.toml.example into ~/.codex/config.toml, or add the equivalent server through ChatGPT desktop Settings > MCP servers. Codex CLI, the IDE extension, and ChatGPT desktop share local MCP configuration on the same host.
The example uses:
default_tools_approval_mode = "writes"
Both apply tools also have explicit approval_mode = "prompt". Restart the client after configuration and use /mcp to verify connection.
ChatGPT web cannot start this local stdio process. Use ChatGPT desktop/Codex for Garmin writes.
Connect Claude
Merge config/claude.json.example into Claude's MCP configuration, or run:
claude mcp add garmin-coach -- /home/talvak/snap/code/current/.local/share/pnpm/node /home/talvak/Desktop/repos/garmin-coach-mcp/dist/index.js
The filesystem lock permits only one local client to own the Garmin Chromium profile at a time. Stop the server in one client before using the other.
Tools
| Tool | Garmin write |
|---|---|
get_coaching_snapshot |
No |
get_training_program |
No |
preview_training_week |
No |
apply_training_week |
Yes, approval required |
verify_training_week |
No |
preview_hr_profile_update |
No |
apply_hr_profile_update |
Yes, separate approval required |
Safe workflow
- Call
get_coaching_snapshotand compare it with Garmin Connect. - Call
preview_hr_profile_update. - Review every field and approve the exact canonical proposal/hash.
- Call
apply_hr_profile_update; then sync Garmin and visually verify watch zones. - Call
preview_training_weekfor one Sunday-starting week. - Review its recovery evidence, complete payload, warnings, and hash.
- Call
apply_training_weekwith the unchanged canonical proposal/hash. - Call
verify_training_weekand confirm Monday/Friday are135-149 bpm; Friday must display fixed12%instructions. - Retry both apply calls to prove idempotency.
Pain/injury or illness blocks workout writes. Recovery can keep, reduce, or skip; it never increases load. Workouts are never deleted automatically.
Garmin exposes Treadmill as a watch activity beneath Running, not as a structured-workout sport. Friday is therefore a running-compatible workout named Incline Walk 12%; start it from the watch's Treadmill activity. Its 12% incline cue and 135-149 bpm target remain explicit.
Approved HR profile
| Field | Value |
|---|---|
| Maximum HR | 189 bpm |
| Resting HR | 55 bpm |
| Lactate threshold HR | 181 bpm |
| Basis | Heart-rate reserve/custom BPM |
| Zone 1 | 122-134 bpm |
| Zone 2 | 135-149 bpm |
| Zone 3 | 150-162 bpm |
| Zone 4 | 163-176 bpm |
| Zone 5 | 177-189 bpm |
These values are provisional: age 27, resting HR 55, estimated max HR 189, and manual LTHR 181. Automatic-detection flags are preserved. Future changes require another preview and approval.
Verification
Ordinary tests are offline and never call Garmin:
pnpm test
pnpm lint
pnpm format:check
pnpm typecheck
pnpm build
git diff --check
See spec.md for behavior and docs/architecture.md for trust boundaries.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。