Home / Query Apple Health with SQL or AI
Query Apple Health with SQL or AI
Health to Mac does not hide your data behind a proprietary format. It keeps your Apple Health history in one plain SQLite database on your Mac, at ~/Library/Application Support/Health to Mac/health.sqlite. That means you can query it directly with SQL, or let an AI assistant you choose read it through a built-in, read-only MCP server. No account, no API of ours, no data sent to a server of ours.
Query it with SQL
- Find the database at
~/Library/Application Support/Health to Mac/health.sqlite. Back it up like any other file before you experiment. - Open it with any SQLite tool — the
sqlite3command line, a GUI browser, or a script in Python or R. - Or use the
healthtomaccommand-line tool bundled with Health to Mac.app, which reads the same file.
The database holds the records, workouts, sleep, ECGs, State of Mind, medications and Activity rings the app imported. Because it is a local file, a query runs whether or not your iPhone is nearby, and nothing you type leaves the Mac.
Let an AI assistant read it
Health to Mac has no AI model of its own. It ships a read-only MCP server, so Claude, Cursor or any other MCP client can answer questions from your data and cannot change or delete anything. Its tools cover metrics and daily values, period comparisons, sleep, Activity rings, workouts, steps, running best efforts, strength training, muscle fatigue, ECGs, State of Mind and medications. The server reads the Mac's database, so it keeps working while the iPhone is asleep.
The app's AI Assistants screen copies the setup for your client. For Claude Code, add the server with:
$ claude mcp add healthtomac -- '/Applications/Health to Mac.app/Contents/MacOS/healthtomac-mcp' Then ask it something like "How did my resting heart rate change after I started running in March?", "Which muscles haven't I trained in two weeks?", or "Compare my sleep this month with the same month last year."
The honest caveats
Whatever the assistant reads is sent to that assistant's model provider, under their privacy terms — Health to Mac cannot change that. The MCP server itself never contacts the internet. Workout routes (GPS maps) are not kept yet, so there is no route geometry to query; the import stores only a route's GPX file name. And the server is read-only: it is for asking questions, not for editing your history.
If you prefer to keep everything in SQL and never involve an AI model at all, that works too — the file is yours. If you would rather ask questions in plain language, point any MCP client at the bundled server and keep the data on your Mac.
See bring your own AI on the home page, or the five short answers these guides expand on.