Borrowing it
Nothing to install: this file belongs to madfreakz/google-health-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/madfreakz/google-health-mcp-server/main/CLAUDE.mdgit clone --depth 1 https://github.com/madfreakz/google-health-mcp-serverWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/madfreakz/google-health-mcp-server/claude-md)<a href="https://agentmods.dev/instructions/madfreakz/google-health-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/madfreakz/google-health-mcp-server/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/madfreakz/google-health-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/madfreakz/google-health-mcp-server/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02209 | $0.02209 |
| Opus 5 | $0.01104 | $0.01104 |
| Sonnet 5 | $0.00442 | $0.00442 |
| Haiku 4.5 | $0.00221 | $0.00221 |
Grade A, and why
google-health-mcp-server CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Working notes for AI assistants
Operational context for Claude/Cursor/etc. when modifying this repo. Built mirroring the
sibling strava-mcp-server conventions (same axios + dotenv + zod + MCP SDK stack, same
OAuth-bootstrap / atomic-token-write / in-memory-cache / retry idioms).
Known pitfalls
- Refresh tokens expire after 7 days, and you can't easily fix it. Google Health scopes are
Restricted, so publishing the OAuth app to Production (the usual "long-lived token" fix)
triggers a mandatory security verification (CASA) with no click-through bypass — impractical
for one user. So the app stays in Testing and the 7-day expiry is permanent. Design around
it, don't fight it:
src/client.ts:refreshTokensthrows a clear "re-run npm run oauth" message on expiry; interactive use re-auths lazily (the assistant runsnpm run oauthwhen a call reports expiry); the launchd sync (every 4 days, seelaunchd/) is best-effort —src/cli/sync.tslogs "re-auth needed", fires a macOS notification viaosascript, and exits 0 if the token lapsed (no crash-loop, no proactive re-auth). The 4-day cadence only narrows the staleness window; it can't extend the refresh token's life (only an interactivenpm run oauthdoes that), so don't "fix" empty data by tightening the interval further — there's a hard floor set by how often Mark is willing to click through a browser consent screen. buildDailySummary's per-metriccatchmust re-throw auth failures (fixed 2026-06-29).src/tools/summary.tsswallows per-metric errors so one unavailable dataType (e.g. AZM on an Apple Watch) doesn't sink the whole summary — but a blanketcatch { points = [] }was also swallowing "Token refresh failed", so an expired token silently rendered as "no data" instead of surfacing the real error. This broke re-auth detection everywhere:get_daily_summarylooked like an empty range instead of erroring, and the launchd cron's "re-auth needed" branch insync.tsnever fired because the error never escapedbuildDailySummary. Fixed byclient.ts:isReauthError(err)— checked first in the catch, re-thrown if true, only genuine per-metric gaps are swallowed. If you touch this catch again, keep that check first.- Google does NOT rotate the refresh_token on refresh (unlike Strava). The refresh
response usually omits
refresh_token;refreshTokenskeeps the existing one (data.refresh_token ?? current.refresh_token). A refresh_token is only issued on the first consent, which is why the authorize URL setsaccess_type=offlineandprompt=consent. If a user re-auths and gets no refresh_token, they must revoke at https://myaccount.google.com/permissions first. - The published v4 docs were WRONG on several points — these were verified against the live API
on 2026-06-03 (see
DATA_TYPESinsrc/constants.ts):- dataType IDs are kebab-case and not the obvious names: active calories =
active-energy-burned, active minutes =active-zone-minutes, resting HR =daily-resting-heart-rate.steps/distanceare as-named. A wrong ID 400s with "Invalid data type ID referenced…". Other verified types:heart-rate(rollup → avg/max/min),floors,total-calories,sleep. active-zone-minutesis per-heart-zone, not a single sum: the value object is{sumInFatBurnHeartZone, sumInCardioHeartZone, sumInPeakHeartZone}(strings).DATA_TYPESmarks itcombine:'azm'andlib/civil.ts:metricValuereduces to Fitbit's weighted total (fatBurn×1 + cardio×2 + peak×2). It's a Fitbit/Pixel metric — empty from Apple Watch.- DO NOT use
total-caloriesfor "calories burned". From the Apple Watch import it carries only basal/resting energy — a flat near-constant (~1704 kcal/day, identical to 4 decimals across days; verified) with NO active component. Useactive-energy-burned, which varies with movement (keyactiveCalories).total-caloriesis rollup-only (no list). :dailyRollUprange.start/range.endare nestedCivilDateTime—{date:{year,month,day}, time:{hours,minutes,seconds,nanos}}— NOT a flat{year,month,day}(the doc example is wrong; a flat date 400s with "Unknown name 'year' at 'range.start'"). Built byclient.ts:civilDateTime.- Do NOT send
pageSizeto:dailyRollUp— it 400s with "Invalid argument in request". (List endpoint accepts pageSize fine.) dataSourceFamily: users/me/dataSourceFamilies/all-sourcesis what surfaces the Apple Watch (HEALTH_KIT) import.google-wearablesis Fitbit/Pixel only.- Values come back camelCase, and int64s are STRINGS (
steps.countSum:"8034",distance.millimetersSum:"…"— note millimetres).kcalSumis a real number.civilStartTime.dateis nested.lib/civil.ts:extractValuecoerces strings;civilFromPathreads the embedded date. The raw point is ALWAYS returned alongside — never drop it.
- dataType IDs are kebab-case and not the obvious names: active calories =
- Resting HR and sleep do NOT support
:dailyRollUp(the API says use list/get/reconcile).DATA_TYPES[].methodis'rollup'or'list';summary.ts:buildDailySummarydispatches on it. List-method metrics carry their own embedded date (e.g.dailyRestingHeartRate.date), so we list recent points and clip to the window. Sleep is not modeled yet (empty until a device logs it — re-check the shape against live data once the Fitbit Air syncs). - The list-endpoint
filtergrammar is unknown.endTime >= "…"400s with INVALID_DATA_POINT_FILTER_RESTRICTION_COMPARABLE.list_data_pointslists most-recent and exposes a rawfilterpassthrough only. For date windows, use the rollup-based summary. - Civil date math lives in
src/lib/civil.ts, host-timezone-local (matches the watch's notion of "a day"), and is unit-tested. Keep it that way. - MCP SDK deep-instantiation.
registerTooltrips TS2589 when a raw zod shape containsz.array()/z.boolean(), and the error hops between calls as TS's depth budget shifts. Fixed by casting thoseinputSchemarefsas anyinsrc/index.ts(compile-time only — the real schema still validates at runtime). Handlers keep explicit return types (ToolResult) and strict arg types.npm run builduses--noCheckregardless.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 127 lines · 2,209 tokens per session scan A d210eff63706
google-health-mcp-server CLAUDE.md is an instructions file published in the GitHub repository madfreakz/google-health-mcp-server (0 stars, last pushed 2mo ago), licensed MIT. It adds 2,209 tokens to every session, about $0.0110 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).