Health Uplink for AI agents
The Health Uplink receiver is an MCP server for your Apple Health data. Claude Code, and any MCP client that supports streamable HTTP with a bearer token, reads your data through six read-only tools.
The MCP endpoint
The receiver serves MCP over streamable HTTP at its own address with /mcp at the end, for example http://100.100.1.1:8796/mcp on a Tailscale network. That is the address in HU_PUBLIC_URL, the same one your iPhone uploads to. Each agent gets its own bearer token. The receiver keeps only a hash of it, and you can revoke it at any time.
Agents read the receiver's store, not the phone, so they get answers while your iPhone is locked or offline.
Add it to Claude Code
Create a token for the agent. It is printed once; copy it.
docker compose exec healthuplink healthuplink tokens create --name claude-code
Then add the receiver to Claude Code:
claude mcp add --transport http healthuplink http://100.100.1.1:8796/mcp \
--header "Authorization: Bearer <token>"
Add --scope user to make it available in every project. To see or withdraw tokens later (without Docker, drop the docker compose exec healthuplink part, here and above):
docker compose exec healthuplink healthuplink tokens list
docker compose exec healthuplink healthuplink tokens revoke claude-code
With a self-signed certificate on your home network, Claude Code has to trust the receiver's certificate first. The README shows how with NODE_EXTRA_CA_CERTS.
Tools
All six tools only read. They return your records as data and do not interpret them. Text that came from your devices, such as source names, is shortened and stripped of control characters; agents should treat it as data, not as instructions.
list_types- The data types in the store, each with a short alias such as
heart_rate, its kind, unit, first and last date and counts. list_sources- The devices and apps that recorded data, with when each was first and last seen.
query- One type over a time range, as single records or grouped by hour, day, week or month. Readings such as heart rate stay separate per source and are never blended.
summary- Key daily values for a day, week or month next to the period before: steps, active energy, exercise minutes, resting heart rate, HRV, weight and sleep.
get_sleep- Sleep nights in a date range, with minutes per sleep stage and, on request, the single segments.
sync_status- Upload status per paired iPhone and per source: the last upload, gaps in the sequence, and batches the receiver did not accept.
Check freshness before answering
Every tool answer carries a freshness object. An agent should read it before it answers, and say how old the data is when it is not current.
last_upload_at: when the receiver last stored a batch from the iPhone.stale: true when no upload has arrived for more thanstale_after_hourshours (18).last_upload_low_power: true when Low Power Mode was on for the last upload, false when it was off, and null before the first upload. Low Power Mode pauses sending in the background.sources: up to 20 sources, most recent first, each withlast_sample_at, the time of its newest record.
A gap is normal while the iPhone is locked: iOS keeps Apple Health closed then, and the records follow after the next unlock. Every answer also carries tools_version, which is 1 today.
Questions to ask
- "How did I sleep this week compared with last week?"
- "What was my average daily step count in October?"
- "Show my resting heart rate per week for the last three months, per device."
- "Which apps and devices write my weight?"
- "When did my iPhone last upload, and is anything missing?"