npm @neiltron/apple-health-mcpstdioupdated 15d ago
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.
Apple Health で何ができる?
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.
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 |
|---|---|---|---|
HEALTH_DATA_DIR |
Yes | — | Directory containing the exported CSV files |
MAX_MEMORY_MB |
No | 2048 |
DuckDB memory limit in megabytes |
CACHE_SIZE |
No | 100 |
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 |
|---|---|
health_schema |
Discover table names, columns, units, and sample rows |
health_query |
Run a read-only SELECT query with JSON, CSV, or summary output |
health_report |
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.
History and memory
The first request that needs a table loads that table's full CSV history. There is no date window, so a query can reach as far back as the export goes.
Because every tool can reach the whole configured history, only start this server from an MCP client you trust with that data.
Loaded tables are held in memory, and DuckDB is given the MAX_MEMORY_MB limit
described above. Roughly 1 GiB covers a two-year multi-table export, so the
2048MB default leaves headroom; raise MAX_MEMORY_MB for a larger export. The
server never spills health rows to a temporary directory on disk, so an export
that does not fit in the limit fails with an explicit error instead.
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, so each launch reloads from the CSV files. Persistent incremental import is planned future work, not current behavior.
- 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 build
See Architecture for the code layout, data lifecycle, and implementation constraints.
License
MIT
インストール
Apple Health をクライアントに追加します。お使いのものを選んでください。
claude mcp add apple-health-mcp -- npx -y @neiltron/apple-health-mcpcodex mcp add apple-health-mcp -- npx -y @neiltron/apple-health-mcpamp mcp add apple-health-mcp -- npx -y @neiltron/apple-health-mcp{
"mcpServers": {
"apple-health-mcp": {
"command": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"apple-health-mcp": {
"command": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"apple-health-mcp","command":"npx","args":["-y","@neiltron/apple-health-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"apple-health-mcp": {
"command": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"apple-health-mcp": {
"command": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"apple-health-mcp": {
"command": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"apple-health-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"apple-health-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"@neiltron/apple-health-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @neiltron/apple-health-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
3 個のツール
Apple Health は接続したエージェントに 3 個のツールを提供します。
- health_schema
- Discover table names, columns, units, and sample rows
- health_query
- Run a read-only `SELECT` query with JSON, CSV, or summary output
- health_report
- Generate a weekly, monthly, or custom health summary
スコア
62 / 100
良好
- ドキュメント21/25
- メンテナンス19/25
- 信頼性6/20
- 機能4/15
- 導入のしやすさ12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 8 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 3 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
バージョン履歴
| バージョン | 公開日 |
|---|---|
| 1.4.1最新 | 2026年8月24日 |
| 1.2.1 | 2026年8月6日 |