How do I give an always-on agent on my Mac my Apple Health data?
Install the healthsql command on the Mac where the agent runs and register it as an MCP server, or let the agent run healthsql query from its shell. The iPhone keeps the data current through iCloud Drive, so the agent can answer at any hour without you exporting anything.
HealthSQL is an iPhone app and a command-line tool that copy your whole Apple Health record into a local SQLite database on your computer, so AI agents can query it with SQL or MCP. OpenClaw and Hermes Agent are two such agents: both run in the background on your own computer and both can use MCP servers and shell commands (their docs, read 30 November 2026).
OpenClaw
OpenClaw describes itself as an open-source AI assistant that runs on your own computer and meets you in the chat apps you already use; it is stewarded by the OpenClaw Foundation (openclaw.ai). It installs as a background service on macOS, and its docs give a command to add an MCP server (OpenClaw docs, MCP). For HealthSQL:
openclaw mcp add healthsql --command /Users/you/.local/bin/healthsql --arg mcpHermes Agent
Hermes Agent, by Nous Research, can install itself as a launchd agent on a Mac and reads MCP servers from ~/.hermes/config.yaml, under mcp_servers (Hermes Agent docs, MCP). For HealthSQL:
mcp_servers:
healthsql:
command: /Users/you/.local/bin/healthsql
args: ["mcp"]Use your own full path in both; healthsql connect with no name prints it. Any other agent that runs on your Mac works the same way: as an MCP client with the command and the argument mcp, or by running healthsql query itself.
A morning brief
Ask the agent for something like this once a day:
Every morning at 8, use healthsql. Read last night from the nights view and yesterday from the daily view. Send me three lines: how long I slept and how it compares with my 14-day average, my resting heart rate and HRV against the same average, and yesterday's steps. Say when the phone last synced. If the answer has a problem line, send me that instead. Do not give medical advice.Each answer from HealthSQL carries phone_synced. iOS lets no app read Health while the iPhone is locked, so last night's sleep reaches the Mac after you first unlock the phone in the morning. With HealthSQL's automatic export, that happens by itself; schedule the brief for after you usually pick up your phone. What automatic means on iOS.
Things to check
- macOS permission. A background agent is a program like any other: if
healthsqlsays it may not read iCloud Drive, allow iCloud Drive for the program that runs the agent, in System Settings, Privacy & Security, Files and Folders (or Full Disk Access). - Where the words go. The rows the agent reads go to its model provider, unless it runs a local model (local models). A brief sent to you through a chat app also passes through that app.
- One Mac. The agent must run on the Mac that has the files. Every MCP client and tool option: Apple Health MCP server.
Questions
Can these agents use a local model?
Ollama's docs list OpenClaw and Hermes Agent among the agents it can start with local models (Ollama, read 30 November 2026). With a local model, the rows stay on your Mac.
Does the agent need to keep a copy of my data?
No. HealthSQL keeps the database current; the agent asks it when it needs to. Telling the agent not to copy the database or the export files elsewhere is one of the rules for agents.
What if the agent's answer looks stale?
Ask it for phone_synced. If the phone has not exported for more than 3 days, the answer has a problem line that says what to do.