Home / Bring your own AI to your Apple Health data

Bring your own AI to your Apple Health data

Health to Mac ships a small, read-only server that an AI assistant can talk to over MCP. You bring the assistant and its model; your Health database never leaves your Mac.

What MCP is, in one sentence

MCP (Model Context Protocol) is an open standard that lets an AI assistant call tools an app exposes — here, a set of read-only tools over the Health database on your Mac.

There is no built-in model and no API key field in Health to Mac. The server speaks MCP on standard input and output; it has no network port and never contacts the internet itself.

Which assistants work

The app's AI Assistants screen gives the exact setup for Claude Code, Claude Desktop and Cursor. Any other MCP client that can start a local server over stdio works too. Pick the model you already pay for (or run one locally); Health to Mac has no opinion about it.

Set it up

  1. Import your history, or pair the free iPhone app, so the database has data in it.
  2. Open AI Assistants in the app's sidebar. Choose your client from the picker; the screen shows the snippet to paste and a Copy button, plus a check that runs the server once against your database.
  3. For Claude Code, run this in Terminal (add --scope user to use it in every project):
    $ claude mcp add healthtomac -- '/Applications/Health to Mac.app/Contents/MacOS/healthtomac-mcp'
  4. For Claude Desktop (Settings › Developer › Edit Config) and Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in one project), add the server to mcpServers:
    {
      "mcpServers": {
        "healthtomac": {
          "command": "/Applications/Health to Mac.app/Contents/MacOS/healthtomac-mcp"
        }
      }
    }
    Then quit and reopen Claude Desktop, or turn the server on in Cursor Settings › MCP.
  5. For any other client, run /Applications/Health to Mac.app/Contents/MacOS/healthtomac-mcp with no arguments. It speaks MCP on stdin and stdout.

By default the server opens the database at ~/Library/Application Support/Health to Mac/health.sqlite. To point it elsewhere, pass --db <path> or set HEALTHTOMAC_DB. The environment variable wins. --check verifies the server and exits.

What the assistant can ask

Nineteen read-only tools, grouped here by what they answer rather than listed one by one:

  • What's in the database. Which metrics exist, how many samples each has, how far back the data goes, when it last changed, and which devices or apps recorded it.
  • Daily values and comparisons. Daily totals and averages, two periods compared with the change between them, the original samples behind them, and where a metric came from.
  • Sleep and Activity rings. Per-night sleep with its stages, and Move, Exercise and Stand values against their goals.
  • Workouts and runs. A list of workouts merged from Apple Health and Strava, one workout in detail, run splits with pace, heart-rate and cadence curves, and fastest efforts from 400 m to a marathon with race-time estimates.
  • Steps. Totals, averages, best day, week and month, weekday averages and goal streaks.
  • Strength and muscles. Sessions, sets and volume, lifts and their records, estimated fatigue per muscle, and what loaded it.

There is no raw SQL and no way to write, change or delete anything. Lists are paged (100 rows by default, 1,000 at most) and each result stays under 1 MiB. Fatigue and race-time predictions are heuristics, not medical advice. Dates are in your Mac's time zone and heart rate is in beats per minute.

Privacy

Everything stays local until you ask a question. The server is read-only, starts on your Mac, and only returns data for the tool the assistant calls — nothing is sent in the background. Whatever a tool returns is then passed to the assistant's model provider under that provider's terms, so it does leave your Mac at that point. Remove the server from your client's settings and access stops; no account of ours is involved.

Example questions

  • How did my resting heart rate change after I started running in March?
  • Which muscles haven't I trained in two weeks?
  • Compare my sleep this month with the same month last year.
  • What was my fastest 5 km this year, and what pace did I hold?

The setup, the tool list and the options are documented in docs/MCP.md in the source, and the server's own tools are listed in Sources/HealthMCP/ToolCatalog.swift.