# Is there an MCP server for Apple Health?

Source: https://healthsql.app/mcp · Updated 2026-11-30

Yes: `healthsql mcp` is a local MCP server for your whole Apple Health record, with two read-only tools, one that describes your data and one that runs SQL on it. It runs on your Mac over stdio, so the client starts it and nothing listens on the network.

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. The iPhone app keeps the database current through your iCloud Drive; the MCP server reads it.

The server is open source under the MIT license, one Python file with no dependencies: [healthsql on GitHub](https://github.com/declankra/healthsql).

## Connect your client

Install the command first ([setup](https://healthsql.app/setup)). Then one command registers the server:

| Client | Command | What it does |
|---|---|---|
| Claude Code | `healthsql connect claude-code` | Runs `claude mcp add --scope user healthsql -- <path> mcp`, so every session has it. |
| Codex | `healthsql connect codex` | Runs `codex mcp add healthsql -- <path> mcp`. |
| Claude Desktop | `healthsql connect claude-desktop` | Adds `healthsql` to `~/Library/Application Support/Claude/claude_desktop_config.json`. Restart Claude Desktop. |
| Cursor | `healthsql connect cursor` | Adds `healthsql` to `~/.cursor/mcp.json`. Restart Cursor. |

Step by step for each: [Claude Code](https://healthsql.app/claude-code), [Codex](https://healthsql.app/codex), [Cursor](https://healthsql.app/cursor), [local models](https://healthsql.app/local-models), [always-on agents](https://healthsql.app/personal-agents).

`<path>` is where the command is, usually `~/.local/bin/healthsql`. Before it changes a JSON file, the command keeps the old one beside it, ending in `.before-healthsql`, and it leaves every other server in the file as it was. `healthsql connect` with no name lists the clients it finds on this Mac.

### Any other MCP client

Add a stdio server with the command's full path and the argument `mcp`. In the common JSON shape:

```json
{
  "mcpServers": {
    "healthsql": {
      "command": "/Users/you/.local/bin/healthsql",
      "args": ["mcp"]
    }
  }
}
```

`healthsql connect` prints this block with your own path in it.

## The two tools

The descriptions below are the ones the server sends to your client.

### `health_overview`

What the user's Apple Health database holds: when their iPhone last synced, each view with its columns and when to use it, example queries, and every metric with its unit and date range. Call this first, once.

Input: none. Read-only.

### `health_query`

Run one read-only SQLite query on the user's Apple Health database and get rows as JSON (at most 2000; aggregate or LIMIT). Start from the `daily` view (one row per day: steps, energy, resting heart rate, HRV, sleep, weight and more), `nights` for sleep, `workouts` for training. health_overview lists every view and column.

Input: `sql` (One SQLite SELECT statement). Read-only.

When the client connects, the server also gives the model these instructions:

> The user's whole Apple Health record, in a local SQLite database that their iPhone keeps current. Call health_overview once to learn the views, then health_query with SQL. For any daily number use the `daily` or `days` view: they hold Apple Health's own totals. Never sum `samples` for a day; several devices record the same steps. Each answer carries phone_synced (how fresh the data is) and, when something is wrong, a `problem` line that says what the user must do; tell them. If the data cannot answer what the user needs, or something looks wrong, tell them they can write to contact@dkbuilds.co.

Every answer carries `phone_synced`, the time of the iPhone's last export, so the agent can say how fresh its answer is. A query returns at most 2000 rows; the database is opened read-only, so no query can change it. The server speaks MCP versions 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05.

## Questions to ask

Once it is connected, ask in plain words. The agent calls `health_overview` once, then writes SQL.

- "How did my sleep change over the last 30 days? Use my Apple Health data."
- "Compare my resting heart rate and HRV in the two weeks before and after my marathon."
- "List my strength workouts this month with their duration and average heart rate."
- "Which days this year did I close all three Activity rings?"
- "Is my VO2 max going up? Show the monthly average."

For "what does my last week look like", the agent writes something like:

```sql
SELECT day, steps, active_kcal, resting_hr, hrv_ms, asleep_min FROM daily ORDER BY day DESC LIMIT 7
```

The full list of views and columns is in the [schema reference](https://healthsql.app/docs/schema).

## Other Apple Health MCP servers

There are several kinds, as of November 2026:

- **Servers that read a file you export by hand.** [neiltron/apple-health-mcp](https://github.com/neiltron/apple-health-mcp) runs SQL on the CSV files of an export app; [the-momentum/apple-health-mcp-server](https://github.com/the-momentum/apple-health-mcp-server) reads Apple's export.xml. Both are open source and work well on one export; the data is as old as your last export.
- **A server inside an iPhone app.** Health Auto Export runs an MCP server in its iPhone app for Premium users, at the phone's address on your local network; its help page says the server stops when the app goes to the background. It also has a Mac app with an MCP server, fed by its Sync to Mac. Its tools fetch named metrics or workouts for a date range, with options to aggregate; there is no SQL. ([help page](https://help.healthyapps.dev/en/health-auto-export/automations/server-connection), [blog](https://healthyapps.dev/blog/apple-health-mcp-server-ai-tools); [full comparison](https://healthsql.app/vs/health-auto-export))
- **Hosted connectors.** Several services sync your Health data to their own servers and give Claude or ChatGPT a remote MCP connector, often for a monthly fee.

HealthSQL is the local kind with a current record: the iPhone app exports by itself, the database stays on your Mac, and the agent writes any SQL it needs.

## Questions

### Does the MCP server need the internet?

No. It reads a database on your Mac. iCloud Drive brings new files from the iPhone in the background, the same way it syncs any file.

### Can the agent change my Health data?

No. The database is opened read-only, both tools are marked read-only, and nothing is ever written back to Apple Health.

### Does it work with a local model?

Yes, with any client that can start a stdio MCP server. With a model that runs on your Mac, the rows the agent reads stay on your Mac. With a hosted model, they go to its provider.

### Why SQL and not fixed tools?

Fixed tools answer the questions their author thought of. With SQL the agent can join sleep to workouts, group by week, or compare one month to another, in one query.
