Health Hub MCP

io.github.naymEvg由 GitHub 账号 naymEvg 发布v0.1.0更新于 Oct 24, 2026

Self-hosted MCP server for Android Health Connect — 34 metrics, daily rollups, dedup, 5 LLM tools.

已验证Streamable HTTP可网页运行位置与生活数据与分析

概览

AI 生成的概览

自托管的 MCP 服务器,接收 Android Health Connect 数据,并通过五个工具向大模型客户端提供汇总后的健康指标。

可以做什么
  • 读取每日健康汇总,如步数、距离、卡路里、睡眠、心率和体重
  • 按天或按周分桶查询任意指标的时间序列
  • 查看带深睡、REM、浅睡和清醒阶段的详细睡眠记录
  • 检查各类型的同步状态、覆盖范围、缺口和错误
  • 查看原始载荷元数据和 App 诊断信息以排查数据接入问题
适用场景
适合已经自建 Health Hub 实例、并用 Android 配套应用上传数据的人,让助手基于自己的步数、睡眠、心率等 Health Connect 指标回答问题。
运行要求
需要在装有 Docker 和 Docker Compose 的主机上自行部署,并具备带 TLS 的域名,以及运行配套应用或 HC Webhook 客户端的 Android 14+ 设备。MCP 端点通过 streamable HTTP 访问,需在 Authorization 头中携带 Bearer 令牌;服务器端还需配置 DEVICE_TOKEN 和 MCP_TOKEN。
安装前请注意
Authorization 头中的 Bearer 令牌可访问你的健康数据,请妥善保管,并按服务器要求带上 Bearer 前缀。服务器把健康记录保存在本地 SQLite 数据库中,被描述为你的归档,请备份数据目录。聚合采用启发式方法:多数据源可能对累计指标重复计数,回溯补录或较早的记录也可能缺失。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Health Hub MCP,将其添加到工作区。
  2. 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Health Hub MCP Server

[CI]

Personal 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.

Android 14+ ──POST /ingest/health──────▶ ┌──────────────────┐  (companion app)                         │                  │Android 14+ ──POST /ingest/hc-webhook──▶ │   Health Hub     │──MCP──▶ LLM  (HC Webhook client)                     │   SQLite         │                   browser ──GET /debug──▶ └──────────────────┘

The 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.

Requirements

  • Android 14+ with life-dashboard-companion-app v1.4.0+
  • Any host with Docker and Docker Compose
  • Domain with TLS (Caddy handles certificates automatically)

Quick Start

bash
cp .env.example .env# Edit .env: set DEVICE_TOKEN and MCP_TOKEN (run: openssl rand -hex 32)docker compose up -d --buildcurl -s http://localhost:8000/health

Companion Apps

The 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.

AppEndpointFormatBest for
life-dashboard-companion-app v1.4.0POST /ingest/healthsource: "health_connect" requiredIncremental sync, 200 records per type
HC WebhookPOST /ingest/hc-webhooksource optional, rmssd_millis HRV, extra typesFull sync, all types in one POST

Both endpoints require:

Authorization: Bearer <DEVICE_TOKEN>Content-Type: application/json; charset=utf-8

The 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.

Connect Your Phone

See docs/ANDROID.md for step-by-step instructions.

Connect an LLM

Add to Claude Desktop config (claude_desktop_config.json):

json
{  "mcpServers": {    "health-hub": {      "url": "https://your-domain.example.com/mcp",      "headers": {"Authorization": "Bearer <YOUR_MCP_TOKEN>"}    }  }}

For 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.

MCP Tools

ToolDescription
daily_summaryDaily health rollups: steps, distance, calories, sleep, HR, weight
metric_seriesTime series for any metric with day/week bucketing
sleep_detailDetailed sleep sessions with stages (deep, REM, light, awake)
get_sync_healthPer-type sync status: last event, coverage, gaps, errors
inspect_last_payloadRaw payload metadata and app diagnostics

Each 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.

Known Limitations

  • No record IDs from Health Connect — deduplication is content-hash based
  • 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.
  • App sync cursor only moves forward — records added to Health Connect retroactively may not arrive
  • Health Connect does not provide data older than 30 days without re-authorization — the server IS your archive. Back up data/.

License

MIT — see LICENSE.

Companion App

life-dashboard-companion-app v1.4.0

来源:README.md,提交 fec00ab

工具

0
该服务器需要 API 密钥等凭据,因此 SourceWeft 无法在没有凭据的情况下读取其工具,也未收录。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 60%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分