About io.github.PhilipAD/health-export-mcp
io.github.PhilipAD/health-export-mcp is an MCP server published by PhilipAD in the Healthcare category: query 190 Apple Health metrics from any MCP agent — zero-dependency, read-only, local-first. Conduid read 21 tools from its source: add_event, compare_periods, correlate_metrics, get_check_ins, get_cycle_context, get_freshness and 15 more. It is published to npm as health-export-mcp and starts with npx.
The repository has 12 stars and 0 forks, and its last commit was on 27 Nov 2026. Conduid has no tagged release on record for it. Its topics include healthcare.
Install
claude mcp add io-github-philipad-health-export-mcp -- npx -y health-export-mcpnpx -y health-export-mcpgit clone https://github.com/PhilipAD/health-export-mcpTools (21)
add_eventLog an event the user states (a medication start, a trip) into `health-events-agent.json`, the one file this server writes. Idempotent by `clientEventId`.| Parameter | Type | Description |
|---|---|---|
| clientEventId | string | Optional idempotency key: the same key never logs a second event. |
| date * | any | Local day the event happened or started, YYYY-MM-DD. |
| endDate | any | Last day of a range event (inclusive), YYYY-MM-DD, not before date. Omit for a point event. |
| note | string | Optional longer note, at most 2000 characters. |
| tags | array | Optional tags for filtering, e.g. ["magnesium"]. At most 20. |
| title * | string | Short description, e.g. "Started magnesium 300 mg". At most 200 characters. |
| type * | string | Event type: medication, habit, visit, life, shift, episode, travel or other. Range types (shift, travel, episode) usually carry an endDate. |
compare_periodsA metric across two arbitrary date periods (A vs B), or around a logged event via `anchor: {eventId, days}` (the event day excluded from both sides).| Parameter | Type | Description |
|---|---|---|
| anchor | object | Build both periods around a logged event instead of passing dates: periodA is the {days} days before the event date, periodB the {days} days after, the event day itself excluded from both. Get event ids from list_events (app and agent-logged events both work). Pass either anchor or periodA/periodB, not both. |
| excludeTravelDays | any | |
| metric * | string | |
| periodA | object | |
| periodB | object |
correlate_metricsPearson correlation between two metrics with a 0..3 day lag. Association, not causation, always stated.| Parameter | Type | Description |
|---|---|---|
| end | any | |
| lag | integer | 0 to 3 days. lag 1 pairs metricA on day d with metricB on the following day. |
| metricA * | string | |
| metricB * | string | |
| start | any |
get_check_insMorning check-ins the user chose to share (`health-check-ins.json`, off by default in the app): self-rated feeling 1 to 5, note, intention and whether it happened, plus a summary. A self-rating, not a measurement.| Parameter | Type | Description |
|---|---|---|
| end | any | |
| start | any |
get_cycle_contextDay-in-cycle and coarse phase derived from logged period starts. Never predictive.| Parameter | Type | Description |
|---|---|---|
| date | any |
get_freshnessHow current the export is: `stale` judged on the core files (daily cache, sleep sessions) against a stated threshold (26 h by default, `HEALTH_STALE_AFTER_HOURS`, or `maxAgeHours`), `age_hours`, `as_of`, `last_data_date`, per-file write times. `state: "stale_copy"` (with a `stale_copy` list) when the phone's `.health-manifest.json` or iCloud says this Mac holds an older copy of a core file than the phone wrote. Same rule as the `status --max-age` cron gate.| Parameter | Type | Description |
|---|---|---|
| maxAgeHours | number | Treat the data as stale when the newest write is older than this many hours (greater than 0, at most 8760). Default ${store.DEFAULT_STALE_AFTER_HOURS}, or HEALTH_STALE_AFTER_HOURS when set. |
get_health_metricsDaily values for a metric (or all) over a date range + an aggregate (avg/sum/min/max/latest). Supports `filterDays` (restrict to days covered by logged events, with `negate`). Blood pressure at day granularity also lists the individual `readings` (`health-readings.json`).| Parameter | Type | Description |
|---|---|---|
| aggregation | string | |
| end | any | |
| filterDays | object | Restrict to days covered by matching logged events (health-events.json and health-events-agent.json): endDate ranges cover every day inclusive, point events cover their single day, negate:true keeps only days NOT covered. The answer states how many days matched. Example: HRV on night-shift blocks vs days off. |
| granularity | any | |
| limit | any | |
| metric | string | Metric name, e.g. step_count, heart_rate, sleep_analysis. Omit for all. |
| start | any |
get_intradayThe hour-by-hour window from the app's hourly automations (`health-intraday.json`, app 1.4+): yesterday and today, replaced each run, with each hour's `Min`/`Max` for discrete metrics when the app writes them.| Parameter | Type | Description |
|---|---|---|
| metric | string | Metric name to filter, e.g. heart_rate. Omit for every metric in the window. |
get_mcp_statusHealth check: source, metric/workout counts, which context files exist, latest data date, and a `freshness` summary. Call first.get_profileOpted-in context fields (conditions, medications, goals, allergies, notes) plus `presentFields`. Absent fields were withheld, never "none".get_sleep_sessionsClustered sleep sessions attributed to the waking day; split nights returned as separate sessions, duplicate copies of one night collapsed (`collapsedDuplicates`).| Parameter | Type | Description |
|---|---|---|
| day | any | A single waking day, YYYY-MM-DD. |
| end | any | Last waking day (inclusive), YYYY-MM-DD. |
| start | any | First waking day (inclusive), YYYY-MM-DD. |
get_strength_logThe strength log typed into the iOS app (`health-strength.json`, opt-in, off by default, from the iCloud or folder export or from the LAN push): each session with every set as entered, `volumeKg`, `workingSets`, an Epley `bestEstimateKg` per exercise, all-time records, and the user's saved routines. Filter by `exercise`, `start`, `end`. Missing file → `available:false`.| Parameter | Type | Description |
|---|---|---|
| end | any | Last day (inclusive), YYYY-MM-DD. |
| exercise | string | One exercise, by the exact name in the log (case-insensitive), e.g. Back squat. Omit for every exercise. |
| start | any | First day (inclusive), YYYY-MM-DD. |
get_structured_exportClean JSON for chosen metrics/range, paginated with a cursor.| Parameter | Type | Description |
|---|---|---|
| cursor | string | Opaque cursor from a previous call's nextCursor. |
| end | any | |
| granularity | any | |
| limit | any | |
| metrics | array | |
| start | any |
get_trendsRecent N-day window vs the prior N days: change, % change, direction. Supports `excludeTravelDays`.| Parameter | Type | Description |
|---|---|---|
| excludeTravelDays | any | |
| metric * | string | |
| window | integer | days per window (default 7) |
get_workoutsWorkouts by activity/date with pagination; includes heart rate, running dynamics, cycling power, intervals and `hasRoute` when exported.| Parameter | Type | Description |
|---|---|---|
| activityType | string | Activity name (e.g. Running) or raw HealthKit activity id (e.g. 37). |
| cursor | string | Opaque cursor from a previous call's nextCursor. |
| end | any | |
| limit | integer | Workouts per page (default 50, max 200). |
| start | any |
list_eventsLogged context events (medication, habit, visit, life, shift, episode, travel) with type/tag/date filters, from the app and from `add_event`, each labelled `source: "app"` or `"agent"`.| Parameter | Type | Description |
|---|---|---|
| end | any | |
| start | any | |
| tag | string | Match events carrying this tag. |
| type | string | Event type, e.g. medication, habit, visit, life, shift, episode, travel, other. Unknown types pass through and can be filtered by their stored string. |
list_metricsEvery available metric with unit, day count, and date range.list_tagsTags logged in the app (`health-tags.json`, opt-in there and off by default): lifestyle tags and supplements by name, never an amount. `{kind: all, supplement or lifestyle, start, end}`; one row per tag plus the names per day.| Parameter | Type | Description |
|---|---|---|
| end | any | |
| kind | string | Which tags: 'all' (default), 'supplement' or 'lifestyle'. |
| start | any |
query_health_dataNatural-language convenience: *"average HRV last month"* routed to structured results.| Parameter | Type | Description |
|---|---|---|
| question * | string |
remove_eventRemove an event logged with `add_event`. Events logged in the iOS app are edited there.| Parameter | Type | Description |
|---|---|---|
| id * | string | The agent event id from list_events or add_event. |
resolve_metricCanonical name and unit for any spelling (`steps`, `StepCount`, `Body Weight`, `hrv`), unit variants with exact formulas, an optional `{value, unit}` conversion, and whether the export holds it. Ambiguous words come back with candidates, never guessed. The data tools accept the same aliases and report `resolvedFrom`. When the export carries per-source attribution (app builds that write `src`/`by` on daily points and a `health-sources.json`, cache schema minor 2), the answer adds a `sources` block naming the devices that fed the export, which one won each metric and the priority rules, and `sourceMerge` reports disagreement as visible; older exports report it as not available.| Parameter | Type | Description |
|---|---|---|
| name * | string | Any spelling of a metric, e.g. steps, StepCount, Body Weight, VO2 max. |
| unit | string | Unit of value, e.g. lb, mmol/L, degF, km, %. Unknown units are refused, never guessed. |
| value | number | Optional value to convert into the canonical unit. Pass with unit. |
Security checks
6 checks have not been run yet.