# apple-health-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/davidmosiah/apple-health-mcp  
**GitHub Stars:** 4  
**npm Downloads (last month):** 176  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/apple-health-mcp

## Description
Unofficial local-first MCP server for Apple Health export data.

## Tools
Capabilities this server exposes over MCP:

- **apple_health_agent_manifest** — Machine-readable install, runtime and privacy guidance for AI agents operating Apple Health export data.
- **apple_health_capabilities** — Explain supported Apple Health export data, unavailable live HealthKit access, privacy modes and recommended agent workflow.
- **apple_health_connection_status** — Check local Apple Health export path, Node version, privacy mode and Hermes client posture without reading full export data.
- **apple_health_quickstart** — Personalized 3-step setup walkthrough for the human user. Adapts to current state (is APPLE_HEALTH_EXPORT_PATH set? does the export file exist and parse?). Call this first when the user asks 'how do I connect Apple Health?'. This connector is local-first and never touches Apple servers or cloud APIs.
- **apple_health_demo** — Returns realistic example payloads of apple_health_daily_summary, apple_health_weekly_summary, and apple_health_wellness_context with Apple-Watch-style values, so agents see the contract before parsing a real export.
- **apple_health_privacy_audit** — Return the local privacy and export-file posture without revealing health data.
- **apple_health_list_records** — List bounded records from a local Apple Health export.xml. Use type/start/end filters to keep output small. `limit` caps the returned LIST only: in summary privacy mode (the default) the `aggregate` block (`count_by_type`, `units`, `date_range`, `numeric`) is computed over every record matching the filter, and `truncated`/`limit_applied`/`matched_count` say whether the list itself was cut. The statistics are nested under `numeric` (numeric.count/sum/average/min/max), not at the top of `aggregate`. COST: because the aggregate must cover every match, summary mode reads the whole export file on each new query — roughly 33 ms per MB of export.xml (~3 s for 84 MB, ~11 s for 336 MB), and type/start/end do not shorten it. Repeating an identical query is served from an in-memory cache and returns instantly. For a cheap bounded page with no full-file scan, pass privacy_mode 'structured' or 'raw', which stop at `limit`.
- **apple_health_list_workouts** — List bounded workouts from a local Apple Health export.xml. `limit` caps the returned LIST only: in summary privacy mode (the default) the `aggregate` block (`count_by_activity`, `date_range`, `total_duration_minutes`, `total_distance`, `distance_units`, `total_energy_kcal`, `workout_count`) is computed over every workout matching the filter, and `truncated`/`limit_applied`/`matched_count` say whether the list itself was cut. COST: this call reads the whole export file on each new query — roughly 33 ms per MB of export.xml (~3 s for 84 MB, ~11 s for 336 MB) — and start/end do not shorten it. Workouts are sparse in an export, so even non-summary modes usually reach the end of the file. Repeating an identical query is served from an in-memory cache and returns instantly.
- **apple_health_export_freshness** — Check how recently the local Apple Health export file/directory was written. Returns mtime, days_since_export, an is_stale flag, and a recommendation. Considered stale if the export is older than 30 days, or older than 7 days with no recent records (the inventory's latest-record date is also older than 7 days). Use before relying on apple_health_daily_summary or apple_health_wellness_context to confirm the export is fresh.
- **apple_health_data_inventory** — Scan the local Apple Health export once and report available record types, workouts, date coverage, freshness and safe next calls.
- **apple_health_daily_summary** — Build a daily wellness summary from local Apple Health export data. It is not live HealthKit and not medical advice.
- **apple_health_wellness_context** — Normalize local Apple Health export sleep, workout and activity data into the shared wellness_context shape for recommendation engines.
- **apple_health_weekly_summary** — Build a weekly wellness summary from local Apple Health export data. It is not live HealthKit and not medical advice.
- **apple_health_profile_get** — Read the shared Delx Wellness profile from ~/.delx-wellness/profile.json. Returns preferred name, goals, devices, training/nutrition/exercise/agent preferences and safety flags. NEVER contains OAuth tokens or API secrets — this connector is local-export and has no cloud auth, but the profile contract is the same across every Delx Wellness MCP. Read-only.
- **apple_health_profile_update** — Persist a partial patch to ~/.delx-wellness/profile.json. Requires explicit_user_intent=true (otherwise returns USER_ACTION_REQUIRED). Rejects secret-like fields (oauth, token, secret, password, cookie, refresh, api_key, session) at write time. Use to record preferred name, goals, devices, training context, nutrition context, exercise preferences, agent preferences, and safety flags.
- **apple_health_clear_incremental_cache** — Manually clear the incremental import cache at ~/.apple-health-mcp/incremental-cache.json. The cache tracks the latest parsed timestamp per HealthKit category so subsequent `apple_health_list_records` calls (with `incremental_cache: true`) skip already-seen records. Use this when you want to force a full re-parse without changing the export file. The cache also auto-invalidates when the export file mtime changes. Gated by explicit_user_intent: true (requires explicit user intent to wipe local cache).
- **apple_health_reimport** — Re-scan the configured watch folder (APPLE_HEALTH_WATCH_PATH or `setup --watch-path <dir>`) for a newer Apple Health export. If a newer export.xml/export.zip/apple_health_export directory is found, it is promoted to the active export, the in-memory snapshot cache and incremental cache are cleared, and subsequent summaries reflect the new data. With check_only=true, only report what would happen without promoting. This is the cross-platform recurring-refresh path — the native HealthKit bridge needs macOS and is separate. Requires explicit user intent when promoting a new export (force or non-check_only); check_only is read-only inspection.
- **apple_health_onboarding** — Return the 11-question onboarding flow plus the current profile state and missing fields. Read-only — does NOT persist anything. Pair with apple_health_profile_update once the user answers. Cross-connector: the same profile is shared by every Delx Wellness MCP (whoop, garmin, oura, fitbit, strava, polar, withings, apple-health, samsung-health, google-health, nourish, cycle-coach, cgm, air).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "apple-health-mcp": {
    "command": "npx",
    "args": ["-y","delx-wellness-hermes"],
    "env": {
      "APPLE_HEALTH_EXPORT_PATH": "",
      "APPLE_HEALTH_WATCH_PATH": "",
      "APPLE_HEALTH_MCP_HOST": "",
      "APPLE_HEALTH_MCP_PORT": "",
      "APPLE_HEALTH_MCP_TRANSPORT": ""
    }
  }
}
```

**Requires environment variables:** `APPLE_HEALTH_EXPORT_PATH`, `APPLE_HEALTH_WATCH_PATH`, `APPLE_HEALTH_MCP_HOST`, `APPLE_HEALTH_MCP_PORT`, `APPLE_HEALTH_MCP_TRANSPORT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What apple-health-mcp does

apple-health-mcp exposes Apple Health export data to AI agents through the Model Context Protocol. It reads an `export.xml`, `export.zip`, or unzipped Apple Health export directory from local storage. Supported data includes activity, heart-rate samples, resting heart rate, sleep and sleep stages, workouts, body measurements, HRV, breathing rate, and Apple Watch ECG metadata when those records are present in the export.

The server can produce daily and weekly wellness summaries, normalize sleep, workout, and activity information into a shared wellness context, and return bounded records or workouts filtered by type and date. It also reports available record types, date coverage, freshness, connection state, privacy posture, and safe next calls. Profile tools read and update the shared Delx Wellness profile at `~/.delx-wellness/profile.json`.

## How it works

The default transport is stdio. An optional stateless Streamable HTTP mode listens on loopback and exposes a health endpoint plus an MCP endpoint. The connector processes files locally; it does not access Apple servers, cloud APIs, live HealthKit data, iCloud Health sync, or OAuth credentials.

Export data can be configured directly, discovered from common local folders with automatic import, or maintained through a watch folder. When a newer export is found, `apple_health_reimport` can promote it to the active export and clear relevant caches. The tool can also perform a read-only check before promotion.

Record and workout queries support a limit for the returned list. In the default summary privacy mode, aggregate statistics still require scanning all matching records, while structured and raw modes provide bounded pages without that full-file aggregate scan. Identical queries can be served from an in-memory cache.

## Setup and configuration

First export all health data from the Health app on an iPhone and transfer the resulting archive or directory to the machine running the connector. Configure the path with the package setup command, or use automatic import to locate a recent local export. A watch path can be configured for recurring manual exports; the connector checks it at startup and while running.

Run the diagnostic command after setup to verify the export path and runtime state. Add the server to an MCP client using the `npx` package command. Claude Desktop can be configured through the setup command, and standalone configuration is available for clients such as Cursor. Optional HTTP configuration uses `APPLE_HEALTH_MCP_HOST`, `APPLE_HEALTH_MCP_PORT`, and `APPLE_HEALTH_MCP_TRANSPORT=http`.

## Tools and capabilities

- Inspect capabilities, agent guidance, connection state, privacy posture, and export freshness.
- Run a data inventory before selecting record or summary queries.
- List filtered records and workouts with bounded output, aggregates, and truncation metadata.
- Build daily summaries, weekly comparisons, and normalized wellness context.
- Demonstrate response shapes with sample Apple Watch-style payloads.
- Read or explicitly update the shared wellness profile and run the onboarding flow.
- Reimport a newer watched export or explicitly clear the incremental parsing cache.

## Limitations and notes

The connector reads exported files rather than live HealthKit data. Apple Health exports are manual, so summaries can become stale; freshness tools identify this condition and provide a recommendation. It is not a medical-advice system.

ECG records are available as metadata, while raw waveforms require a PDF export. Export contents depend on what the iPhone or Apple Watch recorded. Profile updates require explicit user intent and reject secret-like fields. Clearing the incremental cache and promoting a new export are also gated by explicit user intent where applicable.

The project is unofficial and is not affiliated with, endorsed by, or supported by Apple.

_Full upstream README: https://allmcps.com/mcp/apple-health-mcp/readme_

