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: Yummy Health 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/ -qThis server cannot be deployed
Maintenance
Related MCP Connectors
- freddyOAuthcoach.freddy
Connect your wearables, rings and training apps, then ask your AI about your own health data.
Let AI agents query data and act across all your business apps via MCP.
Connect AI agents to the health, screen-time and recorded location data you choose to share from myself.md. Discover schemas, query connected phones, and read paginated JSON or JSONL cloud exports. OAuth sign-in and explicit data grants are required. Phone requests depend on connectivity and OS permissions; cloud reads require existing storage access. Owners can revoke sharing; revocation does not erase recipient copies. Privacy: https://myself.md/privacy · Terms: https://myself.md/terms · Support: cody@isolated.tech
Connect your health, fitness, nutrition, sleep, and wearable data to your AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceExposes personal health data (recovery, sleep, strain, etc.) as MCP tools for AI agents to query and analyze.4MIT
- FlicenseNot gradedqualityBmaintenancePrivate, read-only health data bridge that reads from Android Health Connect and exposes heart rate, steps, sleep, and other health metrics to ChatGPT via MCP tools.-
- AlicenseNot gradedqualityBmaintenanceEnables 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.3MIT
- AlicenseBqualityAmaintenanceEnables 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.19MIT