# Apple Health

This local MCP server reads Apple Health CSV exports and answers questions about sleep, workouts, and health metrics. Use it to inspect records, run queries, or create summaries.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 576
- Author: neiltron
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/neiltron/apple-health-mcp
- Updated: 2026-10-02
- HTML: https://affpapa.org/en/nevibecode/mcp/apple-health

## What it does

The server works with Apple Health CSV files on your computer. Its tools expose the data schema, run DuckDB analytical queries, and create weekly, monthly, or custom summaries. It requires Node.js 22 or later and an export made with Simple Health Export CSV. Native `export.xml` files are unsupported, so that format will not work.

Set `HEALTH_DATA_DIR` to the directory containing the unzipped CSV files. The server reads them in place and makes no network requests or uploads of the export. On the first request for a table, it loads that table’s full history into an in-memory database, which is rebuilt whenever the process starts. An export that exceeds `MAX_MEMORY_MB` fails rather than spilling health rows to disk. Results sent back to the client may still reach its configured model provider.

Use `health_schema` to inspect tables, columns, units, and sample rows. `health_query` accepts one DuckDB analytical statement from the SELECT family; `health_report` produces summaries. SQL safeguards do not isolate the process. Run it through a trusted local MCP client and do not expose it to untrusted network clients. Reports summarize recorded measurements; they are not medical advice.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `HEALTH_DATA_DIR`, `MAX_MEMORY_MB`, `CACHE_SIZE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env HEALTH_DATA_DIR=<HEALTH_DATA_DIR> --env MAX_MEMORY_MB=<MAX_MEMORY_MB> --env CACHE_SIZE=<CACHE_SIZE> --transport stdio apple-health -- npx -y @neiltron/apple-health-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add apple-health --env HEALTH_DATA_DIR=<HEALTH_DATA_DIR> --env MAX_MEMORY_MB=<MAX_MEMORY_MB> --env CACHE_SIZE=<CACHE_SIZE> -- npx -y @neiltron/apple-health-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "apple-health": {
            "command": "npx",
            "args": [
                "-y",
                "@neiltron/apple-health-mcp"
            ],
            "env": {
                "HEALTH_DATA_DIR": "<HEALTH_DATA_DIR>",
                "MAX_MEMORY_MB": "<MAX_MEMORY_MB>",
                "CACHE_SIZE": "<CACHE_SIZE>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "apple-health": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@neiltron/apple-health-mcp"
            ],
            "env": {
                "HEALTH_DATA_DIR": "<HEALTH_DATA_DIR>",
                "MAX_MEMORY_MB": "<MAX_MEMORY_MB>",
                "CACHE_SIZE": "<CACHE_SIZE>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e HEALTH_DATA_DIR=<HEALTH_DATA_DIR> -e MAX_MEMORY_MB=<MAX_MEMORY_MB> -e CACHE_SIZE=<CACHE_SIZE> apple-health npx -y @neiltron/apple-health-mcp
```
Replace <…> with your own values

## When to use it
- inspect tables and fields in an Apple Health export
- compare sleep records across a chosen period
- analyze workout entries with DuckDB
- create a weekly or monthly health summary

## Example prompts
- Show me the tables and fields in my Apple Health export.
- Compare my sleep records across recent weeks.
- Create a monthly summary of workouts and health metrics.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
