apple-health-mcp
Enables querying Apple Health data, including metrics and workouts, after exporting from the Health app.
Click on "Deploy 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-mcpWhat was my average step count per day last 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
MCP server that loads your Apple Health export into an in-memory SQLite database and exposes it to LLMs via the Model Context Protocol.
Quick start
uvx apple-health-mcp --input ~/Downloads/export.zipOr install it permanently:
uv tool install apple-health-mcp
apple-health-mcp --input ~/Downloads/export.zipRelated MCP server: apple-health-export-mcp
Exporting your data from Apple Health
Open the Health app on your iPhone
Tap your profile picture (top-right)
Scroll down and tap Export All Health Data
Confirm — this may take a few minutes
Save or AirDrop the resulting
export.zipto your Mac
Claude Desktop integration
Add this to your claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"apple-health": {
"command": "uvx",
"args": [
"apple-health-mcp",
"--input",
"/absolute/path/to/export.zip"
]
}
}
}Restart Claude Desktop. The tools will appear in the tools menu.
MCP tools
list_metrics()
Returns every distinct record type and its count.
list_workout_types()
Returns every distinct workout activity type and its count.
summary(metric, period)
Aggregates a metric by day, week, or month. Returns count, avg, min, max, and sum.
summary("StepCount", "week")
summary("HeartRate", "month")query(sql)
Run arbitrary read-only SQL against the database. Only SELECT statements are allowed.
Schema:
records(type, source_name, unit, value, start_date, end_date)
workouts(activity_type, source_name, duration, duration_unit,
total_energy_kcal, total_distance, distance_unit, start_date, end_date)Examples:
-- Daily step totals for the last 30 days
SELECT substr(start_date, 1, 10) AS day, sum(CAST(value AS REAL)) AS steps
FROM records WHERE type = 'StepCount'
GROUP BY day ORDER BY day DESC LIMIT 30;
-- Longest runs
SELECT start_date, duration, total_distance, distance_unit
FROM workouts WHERE activity_type = 'Running'
ORDER BY total_distance DESC LIMIT 10;Environment variable
Instead of --input, you can set:
export HEALTH_EXPORT_PATH=~/Downloads/export.zipDevelopment
git clone https://github.com/smarzola/apple-health-mcp
cd apple-health-mcp
uv sync # install deps + dev tools
uv run pytest # run tests
uv run apple-health-mcp --input ~/Downloads/export.zipLint, format & typecheck
uv run ruff check src/ tests/ # lint
uv run ruff format --check src/ tests/ # format check
uv run mypy src/ # typecheckAuto-fix:
uv run ruff check --fix src/ tests/ # auto-fix lint
uv run ruff format src/ tests/ # auto-formatPre-commit hooks
uv run pre-commit install # one-time setup
# Now ruff + mypy run automatically on every commitCutting a release
gh release create v0.2.0 --generate-notes
# Triggers GitHub Actions → builds → publishes to PyPI → smoke testsLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
- SomviaOAuthapp.somvia
Apple Health training load, recovery, HRV and workout detail for Claude, ChatGPT and any MCP client.
Your Apple Health data, food diary and lifts, for ChatGPT, Claude and Gemini. Approved on iPhone.
Your Garmin, Oura, WHOOP, Hevy and 35 more fitness apps, queryable from your own AI.
1- freddyOAuthcoach.freddy
Connect your wearables, rings and training apps, then ask your AI about your own health data.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables Claude to answer natural language questions about your Apple Health data by analyzing local CSV exports, supporting metrics like steps, heart rate, sleep, and more.62MIT
- AlicenseAqualityCmaintenanceQuery your Apple Health data including sleep, heart rate, steps, workouts, and more by ingesting an exported XML archive into a local SQLite database.5MIT
- AlicenseAqualityDmaintenanceQuery Apple Health export data with an LLM via a semantic layer that avoids common data traps, enabling accurate natural-language queries about health metrics. Optionally imports CPAP therapy data for correlation.3MIT
- AlicenseAqualityAmaintenancePrivacy-first MCP server for querying personal health and finance data with AI. Built with Python, FastMCP, and SQLite. Local-first and open source.22039 PyPI6MIT