Garmin Nutrition Coach
Connects to Garmin Connect to fetch wearable data including sleep, HRV, workouts, body composition, and true daily calorie burn (TDEE) for automatic logging and coaching.
Integrates with Notion to automatically log food, training, and body metrics, including photo-based food logging with macro estimation and automatic daily closing of calorie and workout data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Garmin Nutrition CoachCoach me on today's workout"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Turn Claude into your personal, data-driven health coach โ self-hosted, private, ~$0/month.
Why LeanLoop?
Losing weight is a calorie deficit โ but a deficit run blind burns muscle, not just fat. Lose muscle and your daily burn (TDEE) drops, so you have to eat even less to keep losing. That's the slow-starvation spiral that makes most diets miserable and short-lived.
LeanLoop keeps you on the healthy side of that line by giving Claude three things at once:
๐ฝ๏ธ What you eat โ snap a photo or just type it; calories and macros land in Notion, and every meal is kept with its time so you can see your real eating habits, not just a daily number.
๐ฅ What you actually burn โ your Garmin measures it live, every day (workouts, steps, all-day movement), so your deficit is based on your real body โ not a one-size-fits-all formula that's wrong for you.
๐ How you're recovering โ sleep, HRV, stress and body battery feed the coaching, so "train hard or rest today?" fits the day you're actually having.
Because all of it already flows to Claude, there's no more screenshotting dashboards into chat. Just ask.
"Coach me today" ยท "How did I sleep?" ยท "Why did my run feel bad?" ยท "What are my eating patterns this week?" ยท ๐ธ [photo of lunch]
โจ Features
Feature | What it does | |
๐ธ | Photo (or text) food logging | Snap a meal or type it โ calories & macros estimated and auto-saved to Notion, with the full per-meal history (time + item) kept on the day's page for habit analysis |
๐ | Automatic day close | Every night your server pulls the finished day's true TDEE from Garmin and writes TDEE + workouts into your log (your deficit column recalculates itself instantly โ it's a Notion formula) โ self-heals 3 days back, colored sync tags show status at a glance |
๐ฅ | Progress you can see | Cumulative deficit (โ kg of fat) updated nightly right on your Notion food log |
๐ | Coaching on real data | One-call readiness verdicts, post-workout analysis (splits, HR zones, sleep context), weekly reviews, injury pattern tracking |
๐๏ธ | Strength tracking + progression | Log lifts in plain speech (with optional RIR/effort) โ a clean per-exercise table with volume + estimated 1RM; the coach reads your last session, sees the trend, and prescribes the next load like a trainer |
๐ | Second-by-second analysis | FIT-file parsing: HR/pace/cadence streams + aerobic decoupling โ the endurance metric real coaches use |
โ๏ธ | Calibration loop | Every 2 weeks: logged deficit vs. actual weight change reveals your personal estimation bias, which corrects all future estimates |
๐ | Live-updating brain | Coaching rules live in |
Related MCP server: Garmin Health MCP Server
๐ Install (no coding needed)
In Claude, create a Project and name it LeanLoop (this is where your coach will live).
In that Project, enable the Notion connector (Claude needs it to build your databases).
Open a chat inside the Project โ set the model to Sonnet at Medium effort for setup (lots of IDs to track; switch to Low for everyday use afterward) โ and paste:
Read https://github.com/bank3005-jpg/LeanLoop-for-Garmin/blob/stable/SETUP.md and set this up for meClaude interviews you (goals, body stats), creates your Notion databases, walks you through the cloud steps, then adds your server as a second connector and loads the coaching rules into the Project. 45โ60 minutes, one time. After setup, everyday food logging runs fine on Sonnet Low.
โ ๏ธ Requires Claude Pro (or Max/Team/Enterprise). LeanLoop runs on two custom connectors at once โ Notion (your food/training/body logs) and your Garmin server (live wearable data). The Free plan allows only one custom connector, which isn't enough for the full loop. Pro also gives the usage headroom for daily photo food-logging. You do not need any paid Notion or Garmin plan โ their free tiers are fine.
Prerequisites: a Garmin watch ยท Notion account (free) ยท Google account with billing enabled (stays within free tier) ยท Claude Pro (or Max/Team โ needs two custom connectors at once; Free allows only one) ยท Windows or macOS computer for one step.
๐ Docs: USAGE.md โ how to use it (what to say to your coach) ยท SETUP.md โ install ยท CONFIG-REFERENCE.md โ the Config "brain" ยท SECURITY.md โ keep your data safe ยท CONTRIBUTING.md โ fork / maintainer notes
๐๏ธ Architecture
Claude (any device, incl. phone)
โโโ your Cloud Run server โ this repo, deployed to YOUR Google account
โโโ Garmin Connect โ your token, created on your own computer
โโโ your Notion โ food / training / body logs
โโโ playbook.md โ coaching rules, served live from GitHub
Cloud Scheduler โ nightly close-day job + keep-warm pingsPrivacy by design: everything runs in your accounts. No third party โ including this repo's author โ ever sees your data. The server is protected by a long random secret; Garmin credentials never pass through chat.
๐งฐ What's inside (21 lean MCP tools)
Health get_wellness(metric) โ sleep, HRV, stress, body battery, heart rate, SpO2, respiration, intensity minutes, hydration, blood pressure, body composition, training readiness/status ยท get_daily_summary
Training get_activities (recent or date range) ยท get_activity(id, view) โ summary, splits, HR zones, FIT streams, aerobic decoupling ยท get_fitness(metric) โ VO2max, race predictions, endurance/hill scores, lactate threshold, PRs, fitness age ยท get_coach_snapshot (one-call verdict data) ยท analyze_activity (one-call post-workout bundle) ยท weekly_report / calibrate_report (pre-computed reviews) ยท traininglog_read (Notion actuals: runs + weight lift tables)
Body get_weight_history ยท add_body_composition (write InBody/DEXA scans into Garmin)
System foodlog_read / foodlog_upsert (direct Notion food log, meal-by-meal history) ยท get_config / foodlib_find / foodlib_upsert / exercise_find (fast server-side Notion reads, dedup foods into your library) ยท weightlog_upsert (log a lift session) ยท get_today (server date/time โ anchor dated actions) ยท get_playbook (live coaching rules)
Few tools by design: a lean tool list keeps every chat's context small โ grouped tools with a metric/view parameter carry the same 35 capabilities at ~half the token overhead.
๐ Updating
Coaching rules โ update automatically (served live from this repo)
Server code โ
git pull+ one deploy command, or enable a Cloud Build trigger onstablefor fully automatic deploysWant to customize the code? Fork the repo and point your deployment at your fork
๐ค Using it with ChatGPT or OpenAI Codex (instead of Claude)
LeanLoop's brain is a standard remote MCP server โ it is not tied to Claude. Any MCP-capable client can connect to the exact same Cloud Run server and get the same 23 tools. Two confirmed paths (verified Aug 2026):
ChatGPT โ Developer Mode (Plus / Pro / Business / Enterprise / Edu, web app):
Settings โ Apps โ Advanced โ Developer Mode โ add a remote MCP server โ paste your server URL (https://<your-cloud-run-url>/<MCP_SECRET>/mcp). ChatGPT supports Streamable HTTP + SSE with OAuth-or-none, so the secret-in-URL that LeanLoop already uses works as-is. Put the bootstrap (below) into a Custom GPT's instructions.
OpenAI Codex (CLI or desktop):
codex mcp add leanloop -- <streamable-http url>, or add it to ~/.codex/config.toml (a project-scoped .codex/config.toml also works). Codex supports remote Streamable HTTP MCP with bearer/none auth. Put the bootstrap into AGENTS.md / project config.
Bootstrap (the equivalent of the Claude-Project setup โ paste into the Custom GPT instructions / AGENTS.md):
At the start of any food / training / coaching conversation, call
get_playbook(no args) and follow every rule it returns, and readget_configfor the user's current targets. All coaching logic lives in those two tools โ never guess.
What ports 1:1 (zero changes): the whole server, all 23 tools, your Garmin token, your Notion databases, the Cloud Run deployment, and the nightly cron. These are model-agnostic โ build them once, any AI uses them.
What's different / to watch:
You likely need only the ONE LeanLoop connector, not a separate Notion one โ the server reads and writes your food / config / training logs in Notion itself (server-side, via its own token). A separate Notion MCP is only needed for occasional hand-editing of page structure.
The playbook is tuned to Claude's behaviour. GPT models follow instructions a little differently โ expect to tweak some wording (e.g. the "always render the full food table" rules) until it behaves.
Photo food-logging needs a client with vision โ ChatGPT has it.
Codex-only shortcut that skips Google Cloud: because Codex runs code locally, you can run
main.pyas a local stdio MCP server (no Cloud Run at all) โ this removes the single hardest setup step. Trade-offs: no nightly auto-close cron (that needs an always-on host) and no phone access โ it only works while your computer + Codex are running. Great for trying it; Cloud Run is still better for daily hands-off use.
Bottom line โ fully feasible. The three genuinely fiddly one-time steps people worry about โ Notion setup, Garmin token, cloud deploy โ are identical on any platform, because they connect your data, not Claude specifically. Once they're done, pointing ChatGPT or Codex at the server is a ~2-minute config. The one-time steps are in SETUP.md. (Community/experimental โ the maintainer builds on Claude; GPT/Codex paths may need small prompt tweaks.)
โ FAQ
Is it really free? Yes โ Cloud Run free tier covers personal use many times over. The setup guide includes guardrails so you stay in it.
Does my data go anywhere? No. Your server, your Garmin token, your Notion. Self-hosted means self-owned.
What if Garmin changes their API? The community library this builds on (python-garminconnect) gets patched quickly; update with one git pull + deploy.
Garmin China accounts? Not supported (separate system).
No watch some days? The nightly job falls back to your formula baseline and tags the day estimated.
๐ฌ Why this exists
I'm not a programmer. I built LeanLoop together with Claude because I wanted to lose weight, get my confidence back, and just feel better โ and I couldn't find a tracker that coached me on my real data instead of generic formulas. It worked for me, so I'm sharing it.
I use LeanLoop every single day and keep refining it as I go. If you hit a problem or want a feature, open a thread in Discussions โ I read everything.
๐ Credits
Built on python-garminconnect by cyberjunky ยท fitdecode ยท MCP by Anthropic.
โ ๏ธ Disclaimer
This is a personal tracking and coaching tool, not medical advice or a medical device. Calorie and macro estimates are approximations. Consult a healthcare professional for medical decisions, and stop training and seek care for any concerning symptoms.
๐ License
MIT โ use it, fork it, share it.
This server cannot be deployed
Maintenance
Related MCP Connectors
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
Garmin data in Claude: 135 tools โ activities, sleep, HRV, training, workouts. Free, open source.
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
Related MCP Servers
- AlicenseBqualityAmaintenanceConnects Claude Desktop to Garmin Connect, enabling natural language queries of fitness activity data, health metrics, sleep analysis, workout management, and device information with 94 available tools.1101MIT
- AlicenseAqualityDmaintenanceEnables Claude Desktop to access and analyze Garmin wearable health data including sleep, HRV, Body Battery, and activity metrics. Users can query their health trends, track recovery, and generate interactive HTML dashboards using natural language.96MIT
- FlicenseNot gradedqualityBmaintenanceConnects Claude to Garmin Connect data for personalized running coaching, including morning readiness checks, post-run analysis, weekly reviews, and goal tracking.-
- FlicenseNot gradedqualityCmaintenanceConnects Garmin watch data to Claude Desktop, allowing users to ask natural language questions about their health and activity data from Garmin Connect.-