DEV Community

Philip D'Souza
Philip D'Souza

Posted on • Originally published at healthexport.dev

Connect Apple Health to Claude via MCP, the Exact Config

Claude can reason about your sleep, HRV, and training load. What it cannot do out of the box is reach your Apple Health data. It cannot open the Health app, and pasting a giant CSV into a chat window is a dead end: the units get mangled, the snapshot is stale the moment you export it.

The fix is MCP, the Model Context Protocol. With a small local server, Claude calls read-only tools against your real Apple Health data whenever you ask a question. This is the exact setup.

The seven read-only tools

The Health Export AI MCP server is zero-dependency Node. No Docker, no Python environment, no cloud bridge. It exposes seven tools:

  • get_mcp_status confirms the server can see your data
  • list_metrics lists which of the 190 metrics are available
  • get_health_metrics pulls raw values for a metric and date range
  • get_trends week-over-week or month-over-month trend math
  • compare_periods A/B two time windows (this week vs last)
  • get_structured_export a tidy structured bundle for deeper analysis
  • query_health_data flexible plain-language queries across metrics

The data never leaves your control. The iOS app reads Apple Health read-only and writes a JSON file to a folder you pick. The MCP server reads that folder. Nothing transits the developer's servers.

The Claude Desktop config

Two routes. The one-click .mcpb bundle: download health-export.mcpb, double-click it, Claude Desktop prompts you for the data folder, confirm, restart.

Or edit claude_desktop_config.json by hand and merge a health-export entry into mcpServers:

{
  "mcpServers": {
    "health-export": {
      "command": "node",
      "args": ["/Users/you/.health-export-mcp/server.mjs"],
      "env": {
        "HEALTH_DATA_DIR": "/Users/you/Library/Mobile Documents/iCloud~ai~healthexport~app/Documents"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Swap in your real SERVER_PATH and HEALTH_DATA_DIR. Fully quit and reopen Claude Desktop, it only reads the config at launch. Verify by asking: "Use the health-export tools to call get_mcp_status."

The same setup for Cursor, opencode, OpenClaw

The server never changes, only where each client wants its config.

Cursor uses the same mcpServers shape as Claude Desktop. Drop the identical block into ~/.cursor/mcp.json.

opencode uses a different shape. The top key is mcp, command is an array, and the env key is environment:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "health-export": {
      "type": "local",
      "command": ["node", "/Users/you/.health-export-mcp/server.mjs"],
      "enabled": true,
      "environment": {
        "HEALTH_DATA_DIR": "/Users/you/Library/Mobile Documents/iCloud~ai~healthexport~app/Documents"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

OpenClaw consumes standard MCP servers; add a health-export block using the same node server.mjs command and HEALTH_DATA_DIR.

A worked example

Once connected, you talk to Claude normally:

You: How did my recovery trend this week compared to last week?
      Use my Health Export data.

Claude: [calls get_trends, then compare_periods]
        Your HRV averaged 61 ms this week, up 4.4% from 58 ms last week.
        Resting heart rate dropped from 56 to 55 bpm. Sleep held at 7.1 h.
Enter fullscreen mode Exit fullscreen mode

No CSV, no pasting, no stale snapshot. Live numbers from your local export.

Troubleshooting

Claude shows no health-export tools: the config was not loaded. Confirm the JSON is valid, you edited the right file for your OS, and you fully quit and relaunched Claude Desktop.

Server connects but says no data: your HEALTH_DATA_DIR points at the wrong folder, or the export has not synced the .health-cache.json file yet. Check export is on in the iOS app, iCloud Drive has finished syncing, and the path matches with ~ expanded.

Wrong env key for your client: Claude Desktop, Claude Code, and Cursor use mcpServers with env. opencode and OpenClaw use mcp with environment and an array-style command. Putting env into an opencode file silently does nothing.


This is a summary. The complete guide with the full troubleshooting section, the Claude Code CLI setup, and the Hermes notes is on the original post: Connect Apple Health to Claude via MCP

Top comments (0)