{
  "markdown": "# Health Hub MCP Server\n\n[![CI](https://github.com/USER/REPO/actions/workflows/ci.yml/badge.svg)](https://github.com/USER/REPO/actions/workflows/ci.yml)\n\nPersonal MCP server that ingests Health Connect data from an Android companion app and exposes aggregated health metrics to LLM clients over the Model Context Protocol.\n\n```\nAndroid 14+ ──POST /ingest/health──────▶ ┌──────────────────┐\n  (companion app)                         │                  │\nAndroid 14+ ──POST /ingest/hc-webhook──▶ │   Health Hub     │──MCP──▶ LLM\n  (HC Webhook client)                     │   SQLite         │\n                   browser ──GET /debug──▶ └──────────────────┘\n```\n\nThe companion app reads raw records from Health Connect and pushes them to this server. The server normalizes, deduplicates, and rolls them up into daily aggregates, then exposes them to LLM clients (Claude, Perplexity, OpenCode) through five MCP tools. Raw events are never handed to the model by default — only rolled-up summaries with explicit `caveats` so the model cannot silently fabricate missing data.\n\n## Requirements\n- Android 14+ with [life-dashboard-companion-app](https://github.com/owen282000/life-dashboard-companion-app) v1.4.0+\n- Any host with Docker and Docker Compose\n- Domain with TLS (Caddy handles certificates automatically)\n\n## Quick Start\n```bash\ncp .env.example .env\n# Edit .env: set DEVICE_TOKEN and MCP_TOKEN (run: openssl rand -hex 32)\ndocker compose up -d --build\ncurl -s http://localhost:8000/health\n```\n\n## Companion Apps\n\nThe server accepts health data from **two** Android apps via separate endpoints. Both write to the same database and use content-hash deduplication — sending the same data from both apps will not double-count.\n\n| App | Endpoint | Format | Best for |\n|-----|----------|--------|----------|\n| [life-dashboard-companion-app](https://github.com/owen282000/life-dashboard-companion-app) v1.4.0 | `POST /ingest/health` | `source: \"health_connect\"` required | Incremental sync, 200 records per type |\n| [HC Webhook](https://github.com/mcnaveen/health-connect-webhook) | `POST /ingest/hc-webhook` | `source` optional, `rmssd_millis` HRV, extra types | Full sync, all types in one POST |\n\nBoth endpoints require:\n```\nAuthorization: Bearer <DEVICE_TOKEN>\nContent-Type: application/json; charset=utf-8\n```\n\nThe HC Webhook endpoint also accepts 5 additional Health Connect types not present in the companion app: `skin_temperature`, `basal_metabolic_rate`, `vo2_max`, `intermenstrual_bleeding`, `body_water_mass`. Unknown type keys are silently tolerated — only types in the server's registry are processed.\n\n## Connect Your Phone\nSee [docs/ANDROID.md](docs/ANDROID.md) for step-by-step instructions.\n\n## Connect an LLM\nAdd to Claude Desktop config (`claude_desktop_config.json`):\n```json\n{\n  \"mcpServers\": {\n    \"health-hub\": {\n      \"url\": \"https://your-domain.example.com/mcp\",\n      \"headers\": {\"Authorization\": \"Bearer <YOUR_MCP_TOKEN>\"}\n    }\n  }\n}\n```\nFor Perplexity, OpenCode, or other MCP clients, use the same URL and token. The `Authorization` header must include the `Bearer ` prefix — the server rejects requests without it.\n\n## MCP Tools\n\n| Tool | Description |\n|---|---|\n| `daily_summary` | Daily health rollups: steps, distance, calories, sleep, HR, weight |\n| `metric_series` | Time series for any metric with day/week bucketing |\n| `sleep_detail` | Detailed sleep sessions with stages (deep, REM, light, awake) |\n| `get_sync_health` | Per-type sync status: last event, coverage, gaps, errors |\n| `inspect_last_payload` | Raw payload metadata and app diagnostics |\n\nEach tool returns an `object` (never a bare array) with a `caveats: string[]` field that warns the model about missing days, overlapping records, or aggregation changes. Responses are capped at 400 objects.\n\n## Known Limitations\n- No record IDs from Health Connect — deduplication is content-hash based\n- Multiple data sources (phone + watch) can cause double-counting for cumulative metrics. The server suppresses overlapping intervals, but this is a heuristic. Check the comparison panel on `/debug`.\n- App sync cursor only moves forward — records added to Health Connect retroactively may not arrive\n- Health Connect does not provide data older than 30 days without re-authorization — the server IS your archive. Back up `data/`.\n\n## License\nMIT — see [LICENSE](LICENSE).\n\n## Companion App\n[life-dashboard-companion-app](https://github.com/owen282000/life-dashboard-companion-app) v1.4.0\n",
  "bytes": 4476,
  "sha": "460edc92491b5eafda46bfccd31054b0df1c826b6c2d180f632de5a8a75e0e4b",
  "repo_slug": "naymevg/health-conect-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_naymevg_health_mcp_c8c90fc3/readme"
}