Apple Health — Claude Code MCP server: features and setup
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.
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-mcpWhat Apple Health 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.
What it helps with
- 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 for the agent
- 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.
How to install Apple Health
Platform CLI
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-mcpReplace <…> with your own values
Platform CLI
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-mcpReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Apple Health
How do I install Apple Health in Claude Code?
Set HEALTH_DATA_DIR to the directory with your unzipped CSV export, then run claude mcp add apple-health-mcp -e HEALTH_DATA_DIR=<HEALTH_DATA_DIR> -- npx -y @neiltron/apple-health-mcp.
What does the Apple Health MCP server do?
It reads Apple Health CSV exports and lets an MCP client inspect their schema, run DuckDB analysis, and produce summaries of recorded health data.
Which Apple Health export format does it support?
Use a CSV export created with Simple Health Export CSV. The server does not read native export.xml files and requires Node.js 22 or later.