HealthSQL guides
Updated
Every page on this site, grouped by what you want to do. Each one answers one question and is dated.
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. For an agent, the same list is in llms.txt, and the setup steps are in agents.md.
Set up
- Set up HealthSQL: iPhone, Mac and your AI agent: Install the iPhone app, run one command on your Mac, connect your agent. With a fix for every problem the healthsql command reports.
- Apple Health MCP server for Claude, Codex and Cursor: A local, read-only MCP server for your whole Apple Health record: two tools, SQL over SQLite, nothing on the network. Setup for every MCP client.
- HealthSQL database schema: views, columns, example SQL: Reference for the HealthSQL SQLite database: every view and column, the Health type behind each daily column, the raw tables, units and example queries.
- HealthSQL export format (v1): the files in iCloud Drive: What the HealthSQL iPhone app writes to iCloud Drive: deflated JSON lines, one line per record, Health's daily totals, deletions and status.json.
- HealthSQL help: common questions and answers: Answers to common questions about HealthSQL: setup, freshness, which records are included, privacy, price, agents and removing it.
Agents
- Connect Claude to Apple Health: iPhone, Desktop, Code: Claude's Apple Health connection works only in the Claude iPhone app, in the US, on paid plans. How to give Claude Desktop and Claude Code your Health data.
- Connect Apple Health to Claude Code: shell or MCP: Give Claude Code your whole Apple Health record. Install the healthsql command, then Claude runs SQL from the shell or over MCP. Steps and prompts.
- Apple Health in Codex: MCP server or shell: Give OpenAI's Codex your Apple Health record: install the healthsql command, run healthsql connect codex, and Codex queries it with SQL over MCP or the shell.
- Apple Health in Cursor: add the MCP server: Give Cursor's agent your Apple Health record: healthsql connect cursor adds a local MCP server to ~/.cursor/mcp.json. Two read-only tools, SQL over SQLite.
- Apple Health with a local model: LM Studio, Jan, Goose: Use your Apple Health data with a model that runs on your Mac, so the rows never leave it. Which local apps speak MCP, and how to add the healthsql server.
- Apple Health for an always-on agent on your Mac: Give an agent that runs on your Mac all day, such as OpenClaw or Hermes Agent, your Apple Health record over MCP or the shell, kept current from your iPhone.
Wearables
- Oura data for AI agents, through Apple Health: Your AI agent can read what the Oura app writes to Apple Health: sleep stages, heart rate, steps, workouts. What Oura sends, what it keeps, and the SQL.
- Garmin data for AI agents, through Apple Health: Your AI agent can read what Garmin Connect writes to Apple Health: steps, sleep, heart rate, workouts and more. What Garmin sends, what it keeps, and the SQL.
- WHOOP data for AI agents, through Apple Health: Your AI agent can read what WHOOP writes to Apple Health: sleep, workouts, heart rate, resting heart rate, SpO2. What WHOOP sends, what it keeps, and the SQL.
- Strava activities for AI agents: two routes: Strava has its own MCP connector for Claude and Gemini. Or read the activities Strava writes to Apple Health with SQL, next to the rest of your Health data.
Your data
- Let an AI agent read your sleep and HRV data: Give an AI agent your Apple Health sleep stages, HRV and resting heart rate as SQL: one row per night, one row per day, with example queries it can run.
- Apple Health data to CSV or a spreadsheet, one command: Turn your Apple Health record into CSV for Excel, Numbers or Google Sheets with healthsql query --csv: daily totals, workouts or any SQL query.
- A daily Apple Health note in Obsidian, by your agent: Have an AI agent write a daily health note in your Obsidian vault from your Apple Health data: a prompt to paste, the note it writes, and a daily run.
- Get Apple Health data into a SQLite database: HealthSQL keeps your whole Apple Health record in a local SQLite file, current from your iPhone via iCloud Drive. Views, example SQL, export.xml compared.
- Apple Health on a Mac: what Apple offers, what works: Apple makes no Health app for the Mac, and Mac apps cannot read HealthKit. How to get your Health data onto a Mac for AI agents and SQL.
- Does Apple Health have an API? HealthKit, explained: HealthKit, Apple's only API for Health data, works inside apps on iPhone, iPad and Watch, not on the web or a Mac. How to get a local API for your agents.
- Export Apple Health data to your Mac automatically: Health wakes the HealthSQL app for new data; it writes to your iCloud Drive and your Mac reads it as SQLite. What automatic means on iOS, and other ways.
Compare
- HealthSQL vs Health Auto Export: features, price, MCP: Health Auto Export sends Apple Health data to many places in many formats. HealthSQL keeps your whole record as a local SQL database for agents.
- Health Auto Export alternatives, by what you need: Alternatives to Health Auto Export for CSV files, workouts, Markdown notes, AI agents and self-hosted databases, with prices and how data reaches a computer.
- HealthSQL blog: Apple Health data and AI agents: Answers about Apple Health data and AI agents: double-counted steps, what ChatGPT Health and Claude don't reach, export.xml, automatic export on iOS.
- HealthSQL privacy: your health data stays yours: HealthSQL has no server and no account. Your Health records go to your own iCloud Drive, then to your computer. We never receive them.