Skip to main content
Glama

⚡ One-command install — pick your runtime:


HTTP (v2 stateless)

Default is stdio. Optional Streamable HTTP — no session id, JSON responses, loopback only:

npx -y wellness-cgm-mcp@0.7.0 --http
# GET  http://127.0.0.1:3000/health
# POST http://127.0.0.1:3000/mcp   (sessionless)

Env: WELLNESS_CGM_HOST, WELLNESS_CGM_PORT, WELLNESS_CGM_TRANSPORT=http.

Related MCP server: mcp-server-dexcom-health

Overview

Local MCP server that exposes CGM data (and synthetic mock data when nothing is configured) to any MCP-aware agent. Two real backends are supported: Dexcom (Developer API, sandbox + production) and FreeStyle Libre (the OTC sensor — Libre 2 / Libre 3) via LibreLink Up. Pick the backend with CGM_PROVIDER; it auto-detects Libre when only Libre credentials are set. Both feed the same ADA time-in-range / GMI / hypo / meal-response engine.

Try It In 60 Seconds (mock mode, zero setup)

npx -y wellness-cgm-mcp@0.7.0 doctor       # see env / mode
npx -y wellness-cgm-mcp@0.7.0 status

# In Claude Desktop / Cursor / etc., add:
# {
#   "mcpServers": {
#     "wellness-cgm": {
#       "command": "npx",
#       "args": ["-y", "wellness-cgm-mcp@0.7.0"]
#     }
#   }
# }

The agent now has 10 CGM tools. Without a Dexcom token, every tool returns synthetic readings tagged mock: true — perfect for prototyping.

Live setup (Dexcom Developer)

# 1. Sign up at https://developer.dexcom.com (sandbox is free)
# 2. Create an app, register your redirect URI
export DEXCOM_ENV=sandbox
export DEXCOM_CLIENT_ID=...
export DEXCOM_CLIENT_SECRET=...
export DEXCOM_REDIRECT_URI=https://your.callback/redirect

# 3. Get the OAuth URL, open it, grant access, copy the code from the redirect
npx -y wellness-cgm-mcp@0.7.0 authorize

# 4. Swap code for tokens
npx -y wellness-cgm-mcp@0.7.0 exchange <auth_code_from_redirect>

# 5. Set DEXCOM_ACCESS_TOKEN to the access_token, restart the MCP — flips from mock to live.

Live setup (FreeStyle Libre — the OTC sensor)

No developer program, no app to build — just the same email/password you use in the LibreLinkUp follower app (the OTC Libre 2 / Libre 3 sensor works). In the LibreLink app, share your readings; in the LibreLinkUp app, accept the invite. Then:

export CGM_PROVIDER=libre               # or just set the creds below and let it auto-detect
export LIBRELINKUP_EMAIL=you@example.com
export LIBRELINKUP_PASSWORD=...
# Optional: region shard if you're not on EU/global, and a pinned sensor:
export LIBRELINKUP_REGION=us            # eu (default) | us | de | fr | au | jp ...
# export LIBRELINKUP_PATIENT_ID=<id>    # only if you follow more than one sensor

# Verify credentials + list the sensor(s) you follow (never prints the token):
npx -y wellness-cgm-mcp@0.7.0 libre-login

Once logged in, every glucose tool (cgm_glucose_now, cgm_daily_summary, cgm_time_in_range, cgm_meal_response, cgm_hypo_events, …) reads from Libre and returns the same ADA TIR / GMI / hypo / meal-response metrics — each response carries a provider field so you always know the source. Without any credentials, everything returns synthetic mock: true data.

Libre history limit: ~12h per read

LibreLink Up's graph endpoint takes no start/end parameter — it always answers with its own fixed trailing window of roughly 12 hours. Asking for 24h or 72h does not widen it, so on Libre those extra hours simply do not exist.

Every windowed payload therefore reports what it actually covered:

// cgm_daily_summary({ hours: 72 }) on live Libre
{
  "window_hours": 72,          // what you asked for
  "hours_covered": 12,         // what the numbers below are ACTUALLY computed over
  "observed_window": { "start": "…", "end": "…", "hours": 12 },
  "window_truncated_by_provider": true,
  "notes": ["LibreLink Up returns ~12h of graph data per read and ignores wider spans; requested 72h, covered 12h. …"]
}

Read hours_covered, never the requested hours / window_hours. A GMI (estimated A1C), CV or time-in-range built on 12h is not a 3-day result. For multi-day metrics use Dexcom, whose v3 API takes an explicit start/end and honours the request. Mock mode synthesises the full requested span, so it is never truncated.

The same applies to cgm_hypo_events, which takes an explicit from/to: "no hypoglycemia events" is only a claim about hours_covered. A 3-day question answered from a live Libre read is a 12-hour answer, and the payload says so in hours_covered, observed_window.hours, window_truncated_by_provider and notes. (events_per_day is safe either way — its denominator is the observed span, not the requested one — but the frame around it is not.)

window_truncated_by_provider is structural, not empirical

It answers "can this provider cover a span this wide?" — never "did this particular read come back short?". A sensor applied two hours ago answers cgm_daily_summary({ hours: 12 }) with hours_covered: 2, window_truncated_by_provider: false and an empty notes, because nothing is broken and warning there would be a false alarm. That is deliberate:

An empty notes means "no known provider ceiling was hit", not "the window was fully covered". hours_covered is the only number that states the real span — compare it against hours_requested before reporting any window.

Tools (19)

Tool

Purpose

cgm_agent_manifest

Runtime contract

cgm_capabilities

Providers, metrics, privacy modes

cgm_connection_status

env, credentials, mode (live vs mock)

cgm_privacy_audit

Local storage + outbound destinations

cgm_data_inventory

Metric catalog + TIR ranges + GMI formula

cgm_glucose_now

Most recent EGV + trend

cgm_glucose_window

All EGVs over last N hours (+ hours_covered — see the Libre ~12h limit)

cgm_daily_summary

Mean / GMI / CV / 2 TIR profiles — over hours_covered, not the requested window

cgm_meal_response

Baseline → peak → return + band

cgm_authorize_url

Dexcom OAuth URL builder

cgm_hypo_events

Hypo event detection (ADA Level 1 < 70, Level 2 < 54) — "no events" applies to hours_covered only

cgm_libre_status

FreeStyle Libre (LibreLink Up) config + region + mode — v0.4

cgm_libre_login

Log in to LibreLink Up + list followed sensors — v0.4

The table omits the shared profile/onboarding/quickstart/demo helpers (cgm_profile_get, cgm_profile_update, cgm_onboarding, cgm_quickstart, cgm_demo) for brevity — call cgm_agent_manifest for the full, always-current list.

Two Time-In-Range profiles in every summary

  • Diabetic (70-180 mg/dL) — ADA standard for adults with diabetes.

  • Metabolic health (70-140 mg/dL) — Levels-style for non-DM users.

Agents surface BOTH so the user picks the one that fits their context.

Meal response bands

Peak Δ from baseline

Band

< 30 mg/dL

excellent

30-49

good

50-79

moderate

≥ 80

poor

Combine with wellness-nourish to compute "what did I eat → what happened" automatically.

The killer combo

wellness-nourish: meal at 13:15 (rice + chicken)
       ↓
wellness-cgm-mcp.cgm_meal_response(meal_time)
       ↓
{ peak: 167, peak_delta: 72, band: "moderate", peak_time_minutes: 45 }
       ↓
whoop-mcp.recovery: 67%
       ↓
Agent: "That meal hit a moderate spike (peak +72 mg/dL at 45 min)
        AND recovery is borderline. Try protein-first next time, or
        swap white rice for lentils — should drop the peak ~30 mg/dL."

Levels charges $199/mo for this. Here it is, free, local-first, MCP.

Privacy

  • ✅ Credentials local only — DEXCOM_ACCESS_TOKEN / LIBRELINKUP_* stay in env vars; the LibreLink Up auth token is never returned in tool output.

  • ✅ Mock mode by default — every tool returns synthetic data with mock: true until a provider is configured.

  • ✅ No third-party telemetry — outbound calls go only to your CGM provider (Dexcom or, for Libre, Abbott's LibreLink Up API).

Run wellness-cgm-mcp doctor to inspect.

Roadmap

  • ✅ v0.4 — FreeStyle Libre via LibreLink Up (the OTC sensor). Shipped.

  • next — Refresh-token rotation. Per-meal historical browser (which foods spike YOU?). Threshold alerts (agent notified when glucose holds > X mg/dL for Y minutes). Cross-meal automation with wellness-nourish.

What this is NOT

  • Not medical advice or diagnosis.

  • Not for insulin/medication dosing decisions — defer to clinician.

  • Not affiliated with Dexcom or Abbott.

📧 Contact & Support

License

MIT — see LICENSE.

wellness-cgm-mcp is independent open-source software. Dexcom and FreeStyle Libre are trademarks of their respective owners. Neither company is affiliated with or endorses this project.

Skill or MCP

Same package, two doors. MCP registers tools on stdio/HTTP. The skill can drive the same tools through the CLI when the client has no MCP:

npx -y wellness-cgm-mcp@0.7.0 call cgm_connection_status --json '{}'

Copy skill/SKILL.md into your agent skills dir.

0.7.0 — candidate (2026-11-02)

This is a release candidate, not evidence of an npm publication. Existing installations are not updated automatically.

Migration and security boundaries

  • HTTP transport accepts loopback only. LAN addresses and wildcard binds are rejected; use stdio or a local loopback client instead.

  • Wellness profiles are validated, limited to 256 KiB, and protected with a cooperative lock. Oversized or invalid existing profiles must be corrected before use. Symbolic links, including dangling links and legacy profile paths, are rejected. These checks do not guarantee safety against a hostile local filesystem or non-cooperating processes.

  • MCP inputs have a 10,000-element budget and HTTP bodies are limited to 1 MiB; compressed request bodies are rejected. Previously accepted oversized requests may now fail; reduce request sizes rather than disabling validation.

  • Dependency fixes are included. Upgrade explicitly after publication and restart the connector; old installations retain their previous behavior.

Available Tools

19 tools
cgm_agent_manifestCGM agent manifestA
Read-onlyIdempotent

Returns the wellness-cgm-mcp agent manifest: tool list, supported clients, env vars, recommended first calls, capabilities, privacy posture, and community links.

Inputs: client, privacy_mode.

cgm_authorize_urlCGM authorize URLA
Read-onlyIdempotent

Read-only OAuth URL generation; does not exchange tokens. Not a state mutation of glucose data. Gated by: user must open URL themselves (explicit user action). Builds the Dexcom OAuth authorize URL. The user opens it, grants access, and Dexcom redirects to your registered DEXCOM_REDIRECT_URI with an auth code. If credentials are missing, returns a hint with the exact env vars needed.

Inputs: state.

cgm_capabilitiesCGM capabilitiesA
Read-onlyIdempotent

Lists supported providers, configured providers (via env vars), available metrics, and privacy modes.

Inputs: privacy_mode.

cgm_connection_statusCGM connection statusA
Read-onlyIdempotent

Reports the active CGM provider (dexcom | libre), why it was selected, whether credentials are present, and whether the connector will return mock vs live data. For Dexcom it includes the env (sandbox/production); for FreeStyle Libre it includes the LibreLink Up region.

Inputs: privacy_mode.

cgm_daily_summaryCGM daily summaryA
Read-onlyIdempotent

Returns daily glucose stats: mean, median, min/max, stdev, GMI (estimated A1C), CV, time-in-range (diabetic 70-180 + metabolic-health 70-140). window_hours is what was REQUESTED; every stat is computed over hours_covered / observed_window, which can be shorter — FreeStyle Libre (LibreLink Up) caps a live read at ~12h, so a 72h request yields a half-day metric and notes flags it. Never report these numbers as covering more than hours_covered.

Inputs: hours, privacy_mode.

cgm_data_inventoryCGM data inventoryB
Read-onlyIdempotent

Returns the metric catalog plus thresholds (TIR ranges, GMI formula reference).

Inputs: privacy_mode.

cgm_demoCGM demoA
Read-onlyIdempotent

Returns realistic example payloads of cgm_glucose_now, cgm_daily_summary, and cgm_meal_response. Use this to help users see what the connector will return before configuring Dexcom.

Inputs: privacy_mode.

cgm_glucose_nowCGM glucose nowA
Read-onlyIdempotent

Returns the most recent EGV (estimated glucose value) plus trend arrow if available.

Inputs: privacy_mode.

cgm_glucose_windowCGM glucose windowA
Read-onlyIdempotent

Returns all EGVs over the last N hours (default 24). hours is the window REQUESTED; hours_covered and observed_window state what the provider actually returned. FreeStyle Libre (LibreLink Up) caps a live read at ~12h regardless of the request, so any wider ask comes back short and notes says so — read the covered window, not the requested one.

Inputs: hours, privacy_mode.

cgm_hypo_eventsCGM hypo eventsA
Read-onlyIdempotent

v0.3.3 — Detect hypoglycemia events between from and to ISO dates. Returns an array of contiguous below-threshold runs lasting ≥ min_duration_minutes, each with started_at, ended_at, duration_minutes, min_glucose_mg_dl, mean_glucose_mg_dl, severity (level_1 = <70 ADA Level 1, level_2 = <54 ADA Level 2), and recovery_time_minutes (time to first reading ≥ threshold+10). Also returns total_events, total_minutes_below, mean_min_glucose, events_per_day, a summary string, and recommendations grounded in what was actually observed. window is the span REQUESTED; hours_covered, observed_window and window_truncated_by_provider state what the provider actually returned — FreeStyle Libre (LibreLink Up) caps a live read at ~12h, so a 3-day question can be answered from half a day and notes says so. "No hypos" is only true for hours_covered. MEDICAL DISCLAIMER: NOT medical advice. Do not use for treatment decisions. Hypo events should be discussed with your clinician.

Inputs: to (required), from (required), privacy_mode, response_format, +3 more.

cgm_libre_loginCGM Libre loginA
Read-onlyIdempotent

Authenticate against LibreLink Up using LIBRELINKUP_EMAIL / LIBRELINKUP_PASSWORD and list the sensors (connections) this account follows. Confirms the FreeStyle Libre path works end-to-end before reading glucose. Never returns the auth token. When credentials are missing it returns mock=true with a synthetic connection so the surface can be demoed without an Abbott account.

Inputs: privacy_mode.

cgm_libre_statusCGM Libre statusA
Read-onlyIdempotent

Reports FreeStyle Libre (LibreLink Up) configuration: region, whether LIBRELINKUP_EMAIL/PASSWORD (or a token) are set, whether a patient id is pinned, and whether reads will be live or mock. Use this to confirm the Libre path is wired before calling glucose tools with CGM_PROVIDER=libre.

Inputs: privacy_mode.

cgm_meal_responseCGM meal responseA
Read-onlyIdempotent

Compute glucose response to a meal: baseline → peak → return-to-baseline. Returns peak delta, peak time (min after meal), and a band (excellent/good/moderate/poor).

Inputs: meal_time (required), privacy_mode, window_hours.

cgm_onboardingCGM onboardingA
Read-onlyIdempotent

Returns the 11-question onboarding flow for the shared Delx Wellness profile. Read-only. The agent should ask these questions next so wellness-cgm-mcp (and the rest of the wellness stack) can personalize responses — non-secret data only, stored at ~/.delx-wellness/profile.json.

Inputs: locale, privacy_mode.

cgm_privacy_auditCGM privacy auditA
Read-onlyIdempotent

Returns what wellness-cgm-mcp stores locally, what is sent to Dexcom, what is never logged, and agent rules.

Inputs: privacy_mode.

cgm_profile_getCGM profile getA
Read-onlyIdempotent

Returns the shared Delx Wellness profile (~/.delx-wellness/profile.json). Read-only. Surfaces diabetes status / non-DM context so wellness-cgm-mcp can pick the right time-in-range profile (70-180 ADA vs 70-140 metabolic-health).

Inputs: privacy_mode.

cgm_profile_updateCGM profile updateA

Persist a partial patch to the shared Delx Wellness profile. Requires explicit_user_intent: true. Rejects any field containing oauth/token/secret/password/cookie/refresh/api_key/session — the profile is for non-secret wellness context only.

Inputs: patch (required), explicit_user_intent.

cgm_quickstartCGM quickstartA
Read-onlyIdempotent

Returns a personalized 3-step walkthrough for getting wellness-cgm-mcp from mock mode → live mode (Dexcom). Call this first when the user asks 'how do I connect my CGM?'

Inputs: client, privacy_mode.

cgm_time_in_rangeCGM time in range (windowed)A
Read-onlyIdempotent

Compute Time in Range (TIR), Time Below Range, and Time Above Range over a specific time window with a customizable target range. Use this for mealtime TIR (e.g. 7am-10am breakfast window), overnight TIR (e.g. 23:00-07:00), or specific date-range comparisons. Returns total_readings, readings_in_window, mean_glucose, median_glucose, and GMI (Glucose Management Indicator, estimated A1C per ADA / Bergenstal 2018: GMI% = 3.31 + 0.02392 × mean_mg_dL). Supports a time_window preset ("wake" = 06:00-22:00, "sleep" = 22:00-06:00, "all") OR explicit start_hour / end_hour (0-24, UTC) for recurring hour-of-day filtering. Defaults: 24h load, ADA 70-180 mg/dL, time_window=all. Pulls from cgm_glucose_window data; falls back to mock in unauth mode.

Inputs: hours, end_hour, end_time, start_hour, +5 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 19 tools

    Disambiguation5/5

    Each tool targets a distinct aspect: connection status, glucose reading, analytics (hypos, daily summary, TIR, meal response), authentication (Dexcom OAuth, Libre login), profile management, and demo. The overlap between cgm_connection_status and cgm_libre_status is resolved by scope (general vs. Libre-specific), and descriptions clearly differentiate window vs. now, and summary vs. TIR.

    Naming Consistency5/5

    All tools follow a consistent cgm_ prefix with snake_case naming. While some are noun-only (cgm_manifest, cgm_demo) and others are verb_noun (cgm_profile_get, cgm_profile_update), the pattern is uniform and predictable, making it easy to infer the resource or action.

    Tool Count4/5

    19 tools is slightly above the ideal 3-15 range, but the server covers a broad domain: data retrieval, analytics, auth, profile, and demo. Each tool serves a clear purpose, and the count is justified by the comprehensive feature set without being overwhelming (not 25+).

    Completeness5/5

    The tool surface covers the full lifecycle: connection status, glucose data (now/window), analytics (hypos, daily summary, TIR, meal response), authentication flows (Dexcom OAuth, Libre login), profile management (get/update/onboarding), and demo/quickstart. There are no obvious dead ends; the only missing piece might be a delete-profile tool, but that's a minor gap and profile update covers modification.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers