How do I give Cursor my Apple Health data?
Install the HealthSQL iPhone app, then on your Mac run curl -fsSL https://healthsql.app/install | sh and healthsql connect cursor, which adds HealthSQL to ~/.cursor/mcp.json, Cursor's global MCP file. Restart Cursor, and its agent can query your Health data through two read-only tools.
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.
Connect over MCP
healthsql connect cursorThis adds one entry to ~/.cursor/mcp.json. It keeps every other server in the file, and saves the file as it was beside it, ending in .before-healthsql. To add it by hand, put this in the same file:
{
"mcpServers": {
"healthsql": {
"command": "/Users/you/.local/bin/healthsql",
"args": ["mcp"]
}
}
}Use your own full path; healthsql connect with no name prints it. Cursor's docs give ~/.cursor/mcp.json for servers in every project and .cursor/mcp.json in a project folder for that project only, and list local stdio servers as supported (Cursor's MCP docs, which now open on the Grok Build docs site, read 30 November 2026). Your Health data belongs to you rather than to one project, so the global file is the usual place.
The two tools are health_overview, which describes your data, and health_query, which runs one read-only SQL query: Apple Health MCP server.
Use it from the terminal
Cursor's agent can also run healthsql query "SELECT ..." as a terminal command. Its docs say it runs terminal commands in a sandbox that blocks unauthorized file access and network activity, so the agent may ask before it runs a command that reads iCloud Drive. MCP avoids that question each time.
Questions to try
- "Use the healthsql tools. How many hours did I sleep on average each week this month?"
- "Build a small dashboard page from my daily steps, resting heart rate and sleep for the last 90 days."
- "Which workouts this year had the highest average heart rate?"
Questions
Does it work if Cursor runs on another computer?
No. The MCP server is a local process that reads files iCloud Drive brings to your Mac, so Cursor must run on that Mac.
Where does the data go?
The database stays on your Mac. The rows the agent reads go to the model provider Cursor uses for that request.
What about Claude Code and Codex?
The same command connects them: Claude Code, Codex.