{"slug": "show-hn-ask-claude-about-your-garmin-data-via-the-official-personal-api", "title": "Show HN: Ask Claude about your Garmin data via the official Personal API", "summary": "A developer released a free, open-source MCP server on Cloudflare Workers that lets Claude query a user's own Garmin Connect data through Garmin's official, read-only Personal API. The server locks its /mcp endpoint behind GitHub OAuth so only the account named in ALLOWED_GITHUB_LOGIN can connect, strips names, profile photos and GPS coordinates from responses, and splits date ranges longer than Garmin's 28-day per-request limit into merged 28-day calls. It runs at $0 on Cloudflare's free plan (100,000 requests/day) and Garmin's free Personal API, and exposes tools such as get_daily_summaries, get_sleep_detail, get_hrv_summaries and search_activities for steps, sleep, heart rate, HRV, SpO2, Body Battery, VO2 max and logged strength sets.", "body_md": "Talk to your own Garmin data in Claude: *\"How did I sleep this week?\"*, *\"Did my walks hit my\nheart-rate target?\"*, *\"Show the sets I logged at the gym yesterday.\"*\n\nA small, private [MCP](https://modelcontextprotocol.io) server on Cloudflare Workers that uses\nGarmin's official, read-only [Connect Personal API](https://developer.garmin.com/gc-developer-program/personal/personal-api/).\nIt costs nothing to run for one person.\n\n📖 **Full write-up:** [Talk to your Garmin data in Claude, for free](https://blog.yershalom.com/posts/garmin-mcp-claude/) (also on [dev.to](https://dev.to/yershalom/talk-to-your-garmin-data-in-claude-for-free-1928))\n\n```\nClaude ──OAuth (GitHub sign-in, only you)──▶ Worker /mcp ──Bearer token──▶ Garmin Personal API\n                                              │\n                                              └─ KV: OAuth grants + cached Garmin token\n```\n\n- Your Garmin **personal API key** is a Worker secret. The Worker swaps it for a 24-hour access\ntoken, caches it in KV, and refreshes it an hour before it expires.\n- **`/mcp` is locked.** Claude has to sign in through OAuth, which sends you to GitHub, and only the\nGitHub account in`ALLOWED_GITHUB_LOGIN` gets through. If it isn't set, nobody does.\n- **Read-only.** Every tool is a`GET` . Names, profile photos and GPS coordinates are stripped from\nresponses before they reach Claude.\n\n| Piece | Cost | \n|---|---|\n| Garmin Connect Personal API | Free | \n| Cloudflare Workers, Free plan (100,000 requests/day) | Free | \n| Workers KV, Free plan (100,000 reads, 1,000 writes/day) | Free. This server writes about once a day | \n| GitHub OAuth app | Free | \n| Claude | Works on the Free plan, which allows one custom connector | \n| Custom domain | Optional, about $10/year. The free `*.workers.dev` address works fine | \n| **Total** | **$0** | \n\n| Tool | Data | \n|---|---|\n| `get_daily_summaries` | Steps, calories, intensity minutes, resting HR, stress, Body Battery per day | \n| `get_daily_steps` ,`get_daily_stress` ,`get_hydration` | Per-day stats | \n| `get_sleep_summaries` ,`get_sleep_detail` | Sleep per night, or one night in detail | \n| `get_daily_heart_rate` ,`get_hrv_summaries` ,`get_spo2` | Heart rate, HRV, blood oxygen | \n| `get_body_battery` ,`get_vo2_max` ,`get_fitness_age` | Recovery and fitness | \n| `get_weight` | Weight and body composition | \n| `search_activities` ,`get_activity` ,`get_activity_workouts` ,`list_activity_types` | Workouts, including strength sets and reps | \n| `get_heart_rate_zones` ,`get_profile_settings` | Settings | \n\nDate-range tools accept up to a year. Garmin's API only allows 28 days per request, so the server splits longer ranges into 28-day requests and merges the results.\n\nOpen the [Personal API Key page](https://connect.garmin.com/app/settings/personalApiToken) in Garmin Connect (sign in on the web if asked) →\n**Create Key** → accept the terms → pick an expiry → **Create**. Copy the key: it's shown once.\nGarmin's own guide: [Garmin Connect Personal API](https://developer.garmin.com/gc-developer-program/personal/personal-api/).\n\nClick **Deploy to Cloudflare** above. It forks this repo into your GitHub, creates the KV\nnamespace and deploys the Worker. You don't need to edit any files.\n\nPrefer doing it by hand? Fork the repo, then in Cloudflare go to **Workers & Pages → Create →\nImport a repository**, pick your fork, and set the deploy command to `npx wrangler deploy`.\n\nOpen the Worker's address, for example `https://garmin-mcp.<your-subdomain>.workers.dev`\n(Cloudflare shows it on the Worker's page). The page lists the exact callback URL and connector\nURL to copy in the next steps, and which secrets are still missing.\n\nGitHub → **Settings → Developer settings → OAuth Apps → New OAuth App**:\n\n- Homepage URL: your Worker address\n- Authorization callback URL: the callback URL shown on your Worker's page (its address + `/callback` )\n- Leave wildcard matching and device flow off\n\nCopy the **Client ID**, and generate a **Client secret**.\n\nCloudflare → your Worker → **Settings → Variables and Secrets → Add**, type **Secret**:\n\n| Name | Value | \n|---|---|\n| `ALLOWED_GITHUB_LOGIN` | your GitHub username. Only this account can sign in | \n| `GARMIN_API_KEY` | from step 1 | \n| `GITHUB_CLIENT_ID` | from step 4 | \n| `GITHUB_CLIENT_SECRET` | from step 4 | \n\n[claude.ai/customize/connectors](https://claude.ai/customize/connectors) → **Add custom\nconnector** → URL: the connector URL shown on your Worker's page (its address + `/mcp`) → **Connect** → approve → sign in with GitHub.\n\nStart a new chat and ask: *\"Summarise my last 7 days from Garmin.\"*\n\n```\ncurl -s -o /dev/null -w '%{http_code}\\n' -X POST https://YOUR-WORKER/mcp   # must print 401\n```\n\n[`skills/garmin-health-coach/SKILL.md`](https://github.com/yershalom/claude-garmin-mcp/blob/main/skills/garmin-health-coach/SKILL.md) teaches the agent *how* to\nuse these tools: which ones answer which question, how to read recovery signals together, and how to\nanswer like a coach rather than dumping JSON. It's free, like everything else here.\n\n- **claude.ai:** download[`dist/garmin-health-coach-plugin.zip`](https://github.com/yershalom/claude-garmin-mcp/blob/main/dist/garmin-health-coach-plugin.zip) (click**Download raw file** ), then Settings → Plugins →**Add → Upload plugin** and pick the zip.\n- **Claude Code:** add this repo as a plugin marketplace and install it:\nOr copy\n\n```\n/plugin marketplace add yershalom/claude-garmin-mcp\n/plugin install garmin-health-coach@claude-garmin-mcp\n```\n\n `skills/garmin-health-coach` into`~/.claude/skills/` .\n- **Other agents** that read`SKILL.md` files: put the folder wherever that agent loads skills from.\n\nThen try: *\"Should I train hard today?\"* or *\"Compare this week's sleep with last week's.\"*\n\n```\nnpm install\ncp .dev.vars.example .dev.vars      # fill in your key, a local GitHub OAuth app, your username\nnpm run check-garmin                # tests your Garmin key directly, no server needed\nnpm run dev                         # http://localhost:8787\n```\n\nFor the local GitHub OAuth app, use the callback `http://localhost:8787/callback`. To try the tools,\nrun `npx @modelcontextprotocol/inspector` and connect to `http://localhost:8787/mcp`.\nClaude itself can't reach `localhost`, so deploy before connecting Claude.\n\n`npm run typecheck` checks the TypeScript.\n\nOlder versions had `ALLOWED_GITHUB_LOGIN` and `PUBLIC_URL` in `wrangler.jsonc`. After you update,\nadd `ALLOWED_GITHUB_LOGIN` as a secret (step 5). Until you do, sign-in is refused. `PUBLIC_URL` is\nno longer needed; you can still set it under `vars` in `wrangler.jsonc` to pin one address if your\nWorker has a custom domain as well as `workers.dev`.\n\n- Secrets live only in Cloudflare (or your git-ignored `.dev.vars` ). None are in the repo.\n- To cut off access, remove the connector in Claude, delete the key in Garmin Connect, or both.\n- The Garmin key expires on the date you picked. Make a new one and update `GARMIN_API_KEY` . The\ncached token is tied to the key, so it refreshes by itself.\n- The Personal API is for your own data. Each person runs their own copy with their own key.\n\nEndpoint list and auth flow from Garmin's official\n[connect-personal-api-python](https://github.com/garmin/connect-personal-api-python) client.\nBuilt with [workers-oauth-provider](https://github.com/cloudflare/workers-oauth-provider) and the\n[MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk).\n\nMIT licensed.", "url": "https://wpnews.pro/news/show-hn-ask-claude-about-your-garmin-data-via-the-official-personal-api", "canonical_source": "https://github.com/yershalom/claude-garmin-mcp", "published_at": "2026-12-01 07:23:06+00:00", "updated_at": "2026-12-01 07:46:07.905325+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "ai-products"], "entities": ["Claude", "Garmin", "Garmin Connect Personal API", "Cloudflare Workers", "Workers KV", "GitHub", "Model Context Protocol", "Anthropic"], "also_reported_by": [], "takeaway": "A single-user MCP server can run at $0 by caching Garmin's 24-hour access token in Workers KV, refreshing it an hour before expiry, and splitting ranges beyond Garmin's 28-day per-request cap into merged 28-day calls.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-ask-claude-about-your-garmin-data-via-the-official-personal-api", "markdown": "https://wpnews.pro/news/show-hn-ask-claude-about-your-garmin-data-via-the-official-personal-api.md", "text": "https://wpnews.pro/news/show-hn-ask-claude-about-your-garmin-data-via-the-official-personal-api.txt", "jsonld": "https://wpnews.pro/news/show-hn-ask-claude-about-your-garmin-data-via-the-official-personal-api.jsonld"}}