# Thecimal/quantified-self-mcp [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/Thecimal/quantified-self-mcp  
**GitHub Stars:** 9  
**Views:** 16  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/thecimal-quantified-self-mcp

## Description
Query your personal health and finance data from Claude Desktop. Two local SQLite files, read directly off disk by a Python process you control — no cloud database, no dashboard, no third-party service.

## Tools
Capabilities this server exposes over MCP:

- **read_health_data** — 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_history` instead.
- the user wants raw/individual measurement rows (timestamp, source) ->
  use `read_measurements` instead.
- the user wants workout sessions specifically -> use
  `read_workout_sessions` instead.
- the user is asking *why* something changed, or wants a trend,
  anomaly, comparison, or correlation -> use `explain_metric_change`
  (one metric, one date) or `get_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.
- **export_health_data_csv** — 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.
- **log_daily_metric** — 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_measurement` instead.
- it's a workout/exercise session -> use `log_workout_session` instead
  (workout_minutes here is just the daily total, not the session itself).
- **clear_metric** — 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.
- **log_measurement** — 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_metric` instead.
- it's a workout/exercise session -> use `log_workout_session` 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.
- **read_measurements** — 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_data` instead.
- the user wants one metric's day-by-day history -> use
  `get_metric_history` instead.
- the user wants workout sessions -> use `read_workout_sessions` 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.
- **aggregate_measurements** — 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.
- **get_metric_provenance** — 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_history`
  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.
- **log_workout_session** — 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) or `log_measurement` 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.
- **read_workout_sessions** — 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_data` or `get_metric_history` 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.
- **get_data_status** — 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.
- **get_import_status** — 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.
- **get_metric_history** — 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_data` 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.
- **get_baseline** — 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_trend` instead.
- the user asks whether specific days looked unusual -> use
  `detect_metric_anomalies` instead.
- the user wants two ranges compared against each other -> use
  `compare_metric_periods` 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.
- **detect_metric_anomalies** — 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_baseline` instead.
- the user asks about a steady increase/decrease over time rather
  than isolated spikes/dips -> use `calculate_metric_trend` instead.
- 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_change` 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.
- **calculate_metric_trend** — 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_periods`
  instead.
- the user asks what's typical/normal rather than direction -> use
  `get_baseline` instead.
- the user asks about isolated unusual days rather than overall
  direction -> use `detect_metric_anomalies` 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.
- **compare_metric_periods** — 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_trend` instead.
- the user wants "what's normal" for a single window, not a
  before/after comparison -> use `get_baseline` 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.
- **find_metric_correlation** — 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`, or `detect_metric_anomalies` instead,
  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.
- **get_recent_changes** — 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_change` 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.
- **explain_metric_change** — Build an evidence bundle for "why did my <metric> look like that on
<date>?": 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_changes` instead.
- 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`, or `find_metric_correlation` directly
  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.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "quantified-self-mcp": {
    "command": "uvx",
    "args": ["quantified-self-mcp"],
    "env": {
      "HEALTH_PRIVATE_FIELDS": ""
    }
  }
}
```

**Requires environment variables:** `HEALTH_PRIVATE_FIELDS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Thecimal/quantified-self-mcp MCP server does

Thecimal/quantified-self-mcp exposes a local SQLite health database through MCP. It supports daily metrics such as steps, sleep hours, resting heart rate, weight, workout minutes, mood, water intake, heart rate, and HRV, along with timestamped measurements and structured workout events.

The server is designed for both data entry and analysis. You can log a single end-of-day value, preserve multiple observations with timestamps and sources, record detailed exercise sessions, inspect imported data, and ask for evidence-backed summaries over time. A CSV export tool writes selected daily data to disk and returns the file path and row count instead of sending every exported row through the model response.

## How it works

A Python MCP process reads and writes SQLite files on the local machine. The database maintains `daily_metrics` as a projection of raw measurements. Aggregation rules differ by metric: some values are summed, some averaged, and weight uses the latest reading. When multiple sources report the same metric on a day, source priority determines which source contributes to the projection rather than blending devices together.

The analysis tools provide statistical context alongside results. Baselines include mean, median, and standard deviation; trend analysis fits a straight line and reports direction, slope, and `r_squared`; anomaly detection uses a median/MAD-based modified z-score. Period comparisons, date-joined Pearson correlations, recent-change scans, and date-specific evidence bundles support more targeted questions. Correlation results are associations, not causal findings, and include claim guidance and data-health information.

## Setup and configuration

Install the Python package with:

```bash
pip install quantified-self-mcp
```

The package provides `quantified-self-init-db` for database initialization and imports. It can seed 60 days of synthetic demo data with `--demo`, or import Apple Health XML, WHOOP Developer API v2 JSON, Oura API v2 JSON, Android Health Connect ZIP exports, and CSV files. Run `quantified-self-doctor` to check Python dependencies, schema integrity, and database readiness.

For Claude Desktop, Cursor, or Windsurf, configure an MCP server that runs `uvx quantified-self-mcp`. The same executable can be referenced directly if installed with pip. `HEALTH_PRIVATE_FIELDS` accepts comma-separated metric names such as `weight_kg,mood`; those fields remain in SQLite but are excluded from AI queries and analytics. Local database storage does not prevent data from reaching a cloud model when the MCP client uses one.

## Tools and capabilities

- Read broad daily health summaries with `read_health_data`.
- Export date ranges with `export_health_data_csv`.
- Add or clear day-level values using `log_daily_metric` and `clear_metric`.
- Store and inspect timestamped, source-aware observations with `log_measurement` and `read_measurements`.
- Preview aggregation choices with `aggregate_measurements` and investigate source disagreement with `get_metric_provenance`.
- Record and read structured exercise events with `log_workout_session` and `read_workout_sessions`.
- Check freshness, coverage, gaps, and import outcomes using `get_data_status` and `get_import_status`.
- Retrieve single-metric histories with `get_metric_history`.
- Compute baselines, trends, anomalies, period comparisons, and cross-metric correlations with `get_baseline`, `calculate_metric_trend`, `detect_metric_anomalies`, `compare_metric_periods`, and `find_metric_correlation`.
- Assemble a date-specific evidence bundle with `explain_metric_change`, or scan recent changes across non-private metrics with `get_recent_changes`.

## Limitations and notes

The server stores data locally, but tool output becomes part of the conversation handled by the configured model. Treat a cloud model as receiving the returned health data. `HEALTH_PRIVATE_FIELDS` provides field-level exclusion for AI-facing queries and analytics, while CSV export leaves those fields blank.

Analytical results depend on coverage, gaps, sample size, and data freshness. Check `get_data_status` before interpreting recent data, and use provenance tools when multiple devices disagree. The tools provide measurements, statistical evidence, and caveats; they do not establish that one metric caused another or supply a medical diagnosis.

_Full upstream README: https://allmcps.com/mcp/thecimal-quantified-self-mcp/readme_

