health-relay
Provides tools for a Hermes AI agent to query locally stored health readings, including samples, daily summaries, trends, sleep breakdowns, and available health data streams.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@health-relayHow did I sleep this week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
health-relay
Self-hosted bridge between your Samsung Watch → Sync2Ra1 phone app and your Hermes AI agent. The app pushes health readings here over your LAN; the data is stored locally (SQLite) and exposed via REST and MCP so your agent can query it.
Galaxy Watch ─▶ Samsung Health ─▶ Sync2Ra1 (phone) ──push──▶ health-relay ──MCP/REST──▶ HermesAll data stays on your network. Nothing is sent anywhere else.
Quick start (Docker or 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}Data persists in ./data/ledger.db (SQLite, WAL mode).
Run without Docker
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
HR_AUTH_TOKEN=<secret> ./run.shRelated MCP server: Yummy Health MCP
Point the phone app at it
In Sync2Ra1 → Data tab → Relay (Hermes bridge):
Field | Value |
Relay URL |
|
Token | same secret as |
Tap Save → Sync now. Readings arrive within seconds.
Connectivity
phone (Sync2Ra1) ──HTTP :8790──▶ health-relay ◀──MCP stdio / HTTP── Hermes
same LAN · or Tailscale for anywhere-accessRule | Detail |
Direction | Phone → relay (outbound from phone; nothing connects into the phone) |
Port | TCP 8790 inbound to the machine running the relay — open it in that host's firewall |
Protocol | Plain HTTP + |
Anywhere-access | Install Tailscale on the box and phone; point the app at the Tailscale IP ( |
Cadence | App auto-syncs hourly + on app launch + manual Sync now |
Offline | Phone buffers everything in local SQLite; on reconnect it pushes the full backlog (oldest first) and re-syncs the last 48 h so Samsung's revisions propagate |
Duplicates | Impossible to double-count — every reading has a unique key; replays are ignored server-side |
Hermes location | Same machine (MCP runs as a local subprocess reading the SQLite file) or remote (use the REST endpoints instead of MCP) |
REST API (bearer auth)
Endpoint | Purpose |
| liveness (no auth) |
| batch ingest — idempotent, replays are no-ops |
| raw readings |
| per-metric min/max/avg/count |
| daily rollups |
| totals per type |
curl -H "Authorization: Bearer <secret>" \
"http://localhost:8790/api/v1/health/daily-summary?date=$(date +%F)&tz=Europe/London"Plug into Hermes (MCP)
The MCP server reads the same SQLite file — run it from this repo:
python3 -m venv .venv-mcp
.venv-mcp/bin/pip install fastmcpAdd to your agent's MCP config:
{
"mcpServers": {
"health-relay": {
"command": "<repo-path>/.venv-mcp/bin/python",
"args": ["<repo-path>/mcp_server.py"],
"env": { "HR_DATA_DIR": "<repo-path>/data" }
}
}
}Tools your agent gets
Tool | Answers questions like |
| "what health data do you have?" |
| "show my heart rate this morning" |
| "how active was I yesterday?" |
| "how did I sleep this week?" |
Day boundaries respect your timezone (tz="Europe/London" etc., DST handled).
Recorded streams
Heart rate · SpO₂ · skin temperature · respiration · resting HR · VO₂max · sleep duration/score/stages · steps & floors (hourly + daily) · workouts · activity calories/time/distance · body composition (BIA) · energy score · blood pressure · glucose · hydration · meals.
Configuration
Env var | Default | |
| (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 your health, fitness, nutrition, sleep, and wearable data to your AI assistant.
Private health and fitness analytics through a secure remote MCP connection.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceExposes personal health data (recovery, sleep, strain, etc.) as MCP tools for AI agents to query and analyze.3MIT
- 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.2MIT
- 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