# HealthSQL > 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. Price: $7.99, one purchase, once: the export runs by itself. The full export is free when you open the app. The iPhone app is not on the App Store yet. There is no server and no account: the files travel through the person's own iCloud Drive. ## Set up - [Setup for an AI agent](https://healthsql.app/agents.md): step-by-step instructions an agent follows to install and connect HealthSQL on the person's computer - [Setup](https://healthsql.app/setup.md): Install the iPhone app, run one command on your Mac, connect your agent. With a fix for every problem the healthsql command reports. - [Install script](https://healthsql.app/install): `curl -fsSL https://healthsql.app/install | sh` - [The command](https://healthsql.app/healthsql): `healthsql`, one Python file, standard library only ## Guides - [Apple Health MCP server](https://healthsql.app/mcp.md): 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. - [Claude and Apple Health](https://healthsql.app/claude.md): 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. - [Apple Health in Claude Code](https://healthsql.app/claude-code.md): 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 SQLite](https://healthsql.app/apple-health-database.md): 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](https://healthsql.app/apple-health-on-mac.md): 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. - [Apple Health API](https://healthsql.app/apple-health-api.md): 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. - [Automatic export to a Mac](https://healthsql.app/export-apple-health-automatically.md): 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. - [HealthSQL vs Health Auto Export](https://healthsql.app/vs/health-auto-export.md): 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. ## Reference - [Database schema](https://healthsql.app/docs/schema.md): Reference for the HealthSQL SQLite database: every view and column, the Health type behind each daily column, the raw tables, units and example queries. - [Export format](https://healthsql.app/docs/format.md): What the HealthSQL iPhone app writes to iCloud Drive: deflated JSON lines, one line per record, Health's daily totals, deletions and status.json. - [Help](https://healthsql.app/help.md): Answers to common questions about HealthSQL: setup, freshness, which records are included, privacy, price, agents and removing it. ## Blog - [export.xml and AI](https://healthsql.app/blog/apple-health-export-xml-ai.md): Apple's Export All Health Data is one huge XML file that is out of date the next day. Why that fails with AI, and how to keep a current database instead. - [Double-counted steps](https://healthsql.app/blog/apple-health-steps-double-counted.md): Your Watch, iPhone and ring each record the same steps, so summing Health samples counts them two or three times. How Health counts once, and the right SQL. - [What automatic means on iOS](https://healthsql.app/blog/automatic-apple-health-export-ios.md): iOS locks Health data while the iPhone is locked and wakes apps at most hourly for some types. What automatic can honestly mean for any export app. - [What ChatGPT Health and Claude don't reach](https://healthsql.app/blog/chatgpt-health-claude-apple-health-limits.md): Both work only in their own chat apps and only in the US; neither reaches Claude Code, Codex, Cursor or local models. The limits, from the help pages. ## Optional - [Privacy](https://healthsql.app/privacy.md): HealthSQL has no server and no account. Your Health records go to your own iCloud Drive, then to your computer. We never receive them. - [Home](https://healthsql.app/index.md): An iPhone app and a command that copy your whole Apple Health record into a local SQLite database, so Claude, Codex and other agents can query it. - [Every page in one file](https://healthsql.app/llms-full.txt)