{
  "markdown": "# health-mcp\n\n[![CI](https://github.com/almostjacked/health-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/almostjacked/health-mcp/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/%40almostjacked%2Fhealth-mcp)](https://www.npmjs.com/package/@almostjacked/health-mcp)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.almostjacked%2Fhealth--mcp-blue)](https://registry.modelcontextprotocol.io/v0/servers?search=health-mcp)\n\nYour health data (weight, body composition, calories, macros, water) as an MCP\ndata layer your AI can query. **Zero custody**: it lives in a Postgres\ndatabase in a Supabase project *you* create and own — nobody but you ever\nholds your data or your keys. An iOS Shortcut syncs it daily from Apple\nHealth; Claude (or any MCP client) reads it back through a connector that\nruns entirely inside your own project.\n\n## Get set up (four steps, ~20 minutes)\n\n### 1. Create your database + connector\n\nThree ways, pick one — all three end with the same thing: your connector\nURL, plus your ingest URL and ingest key.\n\n- **[The setup page](https://almostjacked.github.io/health-mcp/)** — no\n  terminal, guided clicks through your Supabase dashboard.\n- **`npx @almostjacked/health-mcp setup`** — fastest, needs Node ≥ 18. Walks\n  you through logging in to Supabase, picking or creating a project,\n  applying the schema, deploying both functions, and minting your secrets,\n  then prints the connector URL and Shortcut config.\n- **[Manual dashboard walkthrough](docs/setup-manual.md)** — the same steps\n  as the setup page, written out for anyone who'd rather read them first or\n  do them by hand.\n\n> Supabase's free tier allows 2 active projects, so this fits alongside one\n> other free project you may already have.\n\n### 2. Load your history\n\nWithout this, [adaptive-TDEE](#pair-it-with-fitness-tools) needs about two\nweeks of daily syncs before it has enough data to work. With it, everything\nworks immediately.\n\n1. On your iPhone: **Health app → your profile picture → Export All Health\n   Data**. This produces an `export.zip` (can take a few minutes for a long\n   history).\n2. Get that file to whatever device you're setting up from, then drop it on\n   the setup page's **[Import panel](https://almostjacked.github.io/health-mcp/#import)**.\n   Leave **Dry run** checked first to preview what would be sent before you\n   commit to it.\n\n### 3. Set up the daily sync\n\nThe **[Shortcut panel](https://almostjacked.github.io/health-mcp/#shortcut)**\nhas one download button — no signing step, no Terminal. Download the\nshortcut, install it on your iPhone (iOS asks you to paste in your ingest\nURL and key during import), then turn on the 9 AM daily automation. Full\nclick-by-click detail (including what to do if a step doesn't survive the\niOS import): **[docs/shortcut.md](docs/shortcut.md)**.\n\n\n**Easiest install (Mac-first):** download the signed shortcut on your Mac and double-click it — the two import prompts appear right next to the page's copy buttons, and iCloud syncs the shortcut to your iPhone automatically. (No Mac? Send the file to your phone and answer the prompts there.)\n\n### 4. Connect Claude\n\n1. Open **claude.ai → Settings → Connectors → Add custom connector**.\n2. Paste in your connector URL from step 1.\n3. Save. Claude can now use your health-mcp tools.\n\n> If adding the connector fails with *\"Couldn't register with [name]'s\n> sign-in service\"*, that's a transient claude.ai hiccup, not a problem with\n> your connector — just try adding it again.\n\n## Use it\n\nAsk Claude things like:\n\n> What's my average calorie intake this week vs last?\n\n> Show me my weight trend over the last 90 days.\n\n> Has my daily sync stalled? Check get_sync_status.\n\n### Pair it with fitness-tools\n\nhealth-mcp answers \"what happened\" (your logged weight and calories);\n[fitness-tools](https://github.com/almostjacked/fitness-tools) answers \"so\nwhat\" (TDEE, macros, body fat, 1RM). The `get_energy_inputs` tool returns\n`{date, weight, kcal}` entries shaped exactly for fitness-tools'\n`adaptive-tdee` — no reformatting needed. Ask Claude:\n\n> Get my energy inputs for the last 90 days, then compute my adaptive TDEE\n> with fitness-tools.\n\n> `adaptive-tdee` needs at least 10 days that have BOTH a weigh-in and a\n> calorie total — if you skipped [step 2](#2-load-your-history), expect ~2\n> weeks of syncing before the pairing works.\n\nIf you also train with Hevy, pair with\n[hevy-mcp](https://github.com/almostjacked/hevy-mcp) for the training side of\nthe picture (routines, logged sets, 1RM trend).\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| get_schema | The Postgres schema (two tables) and the metric registry (names, units, classes). Call before writing SQL for the query tool. |\n| get_sync_status | Latest date, row count, and days-since-last-entry per metric. Use to detect a stalled daily sync before trusting an analysis. |\n| get_recent | Rows for the last N days (default 30), optionally one metric. Daily totals and individual measurements in one date-sorted list. |\n| get_daily_summary | All metrics for one day (default: the most recent day with any data): totals plus every weigh-in/measurement. |\n| get_stats | Min/max/avg plus a rolling-average series for one metric over a date range (daily/weekly/monthly rollup). |\n| query | Escape hatch: run one read-only SQL statement (SELECT or WITH…SELECT) against the schema from get_schema. Writes/DDL rejected; LIMIT 500 enforced. |\n| get_energy_inputs | Daily (date, weight, kcal) entries for days with both a calorie total and a weigh-in — shaped exactly for fitness-tools' `adaptive-tdee`. |\n\n## Architecture\n\n```\nApple Health --> \"Sync Health Data\" Shortcut --> your health-ingest function --> your Postgres\n                                                                                      |\nClaude  <-- run_readonly (SELECT-only) <-- your health-mcp connector function <------+\n```\n\nNothing above touches infrastructure we operate. The two Edge Functions run\non your Supabase project; the only thing that ever leaves your device is the\nShortcut's HTTP POST straight to your own project's URL.\n\n## Privacy Policy\n\n**Zero custody.** health-mcp is software you run against infrastructure you\nown — we (the maintainers) never operate a server that sees your health\ndata or your keys, and there is nothing to disconnect from us because\nnothing was ever connected to us.\n\n- **Your data** lives only in the Supabase Postgres project you created. We\n  have no access to it, no copy of it, and no way to see it.\n- **Your keys** (`MCP_TOKEN`, `INGEST_KEY`, your Supabase secret key) are\n  generated by you or the wizard running on your machine, stored as secrets\n  in your own Supabase project, and — for the stdio/`.mcpb` install path —\n  held locally by your MCP client (Claude Desktop / Claude Code) and sent\n  only to your own project's URL.\n- **The Shortcut** sends data straight from your phone to your Edge\n  Function URL; it never passes through any server of ours.\n- The `query` tool is SQL-guarded to read-only statements, and the database\n  role it runs as (`health_reader`) is granted `SELECT` only — enforced at\n  the Postgres level, not just in application code.\n\n## Other clients\n\nPrefer Claude Desktop, or running the server yourself instead of the hosted\nconnector? Both use the same Supabase project from step 1 — just a\ndifferent way of talking to it.\n\n**Claude Desktop:** download\n[`health-mcp.mcpb`](https://github.com/almostjacked/health-mcp/releases/tag/v0.1.0),\ndouble-click it, and paste in your Supabase project URL and secret key when\nprompted.\n\n**Any stdio MCP client** (Claude Code, etc.):\n\n```bash\nclaude mcp add health-mcp -e SUPABASE_URL=<url> -e SUPABASE_SECRET_KEY=<key> -- npx -y @almostjacked/health-mcp\n```\n\n## Repo layout\n\n```\npackages/core   @almostjacked/health-mcp-core — tools, ingest/normalization, setup.sql\napps/mcp        @almostjacked/health-mcp       — stdio server, .mcpb, setup wizard\nweb             the setup page (provision + import + Shortcut panels)\nsupabase/functions/health-mcp     the read connector (deployed to your project)\nsupabase/functions/health-ingest  the write endpoint the Shortcut posts to\n```\n\n## Develop\n\n```bash\ncorepack enable\npnpm install\npnpm -r test\npnpm -r typecheck\n```\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 8316,
  "sha": "329716bf266ac807ceed54c37760fbb3b97517af9a382bba99f471a8393334e0",
  "repo_slug": "almostjacked/health-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_almostjacked_health_mcp_85aad0a0/readme"
}