Healthfolder

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 5, 2026

Read a Health Access folder of Apple Watch workouts and vitals; write training plans back as files.

已验证STDIO仅桌面位置与生活文件与存储

概览

AI 生成的概览

读取本地 Health Access 文件夹中的 Apple Watch 训练、生命体征与心电图,并把训练计划和努力评分以文件形式写回。

可以做什么
  • 列出并查看训练,含摘要行、分段文本、心率区间与心脏负荷
  • 读取近期生命体征与按 ISO 周的训练汇总
  • 读取指定日期范围的每日文件、目录索引、个人资料与心电图摘要
  • 为某次训练保存运动员自述的努力评分
  • 校验训练计划并写入文件夹,再查询计划状态与列出全部计划
适用场景
适合已把 Apple 健康数据导出到 Health Access 文件夹的运动员,让助手回顾训练、生命体征与训练负荷,或起草并提交给 Watch 应用的训练计划。
运行要求
通过 npx 或 Docker 以 stdio 在本机运行,无需账号、网络或 API 密钥。服务器需定位 Health Access 文件夹:可用 --dir、环境变量 HEALTHACCESS_DIR(别名 TIDE_DIR)、config.toml 中的路径,或自动在云盘与「文稿」目录中发现。Docker 需挂载该文件夹并传入 --dir。
安装前请注意
它会读取文件夹中的个人健康数据(训练、心率、睡眠、体重、血压、个人资料),只应指向你愿意交给助手的文件夹。rate_workout 与 push_plan 会写入文件;已有 Apple 自带的努力评分时,除非 override 为 true 否则会被拒绝。服务器还会在 mcp/clients 下写入在线状态文件,含客户端名称、机器名与最后调用的工具名。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Healthfolder,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

healthfolder

Read a Health Access folder of Apple Watch workouts and vitals, and write training plans back into it — as plain files. The folder an app writes from Apple Health (workouts, day files, an index, a profile) is the whole API: this package is a local stdio MCP server plus a CLI over that folder. No account, no network, nothing leaves the machine.

How the folder is found

First hit wins:

  1. --dir <folder> on the command line
  2. the HEALTHACCESS_DIR environment variable (alias TIDE_DIR)
  3. dir = "..." in ~/.config/healthaccess/config.toml (the path can be overridden with HEALTHACCESS_CONFIG; zone bounds can also be set there as zones = [133, 146, 158, 169])
  4. discovery: iCloud Drive, then ~/Library/CloudStorage/*, ~/Dropbox, ~/Google Drive, ~/OneDrive*, ~/Box, then ~/Documents. A Health Access folder holds an index.json of schema healthaccess.index.v1 and a workouts/ directory. If discovery finds several, the server refuses to guess and lists them.

Run healthfolder --check to print the resolved folder, where it came from, and the zone bounds in effect.

CLI

sh
npx -y @reneturcios/healthfolder --checknpx -y @reneturcios/healthfolder list --sport swim --limit 5npx -y @reneturcios/healthfolder show 7A1C3E90npx -y @reneturcios/healthfolder vitals --days 14npx -y @reneturcios/healthfolder summary --weeks 4npx -y @reneturcios/healthfolder rate 7A1C3E90 7 "legs heavy, breathing fine"npx -y @reneturcios/healthfolder plan push ./s30.jsonnpx -y @reneturcios/healthfolder plan status 2026-10-24T20:22:05Z-s30npx -y @reneturcios/healthfolder plan listnpx -y @reneturcios/healthfolder day 2026-05-14npx -y @reneturcios/healthfolder days --from 2026-05-01 --to 2026-05-14 --groups heart,sleepnpx -y @reneturcios/healthfolder catalognpx -y @reneturcios/healthfolder profilenpx -y @reneturcios/healthfolder ecgs

Every command prints pretty JSON. Exit codes: 0 success, 1 domain or IO error, 2 usage error. --dir works on every subcommand.

MCP server

sh
npx -y @reneturcios/healthfolder mcp

MCP client config:

json
{  "mcpServers": {    "healthfolder": {      "command": "npx",      "args": ["-y", "@reneturcios/healthfolder", "mcp"]    }  }}

Add "--dir", "<absolute path>" to args to skip the folder search.

Tools (13)

ToolWhat it does
list_workoutsWorkouts from the index (deduplicated, newest first), one summary line each
get_workoutOne workout in full: document, summary, parts text, zones, cardiac cost
get_vitalsResting HR, HRV, body mass, sleep, steps, VO2max, blood pressure over the last N days
training_summaryOne entry per ISO week: volume, zones, effort, cardiac cost, rings from day files
rate_workoutStore the athlete's own effort rating (1–10) in the workout file
push_planValidate a training plan and write plans/<id>.json for the app to put on the Watch
get_plan_statusA plan's state: pending, scheduled, failed or cancelled
list_plansEvery plan with its state and planned distance/time
get_dayOne day file with every Health group it holds
get_daysDay files in a range (max 366 days), optionally reduced to named groups
get_catalogcatalog.json plus the export-coverage check
get_profileprofile.json as written
list_ecgsEvery ECG summary in ecg/, newest first

All results are pretty-printed JSON text with floats rounded to one decimal. Malformed arguments are JSON-RPC InvalidParams errors; domain problems (unknown id, failed validation, a refusal) come back as isError results with the reason in plain words.

Two safety rules are built in:

  • rate_workout only ever stores a number the athlete said. A workout that already carries Apple's own rating (effort_source: "apple") is refused unless the call passes override: true — the refusal names the file, the existing rating, and the remedy, and nothing is written.
  • push_plan reports every validation violation in one message (sport, name length, block/step shape, goal type and value, zone, label length), so a plan can be fixed in one pass.

Resources: healthaccess://index (the deduplicated index) and the template healthaccess://workout/{id} (one workout, heart-rate series included). MCP prompts are not implemented in this build.

Derived numbers

  • Zones. Four bounds, five zones. Bounds come from config.toml, else are estimated from the age in profile.json: max HR = 208 − 0.7 × age, bounds at 72/79/86/92 % of it (age 34 → [133, 146, 158, 169]). Zone seconds are computed from the heart-rate series: each sample's time until the next sample goes to that sample's zone, only time inside the workout counts, gaps over 60 s count as 60 s. With no bounds known, a file's own legacy zones are shown, marked bounds_source: "file".
  • Cardiac cost (swims only) = avg HR × best freestyle 100 m pace (s) / 60 = heart beats per 100 m; lower is better. The best 100 is the fastest work step of at least 95 m whose overlapping laps were at least half freestyle, normalised to 100 m; if no step qualifies and the swim is at least 100 m, the whole-workout pace is used.
  • Summary lines look like: 2026-05-14 Pool swim "S12" · 1200 m · 36:06 · avg HR 129 (max 162) · Z1–2 93% · effort 6/10 (apple) · best FR 100 2:12 → 284 beats/100 m — each segment appears only when its data exists.

Presence handshake

On initialize, and after tool calls at most once a minute, the server writes mcp/clients/<id>.json in the folder so the app can show "Connected". The id is the FNV-1a 64 hash of machine name + client name; the file carries the client name/version from the initialize request, the machine name (HEALTHACCESS_MACHINE overrides it), call counts carried over between writes, and the last tool name — never arguments or results. A failed write never fails a tool call. The CLI writes the same file, as client healthfolder-cli, only from the commands that write into the folder anyway (rate, plan push).

Docker

sh
docker run -i ghcr.io/cloudcorprecords/healthfolder            # stdio MCP serverdocker run --rm ghcr.io/cloudcorprecords/healthfolder list --dir /data

Mount the Health Access folder into the container and pass --dir (or set HEALTHACCESS_DIR) so the server can find it.

Development

sh
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (synthetic folders, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios.

来源:README.md,提交 cf06900

工具

13

list_workouts

List workouts from the Health Access folder, newest first, with a one-line summary each. Read-only.

输入参数limitsincesport

get_workout

Open one workout in full: the workout document plus summary, parts text and cardiac cost. Read-only.

输入参数id必填include_lapsinclude_hr_series

get_vitals

The seven-metric vitals view (resting HR, HRV, body mass, sleep, steps, VO2max, blood pressure) of the last N days, oldest first, with latest values and averages. Read-only.

输入参数days

training_summary

Training summary: one entry per ISO week ending in the current week, empty weeks included. Read-only.

输入参数weeks

rate_workout

Store the athlete's own effort rating (1 to 10) and optional feel note in a workout file. Call only with a number the athlete said; an existing Apple rating is refused unless override is true.

输入参数id必填feeleffort必填override

push_plan

Validate a healthaccess.plan.v1 training plan and write it into the folder's plans/ directory for the app to put on the Watch. Every validation violation is reported in one message.

输入参数plan必填

get_plan_status

Read a plan's status as the app recorded it: pending, scheduled, failed or cancelled. Read-only.

输入参数id必填

list_plans

List every plan in the folder's plans/ directory with its state, planned distance and time, newest first. Read-only.

无需输入参数。

get_day

Read one day file (days/<date>.json) with every Health group it holds. Read-only.

输入参数date必填

get_days

Read the day files in a date range (at most 366 days), oldest first, optionally reduced to named groups. Read-only.

输入参数to必填from必填groups

get_catalog

Read catalog.json (which Health types have data and where they were exported) plus the export-coverage check. Read-only.

无需输入参数。

get_profile

Read profile.json: age, birth year, sex, blood type and the app's other profile fields. Read-only.

无需输入参数。

list_ecgs

List every ECG file in the folder's ecg/ directory, newest first. Read-only.

无需输入参数。

版本历史

1
  1. v0.1.0最新Nov 5, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分