Quantified Self MCP Server
Quantified Self MCP Server
一个本地 Model Context Protocol(MCP)服务器,让 LLM(例如 Claude Desktop)可以查询你的个人健康和财务数据。所有数据都存储在两个本地 SQLite 文件中,由你控制的 Python 进程直接从磁盘读取。没有云数据库,没有仪表盘,没有第三方服务。
包含内容
quantified-self-mcp/
├── server.py # the MCP server (FastMCP) — 2 tools
├── init_db.py # loads a CSV file into the local SQLite database
├── requirements.txt
├── .gitignore # keeps data/ and .db files out of version control
└── sample_data/
├── health_sample.csv # 30 days of sample data, so you can try it immediately
└── finance_sample.csv # ~2 months of sample expenses运行 init_db.py 会在 server.py 旁边创建一个 data/ 文件夹,其中包含 health.db 和 finance.db——该文件夹不包含在此处,因为它是在你的机器上根据你自己的数据生成的。
Related MCP server: apple-health-mcp
暴露的工具
工具 | 返回 | 参数(全部可选) |
| 每日步数、睡眠时长、静息心率 |
|
| 分类支出账本,含总计 |
|
两个工具都返回匹配的行以及计算出的汇总(健康数据的平均值/最小值/最大值,财务数据按类别的总计),这样模型就不必自行跨多行进行聚合。
1. 设置环境
需要 Python 3.10+。
cd quantified-self-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt2. 加载你的数据
使用附带的示例立即试用:
python init_db.py health sample_data/health_sample.csv
python init_db.py finance sample_data/finance_sample.csv要使用你自己的数据,请将其导出为包含以下列的 CSV,然后对你的文件运行相同的命令:
健康 CSV:
date, steps, sleep_hours, resting_heart_rate财务 CSV:
date, category, amount, description(description可选)
日期应为 ISO 格式(2026-08-23);也接受 MM/DD/YYYY 并会自动转换。金额/数字可以包含 $ 和 ,(例如 $1,234.56)——这些会被自动去除。有问题的行(日期错误、金额非数字、缺少类别等)会被跳过并发出警告,而不会中止整个导入;最后打印的一行总会告诉你加载了多少行、跳过了多少行。
再次运行 init_db.py health 会按日期进行 upsert(随着你添加天数,可以安全地重复运行);init_db.py finance 每次都会追加新行,因为账本没有天然的唯一键。向任一命令添加 --replace 可改为先清空表。
3.(可选)单独测试
在接入任何客户端之前,你可以打开 MCP Inspector 并在浏览器中直接调用工具:
fastmcp dev inspector server.py4. 连接到 Claude Desktop
Claude Desktop 将本地 MCP 服务器作为子进程启动,并通过 stdio 与它们通信,基于一个 JSON 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
你可以从应用直接跳转:设置 → 开发者 → 编辑配置。
在 mcpServers 下添加一个条目,使用绝对路径——重要的是,将 command 指向你刚刚创建的虚拟环境内部的 Python 解释器,而不是裸的 python。Claude Desktop 在最小化环境中运行服务器,该环境不能可靠地继承你 shell 的 PATH 或已激活的 venv,因此裸的 "python" 通常会解析到错误的解释器(或根本解析不到),服务器会静默地无法启动。
{
"mcpServers": {
"quantified-self": {
"command": "/absolute/path/to/quantified-self-mcp/.venv/bin/python3",
"args": ["/absolute/path/to/quantified-self-mcp/server.py"]
}
}
}在 Windows 上,通常是:
{
"mcpServers": {
"quantified-self": {
"command": "C:\\absolute\\path\\to\\quantified-self-mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\absolute\\path\\to\\quantified-self-mcp\\server.py"]
}
}
}保存文件,然后完全退出并重新打开 Claude Desktop(不仅仅是关闭窗口——必须重启才能加载配置更改)。查看聊天框中的锤子/工具图标,确认 quantified-self 已连接。
FastMCP 还附带一个 CLI 快捷方式,可以为你编辑此文件——fastmcp install claude-desktop server.py --name "Quantified Self"——值得一试(运行 fastmcp install claude-desktop --help 查看当前标志),但上面的手动 JSON 始终有效,并且在出问题时更容易调试。Anthropic 还有一种较新的一键式"桌面扩展"打包格式,用于本地 MCP 服务器;对于像这样的个人使用来说不是必需的,但如果你想把此服务器分享给不太习惯编辑 JSON 的人,值得了解一下。
5.(可选)在 Docker 中运行 / 托管在 Glama 上
#5-optional-run-it-in-docker--host-it-on-glama
项目包含一个 Dockerfile,供任何想在容器中而不是本地 venv 中运行的人使用——包括托管在 Glama 上,当仓库中存在 Dockerfile 时,Glama 会直接从中构建。
docker build -t quantified-self-mcp .
docker run -i --rm -v "$PWD/data:/app/data" quantified-self-mcp该镜像仅包含 Python(python:3.12-slim + pip install -r requirements.txt);此项目中没有任何 Node.js。HEALTH_DB_PATH 和 FINANCE_DB_PATH 默认为容器内的 /data/health.db 和 /data/finance.db,这样挂载的卷(例如 Glama 的 /data 挂载)可以在重新部署时持久化你的数据库——请参阅 server.py 顶部的 Configuration 部分来覆盖它们。
glama.json 有意保持极简——它只是将 Glama 指向此仓库;Dockerfile 才是镜像如何构建和启动(python server.py,通过 stdio)的实际事实来源。glama.json 的早期版本试图手动配置一个通用 buildpack(裸的 debian:trixie-slim 基础镜像加上手动 pip install 构建步骤和 cmdArguments),而不是使用 Dockerfile——该镜像没有可靠地预置 Python 解释器,平台会回退到尝试运行此仓库中不存在的 Node.js 入口点(Cannot find module '/app/server.js')。提供 Dockerfile 消除了这种歧义。
隐私模型——"本地"到底意味着什么
值得对此精确说明,因为这是整个项目的意义所在:
两个 SQLite 数据库只存在于你的磁盘上,位于此项目的
data/文件夹内。服务器不进行任何网络调用,没有遥测,也不会同步到任何地方。server.py以 SQLite 的只读模式打开两个数据库(不仅仅是"不发出写入"——连接在物理上无法写入)。即使是有缺陷或恶意的提示词,也无法让任一工具修改你的数据;只有由你在终端中运行的init_db.py才会写入它们。当 MCP 客户端调用这些工具之一时,该查询返回的特定行会成为发送给回答模型的对话的一部分——这就是 MCP 向模型提供信息的机制。如果你使用 Claude Desktop 搭配托管模型,这意味着你询问的任何数据切片都会在该轮对话中发送给 Anthropic,就像你在聊天中键入的任何其他内容一样。
所以这里的"本地"意味着:你的完整数据集永远不会存储在任何第三方数据库中,也不会同步到任何第三方数据库,除非实际调用工具,否则不会传输任何内容——即使调用,也只有该特定调用返回的行,而不是整个数据库。这并不意味着端到端完全离线。要做到这一点,你需要一个完全本地的模型运行时(例如 Ollama)搭配一个兼容 MCP 的客户端。
故障排除
服务器没有出现在 Claude Desktop 中:检查
command和args是否使用绝对路径,确认 venv 的 Python 路径确实存在,并确认你完全退出并重新打开了应用。日志位于~/Library/Logs/Claude(macOS)或%APPDATA%\Claude\logs(Windows)——mcp-server-quantified-self.log会专门显示此服务器的 stderr。工具报"未找到健康/财务数据库":先为该数据集运行
init_db.py——工具故意不自动创建空数据库,这样你就不会得到静默的空答案。对
server.py的编辑似乎没有生效:重启 Claude Desktop;它每个应用会话启动一次服务器进程,而不是每条消息启动一次。在 Glama 上托管失败,报
Cannot find module '/app/server.js':这意味着部署回退到了 Node.js 运行时而不是 Python——此仓库没有server.js。请从附带的Dockerfile构建(参见上面的"在 Docker 中运行 / 托管在 Glama 上"),而不是使用通用 buildpack 配置,这样平台才能可靠地运行python server.py。
扩展此项目
几个自然的后续步骤,如果你想要的话——这些都没有内置,只是模式指向的方向:
编写工具(
log_expense、log_daily_metric),以便通过 LLM 而不是直接通过 CSV/SQL 添加条目。更多指标——体重、锻炼、情绪、饮水量——每个都只是另一张表和另一个读取工具。
一个预算对比实际工具,将
read_finance_data的总计与你定义的目标进行比较。
Available Tools
20 toolsaggregate_measurementsPreview a source-priority resolution of a day's measurementsARead-onlyIdempotent
Preview what one day's raw measurements would roll up to if a conflicting metric were resolved using source_priority, alongside that day's actual current daily_metrics values.
daily_metrics is a database-maintained projection (see db/schema.sql): every log_measurement/import automatically keeps it in sync the moment it's written, using each metric's fixed aggregation method: summed for steps, sleep_hours, workout_minutes and water_ml; averaged for resting_heart_rate, mood, heart_rate and hrv_ms; the latest reading for weight_kg (see aggregation_rules). When a metric has more than one source on a day, the projection uses only one source's observations, never a blend: the highest-ranked present source in the stored priority list (manual log_daily_metric entries rank first by default), else the source with the most hours that day, then the latest observation, then by name. This tool writes nothing: "aggregated" previews what the source_priority you pass would produce; "row" is the real, currently-stored value. If a metric has more than one source that day, use get_metric_provenance first to see whether they actually disagree.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: date (required), source_priority. Returns: row, date, aggregated
calculate_metric_trendCalculate metric trendARead-onlyIdempotent
Fit a simple straight-line trend to one metric over a window and
report its direction, slope (change per day), and r_squared (how well
a straight line actually fits — low r_squared means "noisy," not
"flat"; "insufficient_data" below 3 points). A low evidence.coverage_ratio
or claim.decision/data_health means flag the fit as sparse rather
than stating the slope as complete.
Use this tool when the user asks whether one metric is trending up/down/flat over a continuous window.
Do not use this tool when:
the user wants two specific, separately-defined ranges compared, rather than a single continuous slope -> use
compare_metric_periodsinstead.the user asks what's typical/normal rather than direction -> use
get_baselineinstead.the user asks about isolated unusual days rather than overall direction -> use
detect_metric_anomaliesinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: metric (required), end_date, start_date. Returns: claim, range, trend, metric, +2 more
clear_metricClear a single metricADestructiveIdempotent
Blank out (set to null) a single metric for a single day, without touching that day's other metrics. The counterpart to log_daily_metric for undoing a bad value — e.g. a mood logged for the wrong day, or a weight entered with the wrong units. Clears everything recorded for that metric/day — including individual log_measurement readings or imported rows, not just a value log_daily_metric wrote directly — so the metric genuinely goes back to "nothing recorded" rather than falling back to a blended value from whatever else is left.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: date (required), field (required). Returns: row, note, cleared
compare_metric_periodsCompare two periodsARead-onlyIdempotent
Compare one metric's average between two date ranges — e.g. "this
month vs. last month" or "since starting a new medication vs. before."
The two ranges may be any length and need not be adjacent or equal in
size; each is summarized with its own baseline first. Read
claim.decision/data_health before reporting — must_state has to be
mentioned, and claim.evidence_a/evidence_b can disagree sharply between
the two periods. delta/pct_change are null if either has no data.
Do not use this tool when:
there's only one continuous window and the question is about direction over time, not two discrete ranges -> use
calculate_metric_trendinstead.the user wants "what's normal" for a single window, not a before/after comparison -> use
get_baselineinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: metric (required), period_a_end (required), period_b_end (required), period_a_start (required), +1 more. Returns: claim, delta, metric, period_a, +7 more
detect_metric_anomaliesDetect metric anomaliesARead-onlyIdempotent
Flag days where one metric deviated sharply from its own baseline over
the window, using a median/MAD-based modified z-score rather than a
mean/stdev z-score — more robust for short, noisy personal-health
series, where the mean/stdev version is easily dragged around by the
very outliers it's supposed to catch. An empty result only means
"nothing unusual" when claim.decision (and data_health) says the
data supports it — tier "insufficient" means say the detector couldn't
score the series, not that it's clean.
Do not use this tool when:
the user wants a general sense of what's typical, with no interest in flagging specific days -> use
get_baselineinstead.the user asks about a steady increase/decrease over time rather than isolated spikes/dips -> use
calculate_metric_trendinstead.the user already has one specific date in mind and wants the full "why" behind it (baseline, anomaly, trend, and correlations together) -> use
explain_metric_changeinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: metric (required), end_date, threshold, start_date. Returns: claim, range, metric, evidence, +3 more
explain_metric_changeExplain a metric changeARead-onlyIdempotent
Build an evidence bundle for "why did my look like that on
?": that day's value against a 90-day baseline, whether it
qualifies as an anomaly, the trend leading into it, and any other
metric that correlates with it strongly enough to be worth mentioning.
Returns facts, not an explanation — turning "sleep was 2.6 stdev below
baseline and resting heart rate correlates at r=0.71" into an actual
answer for the person is what the calling model should do with these
facts, not something this tool guesses at itself. Use overall_decision
(weakest-of-N over the baseline, trend and every correlation) to decide
what to report/caveat, not the individual claim/evidence fields.
"narrative_facts" restates the bundle in plain English but does not
hedge on coverage itself; check data_health too.
Do not use this tool when:
scanning across many metrics for what changed lately, without a specific metric/date in mind -> use
get_recent_changesinstead.you only need one piece of this bundle (just the baseline, just the trend, just anomalies, or just a correlation) rather than the full why-explanation -> use
get_baseline,calculate_metric_trend,detect_metric_anomalies, orfind_metric_correlationdirectly instead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: date (required), metric (required). Returns: date, trend, value, metric, +13 more
export_health_data_csvExport health data to CSVADestructiveIdempotent
Write daily health metrics for a date range to a CSV file on disk, next to the database, instead of returning every row through this tool's own result.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Unlike read_health_data, this is not capped at MAX_ROWS_RETURNED and the row values themselves are not included in this tool's response — only the resulting file's path and a row count are, so a long-range export doesn't have to pass through a cloud LLM's context. Any metric listed in HEALTH_PRIVATE_FIELDS is still written as an empty cell, since those fields shouldn't leave the database at all.
Inputs: end_date, start_date. Returns: path, range, rows_exported
find_metric_correlationFind correlation between two metricsARead-onlyIdempotent
Compute the Pearson correlation between two metrics over the same window, joined by date. Correlation, not causation: a strong r just means the two moved together, not that one caused the other. A question phrased causally ("does my sleep affect my mood?") still gets only this association. The result does not show that one metric affects or causes the other, so report r, n and the wording the claim allows, and say nothing stronger.
Use this tool when the user names or implies two different metrics and asks whether they move together.
Do not use this tool when:
only one metric is in question -> use
get_baseline,calculate_metric_trend, ordetect_metric_anomaliesinstead, depending on what's being asked about that one metric.the question is why one metric looked the way it did on a specific date -> use
explain_metric_change, which already reports the other metrics that correlate with it.the question is whether one metric differs between two time periods (e.g. before vs. after a date) -> use
compare_metric_periods.
Reading the result: report what was observed (r, n, and how many days of each metric were present) separately from what may be claimed about it. Read claim.decision before reporting r. Its tier (insufficient, suggestive, detectable_not_meaningful or supported) is the strongest wording allowed, and a high r from a thin or gappy sample is capped there, not in r itself, so never judge a correlation from r alone. claim.decision.template is a sentence frame, not finished text: replace "..." with the finding, and {limiting_factors} with the must_state entries put into plain words. Those entries are codes, not sentences (practical_not_evaluated, for example, means that whether the difference matters in practice was not checked), so do not quote a code to the user. When data_health is not VALID, say why.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: metric_a (required), metric_b (required), end_date, lag_days, +1 more. Returns: n, r, note, claim, +6 more
get_baselineGet metric baselineARead-onlyIdempotent
Compute "what's normal" for one metric over a window: mean, median, and
standard deviation. The number every other analytics tool below measures
against, so a wider window (60-90+ days) is more stable than
read_health_data's 30-day default. Read claim.decision/data_health
before stating it — a thin window caps how it may be reported. Null
fields (n=0) mean no data in range, not an error.
Do not use this tool when:
the user asks whether a metric is going up/down over time -> use
calculate_metric_trendinstead.the user asks whether specific days looked unusual -> use
detect_metric_anomaliesinstead.the user wants two ranges compared against each other -> use
compare_metric_periodsinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: metric (required), end_date, start_date. Returns: claim, range, metric, baseline, +2 more
get_data_statusCheck how current the data isARead-onlyIdempotent
Report how current and complete the database is: latest data date, coverage window, gaps, last successful import, and an overall status of CURRENT, STALE, INCOMPLETE, NO_DATA or IMPORT_FAILED. Check this before drawing conclusions from any analysis, and say so when the status is anything other than CURRENT. The status and latest_data describe the database as a whole, so one metric still arriving keeps them current while another has stopped: read "stale_metrics" too (each metric's own latest day vs. its threshold, most behind first; it's when the data is for, not when imported) before presenting a listed metric as current.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: stale_after_days. Returns: gaps, as_of, action, reason, +12 more
get_import_statusList recent importsARead-onlyIdempotent
List the most recent import runs, newest first: which importer, the source file's name and SHA-256, whether the run succeeded, failed or was interrupted, and how many rows were loaded, skipped and written. A run still marked "running" long after it started was interrupted.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: limit. Returns: imports
get_metric_historyGet metric historyARead-onlyIdempotent
One metric's day-by-day values only, not the other metrics read_health_data always includes. Check "data_health" before trusting the points as complete.
Do not use this tool when:
the request is broad/general, across multiple metrics at once -> use
read_health_datainstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: metric (required), end_date, start_date. Returns: range, metric, points, evidence, +1 more
get_metric_provenanceBreak a metric down by sourceARead-onlyIdempotent
Show one metric's raw measurements for one day, broken down by which source reported them — answers "which one is correct?" when e.g. an Apple Watch and a Garmin disagree on resting heart rate, instead of silently averaging two different devices into one number.
Do not use this tool when:
the user just wants a plain day-by-day history for the metric, with no need to see the per-source breakdown -> use
get_metric_historyinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: date (required), metric (required). Returns: date, metric, sources, conflict
get_recent_changesGet recent changesARead-onlyIdempotent
Scan every (non-private) metric for what's changed lately: a recent
period vs. the four-times-as-long period before it (period-over-period
shift), any anomalies inside the recent period, and a trend over it.
The single best tool to start a "how have I been doing?" conversation
with — it does the scanning across all metrics that would otherwise
take one get_baseline/detect_metric_anomalies/calculate_metric_trend
call per metric. Only notable findings are included (reports signal, not
a status page). Each change carries its own claim/evidence — don't
state it as plain fact when evidence.confidence is "moderate"/"low".
Check data_health too.
Do not use this tool when:
the user already named a specific metric and wants the full why-bundle for it (value, baseline, anomaly flag, trend, correlated metrics) -> use
explain_metric_changeinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: days. Returns: changes, data_health, recent_range, baseline_range
log_daily_metricLog a daily metricADestructiveIdempotent
Record one or more health metrics for a single day, creating that day's row if it doesn't already have one.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Only the metrics you pass are written — anything left as null is not touched, so logging just today's mood doesn't erase today's steps if they were set earlier. To undo a value logged by mistake, use clear_metric rather than trying to overwrite it with a placeholder. Use this for a simple day-level value for one of the nine fixed metrics below.
Do not use this tool when:
the observation needs its own timestamp/source, or the day may have more than one reading of the same metric -> use
log_measurementinstead.it's a workout/exercise session -> use
log_workout_sessioninstead (workout_minutes here is just the daily total, not the session itself).
Inputs: date (required), mood, steps, hrv_ms, +6 more. Returns: row, logged
log_measurementLog a raw measurementA
Record a single raw observation — one metric, one value, one point in time — rather than a whole day's summary. Use this instead of log_daily_metric when the source, exact time, or the fact that there were multiple readings that day matters (e.g. three separate workouts, or a wearable's periodic heart-rate samples).
Do not use this tool when:
it's just a single end-of-day value for a fixed metric -> use
log_daily_metricinstead.it's a workout/exercise session -> use
log_workout_sessioninstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: value (required), metric (required), timestamp (required), unit, +2 more. Returns: measurement
log_workout_sessionLog a workout sessionA
Record one workout as a structured event — activity, timing, intensity, and heart-rate response — rather than folding it into the day's workout_minutes total. Use this alongside (not instead of) log_daily_metric/log_measurement for workout_minutes: this is what lets explain_metric_change say what the workout was, not just how long it ran. A day can have more than one session; each call adds a new row.
Do not use this tool when:
the user only wants to record the day's total exercise minutes as a single number, with no activity type/timing/intensity -> use
log_daily_metric(workout_minutes) orlog_measurementinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: date (required), activity_type (required), duration_minutes (required), notes, +5 more. Returns: session
read_health_dataRead health dataARead-onlyIdempotent
Read daily health metrics from the local database: steps, sleep hours, resting heart rate, weight (kg), workout minutes, mood, and water intake (ml). Best for a broad/general request across multiple metrics at once. Check "coverage" before treating "summary" as a full picture — a "confidence" of "moderate"/"low", or one metric's coverage_percent much lower than the rest, means say so.
Do not use this tool when:
the user wants one specific metric's history/trend over time -> use
get_metric_historyinstead.the user wants raw/individual measurement rows (timestamp, source) -> use
read_measurementsinstead.the user wants workout sessions specifically -> use
read_workout_sessionsinstead.the user is asking why something changed, or wants a trend, anomaly, comparison, or correlation -> use
explain_metric_change(one metric, one date) orget_recent_changes(scan across all metrics) instead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: end_date, start_date. Returns: rows, range, summary, coverage, +1 more
read_measurementsRead raw measurementsARead-onlyIdempotent
Read individual measurement rows (not the daily_metrics aggregate), most recent first. Use this to see exactly when and where each reading came from, rather than just a day's summarized value.
Do not use this tool when:
the user wants a broad, multi-metric overview -> use
read_health_datainstead.the user wants one metric's day-by-day history -> use
get_metric_historyinstead.the user wants workout sessions -> use
read_workout_sessionsinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: limit, metric, source, end_date, +1 more. Returns: count, measurements
read_workout_sessionsRead workout sessionsARead-onlyIdempotent
Read individual workout sessions (not the daily_metrics workout_minutes total), most recent day first. Use this to see what each workout actually was — activity, timing, intensity, heart rate — rather than just a day's summed minutes.
Do not use this tool when:
the user just wants the daily workout_minutes total, not individual sessions -> use
read_health_dataorget_metric_historyinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
Inputs: limit, end_date, start_date, activity_type. Returns: count, sessions
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
The tools are cleanly separated by purpose: raw vs daily logging, workouts, several read granularities, status, analytics, provenance, export, and clearing. Descriptions include explicit "Do not use this tool when" guidance that resolves subtle overlaps such as read_health_data vs get_metric_history vs read_measurements, and get_recent_changes vs explain_metric_change.
All names use consistent snake_case with a leading verb, e.g. log_measurement, read_health_data, get_baseline, detect_metric_anomalies. The verbs vary by operation but follow a predictable verb_noun pattern with no camelCase or arbitrary style mixing.
At 20 tools the surface is heavy for an agent to navigate, even though each tool targets a real operation. The analytics and read families are defensible individually, but the overall set would benefit from grouping or consolidation.
The server covers logging, daily/raw reading, workouts, analytics, data/import status, provenance, export, and clearing. Minor gaps remain: workout sessions cannot be updated or deleted, individual measurement rows cannot be deleted except via clear_metric, and there is no import-trigger tool despite import status being exposed.
Maintenance
Related MCP Connectors
Personal finance, bank account, and shared memory connector for Claude, ChatGPT, Gemini Spark & more
Ask Claude, ChatGPT or Cursor about your Apple Health data: workouts, sleep, food. Read-only.
Your health and performance memory: 100+ sources and your lab results, for any AI app.
Query, explore, and manage your databases through natural conversation.
Related MCP Servers
- AlicenseAqualityAmaintenanceAn MCP server that allows users to query and analyze their Apple Health data using SQL and natural language, utilizing DuckDB for fast and efficient health data analysis.378 npm579MIT
- AlicenseNot gradedqualityDmaintenanceLoads Apple Health export data into a local SQLite database and exposes tools to query health metrics and workout records via natural language.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying personal data synced from services like Lunch Money and Strava using SQL via Claude.1MIT
- AlicenseBqualityDmaintenanceEnables AI agents to interact with local SQLite databases with full CRUD, schema introspection, foreign key relations, generated columns, and multi-format import/export (CSV, JSON, XLSX) through natural language.2614 npmMIT