health-relay
health-relay
Puente autoalojado entre tu reloj Samsung Watch → la app para el móvil Sync2Ra1 y tu agente de IA Hermes. La app envía los datos de salud por tu LAN; los datos se almacenan localmente (SQLite) y se exponen vía REST y MCP para que tu agente pueda consultarlos.
Galaxy Watch ─▶ Samsung Health ─▶ Sync2Ra1 (phone) ──push──▶ health-relay ──MCP/REST──▶ HermesTodos los datos permanecen en tu red. No se envía nada a ningún otro sitio.
Inicio rápido (Docker o Podman)
echo "HR_AUTH_TOKEN=<choose-a-secret>" > .env
docker compose up -d # or: podman compose up -d
curl http://localhost:8790/healthz # -> {"ok":true}Los datos se conservan en ./data/ledger.db (SQLite, modo WAL).
Ejecutar sin Docker
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
HR_AUTH_TOKEN=<secret> ./run.shRelated MCP server: Huawei Training Camp MCP
Configura la app del teléfono
En Sync2Ra1 → Data tab → Relay (Hermes bridge):
Campo | Valor |
URL del relay |
|
Token | el mismo secreto que |
Pulsa Guardar → Sincronizar ahora. Las lecturas llegan en pocos segundos.
Conectividad
phone (Sync2Ra1) ──HTTP :8790──▶ health-relay ◀──MCP stdio / HTTP── Hermes
same LAN · or Tailscale for anywhere-access| Regla | Detalle |
| ---------------- | ---- --------------------- |
| Dirección | Teléfono → relay (saliente desde el teléfono; no se conecta nada hacia el móvil) |
| Puerto | TCP 8790 entrante hacia la máquina que ejecuta el relay — ábrelo en el firewall de esa máquina |
| Protocol | HTTP plano + Authorization: Bearer <token>. Mantlenlo solo en la LAN o pónlo detrás de un Proxy inverso (Caddy/nginx) para TLS |
| Acceso desee caquier lugar | Instala Tailscale en perso y in the móvil; apunta la app a la IP de Tailscale (http://100.x.y.z:8790) — cifra3ddo, funciona con Red de datos, noches no pueretos asimporta la internes |
| Frecuencia | La app se sincroni a cada hora + al inicii of the mobile + Sincnow manual |
| Sín conexón | El teléfon ostora todo SQLite en local; la conexión resta ableback containtionado (máso ansono from futhest to latest) and re-sincabs ultimas 48 h so laser evisiones de Samung propúgalen |
| Rigido | Imposible da doble contar — cadera lectura una únicave; replays son not the ser del servidor |
| Hermes loc| locap. ret of the same machine (MCP runs as a subproc local that reads the SQLite file) or remote (use REST endpoints instead of MCP) |
REST API (bearer auth)
Endpoint | Propósito |
| Comprobación de vida (sin autenticación) |
| Ingestión por lote — idemottenente, los replays son no-operación |
| Lecturas sin procesar |
| Reapor Gre-minute min/point/promedon/count per métrics |
| Dications daily rollups |
| Totales por type |
curl -H "Authorization: Bearer <secret>" \
"http://localhost:8790/api/v1/health/daily-summary?date=$(date +%F)&tz=Europe/London"Plug the Hermes (MCP)
The MCP server reads the same SQLite file — run it from this recruittest:
python3 -m venv .venv-mcp
.venv-mcp/bin/pip install fastmcpAdd this to your agent's MCP setup:
{
"mcpServers": {
"health-relay": {
"command": "<repo-path>/.venv-mcp/bin/python",
"args": ["<repo-path>/mcp_server.py"],
"env": { "HR_DATA_DIR": "<repo-path>/data" }
}
}
}Tools that your agent has
Tool | Answers questions like |
| "¿qué datos de salud tienes?" |
| "muéstrame mi ritmo cardíaco esta mañana" |
daily_summary(date, tz) | "¿cómo de activo estuve ayer?" |
sleep_breakdown(nights) | "¿cómo dormí esta week?" |
Los límites de cada día se calculan según tu zona horaria z=`/GMT or etc. (adjusted by daylight saving).
Streams recorded
Heart rate · SpO₂ · skin temp · respiration · resting heart rate · VO₂max · duration/ride score/stages · steps & floors (every hour + daily) · workouts · activity calories/time/distance · body composition (BIA) · energy score · blood prees · blood glucose · hydration · meals.
Configuration
Environment var | Default | Description |
| (empty = auth off) | set this in production |
|
| |
|
| keep on trusted LAN |
|
| SQLite lives here |
Tests
.venv/bin/python -m pytest tests/ -qTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Connect your synced Apple Health data to compatible AI assistants through OAuth MCP. Ask about sleep, workouts, activity, heart rate and other Health metrics; explore summaries or selected samples, and check when your iPhone last synced. Send product feedback from your assistant through the MCP. Try: “How did I sleep this week?” “Summarize my recent workouts.” “When did my health data last sync?” Requires A Good Sign for iPhone, your chosen Health permissions, a completed sync and an active subscription for health-data answers. AI-client support and setup vary. Setup: https://agoodsign.app/setup MCP endpoint: https://api.healthgateway.app/mcp Privacy: https://api.healthgateway.app/privacy
Hosted Apple Health MCP for Claude and ChatGPT, works outside the US. iPhone app, no local server.
Connect your wearables, rings and training apps, then ask your AI about your own health data.
Hosted Apple Health MCP: daily brief, records, sleep, HRV in ChatGPT, Claude, Grok. Free, no export.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceExposes personal health data (recovery, sleep, strain, etc.) as MCP tools for AI agents to query and analyze.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to query and analyze Huawei Health data, including training records, sleep, heart rate, and athletic performance, through 14 MCP tools without third-party servers.17MIT
- AlicenseAqualityBmaintenanceEnables local, read-only access to Garmin Connect health and training data through MCP, letting assistants summarize recovery, sleep, activities, and more without uploading your data.29MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to retrieve wellness metrics such as activity, blood pressure, glucose, heart rate, sleep, and SpO2 from a PostgreSQL-backed health database via MCP tools.-