Apple Health MCP Server
health_schema: Discover available tables, columns, units, and sample rows to understand your health data structure.
health_query: Run read-only SQL SELECT queries on your Apple Health data (from CSV exports by "Simple Health Export CSV"), with output in JSON, CSV, or summary format.
health_report: Generate structured health summaries for weekly, monthly, or custom date ranges, with optional metric filtering.
All operations are local (using DuckDB) — no data is uploaded or sent over the network. Query results go to your MCP client only.
Configuration via environment variables:
MAX_MEMORY_MBandCACHE_SIZE.Note: Only the last 90 days of data is loaded into the in-memory database; older records are inaccessible.
Provides tools for querying and analyzing Apple Health data using SQL, supporting analysis of health metrics, categorical health data, and workout information exported from Apple Health.
Uses DuckDB as the backend database for fast and efficient querying of health data, enabling complex SQL queries on exported Apple Health information.
Works with health data exported from iOS devices via the Simple Health Export CSV app, allowing users to analyze their iOS Health app data through SQL queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Apple Health MCP Servershow me my average heart rate for the past week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Apple Health MCP Server
Query Apple Health data from an MCP client using SQL and DuckDB. The server runs locally, reads CSV exports on demand, and provides tools for schema discovery, read-only queries, and health summaries.
Requirements
Node.js 22 or newer
An Apple Health CSV export created with Simple Health Export CSV
The native Apple Health export.xml format is not currently supported.
Related MCP server: apple-mcp
Configure an MCP client
For Claude Desktop, add the following to
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"apple-health": {
"command": "npx",
"args": ["-y", "@neiltron/apple-health-mcp"],
"env": {
"HEALTH_DATA_DIR": "/path/to/your/unzipped/health-export"
}
}
}
}Restart the client after changing its configuration. Other MCP clients can use
the same command, arguments, environment, and stdio transport.
Environment variables
Variable | Required | Default | Purpose |
| Yes | — | Directory containing the exported CSV files |
| No |
| DuckDB memory limit in megabytes |
| No |
| Maximum number of cached query results |
Export health data
Install and open Simple Health Export CSV on your iPhone.
Select All and choose the time range to export.
Transfer the archive to the computer running your MCP client.
Unzip it and set
HEALTH_DATA_DIRto the resulting directory.
The server reads the files in place. It does not upload the export or make network requests, although query results returned to your MCP client may be sent to that client's configured model provider.
Tools
Tool | Purpose |
| Discover table names, columns, units, and sample rows |
| Run a read-only |
| Generate a weekly, monthly, or custom health summary |
Start with health_schema; table names depend on the files in your export.
See Querying Apple Health data
for the data model and working examples.
Current limitation: 90-day window
When a table is first queried, the server currently loads only rows whose
startDate is within the last 90 days. This is a hard-coded implementation
limit, not a configurable query default. Older data remains in the CSV files
but is unavailable to tools, and an older export may appear empty. Removing or
making this behavior configurable is planned.
Other current limitations:
Only the Simple Health Export CSV layout is supported.
The DuckDB database is in memory and is rebuilt for each server process.
Device overlap can produce duplicate-looking measurements; queries should account for
sourceNamewhere appropriate.Health reports summarize recorded data and are not medical advice.
Development
git clone https://github.com/neiltron/apple-health-mcp.git
cd apple-health-mcp
bun install
npm test
npm run typecheck
npm run buildSee Architecture for the code layout, data lifecycle, and implementation constraints.
License
MIT
Maintenance
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables seamless interaction between LLM-based agents and Apple Health data, allowing users to query, analyze, and manage health records through natural language commands.7250MIT
- AlicenseBqualityDmaintenanceMCP server for macOS Apple apps. Enables read/write access to Notes, Reminders, Calendar, Contacts, and Safari using SQLite and JXA, all running locally.428122MIT
- AlicenseAqualityAmaintenanceLocal-first MCP server that connects AI agents to your Oura Ring readiness, sleep, activity, and HRV data. Tokens never leave your machine.273342MIT
- AlicenseAqualityAmaintenanceAn MCP server that enables AI agents to query Apple Health data (190+ metrics) in natural language, including trends, comparisons, and structured exports.78153MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/neiltron/apple-health-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server