MCP server that lets LLMs query your Apple Health export via SQL
Project description
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.zip
Or install it permanently:
uv tool install apple-health-mcp
apple-health-mcp --input ~/Downloads/export.zip
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.zip
Development
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.zip
Lint, format & typecheck
uv run ruff check src/ tests/ # lint
uv run ruff format --check src/ tests/ # format check
uv run mypy src/ # typecheck
Auto-fix:
uv run ruff check --fix src/ tests/ # auto-fix lint
uv run ruff format src/ tests/ # auto-format
Pre-commit hooks
uv run pre-commit install # one-time setup
# Now ruff + mypy run automatically on every commit
Cutting a release
gh release create v0.2.0 --generate-notes
# Triggers GitHub Actions → builds → publishes to PyPI → smoke tests
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apple_health_mcp-0.1.1.tar.gz.
File metadata
- Download URL: apple_health_mcp-0.1.1.tar.gz
- Upload date:
- Size: 66.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729e6b7e42294f4c5295938e715d2b0bd3ad9d478061a75e3e911e2c4ba0dccb
|
|
| MD5 |
1aa08b14faea99bca175a68ee52a35f5
|
|
| BLAKE2b-256 |
551dfdee144061f72d47163b893c4f14df0685a8e3541e3517cb28ec7784875b
|
Provenance
The following attestation bundles were made for apple_health_mcp-0.1.1.tar.gz:
Publisher:
publish.yml on smarzola/apple-health-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apple_health_mcp-0.1.1.tar.gz -
Subject digest:
729e6b7e42294f4c5295938e715d2b0bd3ad9d478061a75e3e911e2c4ba0dccb - Sigstore transparency entry: 1155517516
- Sigstore integration time:
-
Permalink:
smarzola/apple-health-mcp@01c8e2b7be54942b132f6592b2ed5c89f3005648 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/smarzola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01c8e2b7be54942b132f6592b2ed5c89f3005648 -
Trigger Event:
push
-
Statement type:
File details
Details for the file apple_health_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: apple_health_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1f2fadcf2de2749a4519dff64b8877b9272a7dffbc16433157cdb37e16aa0fc
|
|
| MD5 |
7f0f311beb269e2b9bdf5bbd5f02af0b
|
|
| BLAKE2b-256 |
564ac44210eaee60a29d64702ad03be42128b08e876baf0377452c92f5ddf14e
|
Provenance
The following attestation bundles were made for apple_health_mcp-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on smarzola/apple-health-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apple_health_mcp-0.1.1-py3-none-any.whl -
Subject digest:
d1f2fadcf2de2749a4519dff64b8877b9272a7dffbc16433157cdb37e16aa0fc - Sigstore transparency entry: 1155517521
- Sigstore integration time:
-
Permalink:
smarzola/apple-health-mcp@01c8e2b7be54942b132f6592b2ed5c89f3005648 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/smarzola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01c8e2b7be54942b132f6592b2ed5c89f3005648 -
Trigger Event:
push
-
Statement type: