
Apple Health
io.github.neiltron由 GitHub 帳號 neiltron 發布v1.4.5更新於 Nov 3, 2026
Local-first Apple Health MCP server for questions about your sleep, workouts and heart data.
概覽
在本機執行的 MCP 伺服器,讓助理用 SQL 查詢匯出的 Apple Health 睡眠、運動與心率資料,並產生健康摘要。
- 可以做什麼
- 檢視健康匯出中的資料表名稱、欄位、單位與範例列
- 執行一條 DuckDB 分析型 SELECT 語句,輸出 JSON、CSV 或摘要
- 產生每週、每月或自訂期間的健康報告
- 適用情境
- 當你的電腦上已有 Apple Health 的 CSV 匯出,並希望助理回答關於睡眠、運動、心率等記錄指標的問題,或定期產生彙總時使用。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 22 或更新版本。需要由 Simple Health Export CSV 產生並解壓縮的 Apple Health CSV 匯出,其目錄以 HEALTH_DATA_DIR 指定。可選 MAX_MEMORY_MB(預設 2048)與 CACHE_SIZE(預設 100)。不需帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Apple Health,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
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, analytical 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:
Restart the client after changing its configuration. Other MCP clients can use
the same command, arguments, environment, and stdio transport.
Environment variables
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
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.
health_query accepts one DuckDB analytical statement. See
Query safeguards
for supported statements and restricted operations.
Query safeguards
The server limits DuckDB file access to HEALTH_DATA_DIR. It also disables
network access and temporary disk storage, and it locks the database settings.
The data directory stays readable and writable so the importer can read CSV
files.
These controls reduce accidental side effects from generated SQL. They do not
isolate the process. Run the server through a local stdio MCP client. Do not
expose it to an untrusted network client. Use process or OS isolation if the
server must accept untrusted SQL.
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
See Architecture for the code layout, data lifecycle, and implementation constraints. See Release procedure for publishing and recovery steps.
License
MIT
來源:README.md,提交 5b0320d
工具
0版本歷史
2- v1.4.5最新Sep 20, 2026
- v1.4.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分