How to Connect Apple Health to Claude: iPhone or Mac
On iPhone, connect Apple Health in the Claude app. On a Mac, the open-source MCP server lets Claude Desktop, Cursor, and any MCP client query steps, sleep, HRV, and workouts locally, with zero cloud upload.
Claude → MCP → Mac app → HealthKit. All on your machine.
health-analyzer-mcp on npm
·
MIT licensed
Prerequisite: install the Health Data AI Analyzer Mac app — it hosts the local API the MCP server talks to. No Mac app → no API → no MCP.
Quick answer
How to connect Apple Health to Claude
iPhone: open the Claude app and connect Apple Health. It can read your data and cannot write or change entries. Anthropic says those health features are in beta, need a Pro or Max plan, and are available in the US only (Use Claude with iOS apps). Mac: add the local MCP connector on this page for Claude Desktop, Claude Code, and Cursor:
- Install the Health Data AI Analyzer Mac app. It hosts the local API on
localhost:8765that the MCP server reads from. - Add the MCP server to Claude. Claude Desktop: Settings → Developer → Edit Config, then paste the full
claude_desktop_config.jsonobject in the Connect checklist. A fragment will not parse. Claude Code:claude mcp add health-analyzer -- npx -y health-analyzer-mcp. - Restart Claude and check
get_status. Cmd+Q, reopen, then ask it to callget_status. The checklist has thehttp://localhost:8765check and the failure list. A working connection can answer: "What were my step counts and sleep duration for the last 14 days?"
Prefer pasting compact summaries into Claude instead of setting up MCP? Use the Apple Health + Claude local API guide.
Step 1: Get the Mac appMac Connect
Connect checklist
Three checks, in order. Stop at the first one that fails. The iPhone path stays inside the Claude app. This list is the Mac MCP path for Claude Desktop, Claude Code, and Cursor.
1. Config snippet
Install and open the Health Data AI Analyzer Mac app first. Node.js 18+ has to be installed, because Claude starts health-analyzer-mcp with npx.
~/Library/Application Support/Claude/claude_desktop_config.json
Settings → Developer → Edit Config opens it. If the file is missing, create it.
{
"mcpServers": {
"health-analyzer": {
"command": "npx",
"args": ["-y", "health-analyzer-mcp"]
}
}
}
Already have other MCP servers? Do not paste a second { under the file. Add only the "health-analyzer" entry inside the existing mcpServers object. One root object, double quotes, no comments, no trailing commas.
claude mcp add health-analyzer -- npx -y health-analyzer-mcp
Cursor Settings → MCP. Same server entry:
{
"mcpServers": {
"health-analyzer": {
"command": "npx",
"args": ["-y", "health-analyzer-mcp"]
}
}
}
2. Health check
Quit the client completely and reopen it. Claude Desktop needs Cmd+Q, not a window close. Then confirm the Mac app is listening, and that the client loaded the tools.
The local API is http://localhost:8765, the same listener as http://127.0.0.1:8765. In the Mac app, open Settings and turn on Enable Local API for OpenClaw and scripts. The Local API section should show Running, with a dataset loaded.
GET /openclaw/status is public on loopback. It reports app version, whether a dataset is loaded, last import and sync timestamps, and available metrics. GET /status reports app and server version, dataset state, those timestamps, and the token path used by protected routes.
curl http://127.0.0.1:8765/openclaw/status
curl http://127.0.0.1:8765/status
The same paths work in a browser at http://localhost:8765/openclaw/status and http://localhost:8765/status. Connection refused means nothing is listening. That is an app or Local API problem, not an auth problem.
On the MCP side, the client should list the health-analyzer tools, including get_status. Ask it to call get_status. The tool takes no inputs and reports whether the local API is running and whether a dataset is loaded. In Claude Code, claude mcp list should include health-analyzer.
3. Failure states
Mac app not running, or the API is down. The curls above refuse the connection. Open Health Data AI Analyzer, load a dataset, and confirm Settings shows Local API Running. Curl again. Next doc: Apple Health Local API.
npx or Node is missing. In Terminal, node --version needs to be 18 or newer, and npx has to resolve. If Terminal sees Node but Claude does not, the GUI app is not using that PATH. The startup error is in ~/Library/Logs/Claude/. The first call can sit for several seconds while npx fetches health-analyzer-mcp. Claude Desktop only: skip Node by dragging the one-click extension (.mcpb) onto Claude Desktop. Server source: mcp-server on GitHub.
Claude Desktop config JSON is invalid. Claude ignores a config it cannot parse, so no tools appear and there is no API error. Usual causes: a second { pasted under an existing file, a trailing comma, or a comment. Keep a single JSON object. Re-copy the block above, or merge the one health-analyzer key into mcpServers, then Cmd+Q and reopen.
Tools still missing after restart. Closing the window does not reload MCP servers. Cmd+Q, reopen, and start a new chat. Claude Code: claude mcp list should show health-analyzer. If the process never starts, it is Node, PATH, or the JSON error above.
Auth or token errors. The server reads local-api-token.txt itself, from ~/Library/Application Support/Health Data AI Analyzer/local-api-token.txt. The sandboxed App Store build also searches ~/Library/Containers/com.rumjahn.healthkitanalyzer/Data/Library/Application Support/Health Data AI Analyzer/local-api-token.txt. "Token not found" or a 401 means that lookup failed. Call get_status — the response includes the paths it searched. If the file is there but unreadable, set HEALTH_ANALYZER_TOKEN or HEALTH_ANALYZER_TOKEN_FILE to the absolute path shown in app Settings. Do not put the token in the args array. GET /status returns the token path for protected HTTP routes. The MCP server attaches the token; Connect does not require hand-writing X-Health-Analyzer-Token.
Connect stops here. Use the Local API guide and the GitHub mcp-server tree. Need the full REST reference? That catalog is for after Connect works.
Watch it set up & answer in your client.
Eleven AI clients people actually use. Pick yours to see its setup and the same read-only Apple Health question answered.
The exact UI varies by client. Each example connects to the same local, read-only health-analyzer-mcp server.
What is an Apple Health MCP server?
· Reviewed by Keith Rumjahn
Anthropic introduced the Model Context Protocol in November 2024 and open-sourced the spec to let AI assistants discover and call tools on your behalf — by 2026 the protocol was already shipping natively in Claude Desktop, Cursor, Cline, and OpenClaw ([Anthropic announcement](https://www.anthropic.com/news/model-context-protocol) [S]). An Apple Health MCP server is a small program that translates between MCP and your HealthKit data — instead of pasting JSON into a chat, your AI assistant can call the server directly: "what were my step counts last week?" → the server hits the local API → returns a compact answer.
How it works (and why nothing leaves your Mac)
Claude Desktop / Cursor (on your Mac)
↓ spawns via stdio
health-analyzer-mcp (Node process, also on your Mac)
↓ HTTP to localhost:8765
Health Data AI Analyzer app (running on your Mac)
↓ reads from
HealthKit / parsed export.xml (on your Mac)
The entire pipeline is loopback — 127.0.0.1 never leaves the network interface. Your HealthKit data is never uploaded to a cloud service by this MCP server. The only data that ever leaves your Mac is whatever you explicitly ask your AI client to reason about (and only to whichever AI provider that client is configured to use).
The 11 tools exposed
All tools are read-only and annotated with the MCP readOnlyHint: true flag so clients know they're safe to call without prompting:
Example prompts
The copy-paste config, the localhost:8765 check, and the failure list are in the Connect checklist. Once get_status answers, try:
What were my step counts and sleep duration for the last 14 days?
Are there any week-over-week trends in my resting heart rate?
Pull my HRV for the past 30 days and look for signs of overtraining
or stress accumulation. Be explicit about confidence.
Give me yesterday's daily health brief and suggest one experiment
for the coming week based on what you see.
Privacy & security
- The MCP server only binds to localhost — never the network
- Most API routes require an auth token written by the Mac app to its sandboxed container
- The server is ~330 lines of open-source Node — auditable in 10 minutes
- Only the response payload your AI asks for ever leaves your Mac, and only to the AI provider you've configured
Related
- Apple Health Local API docs — confirm
localhost:8765is up. Connect stops there. - Apple Health + Claude — using Claude with the Local API directly
- OpenClaw + Apple Health — alternative MCP client
- Apple Health + AI hub
Plug Apple Health into your AI assistant
Install the Mac app, add a 4-line config snippet, restart Claude or Cursor. Done.