dexcom-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dexcom-mcp What's my current glucose and how much time have I been in range today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dexcom-agent-tools
An MCP server and an agent skill that let an AI agent read and analyze your Dexcom CGM data.
MCP server (
dexcom-mcp, stdio) exposes these tools:get_current_glucose: the latest reading, its trend arrow, and its age in minutesget_glucose(start, end): readings between two ISO 8601 timestamps, within the last 24 hoursget_glucose_stats(start, end, target_low_mg_dl, target_high_mg_dl): mean, SD, CV, GMI, min/max, and the percentage of time in, below, and above range (TIR/TBR/TAR). Defaults to a 70–180 mg/dL range.
Skill
skills/analyze-glucose-patterns: tells an agent how to call these tools and explain your patterns in plain language.
The backend is Dexcom Share, which updates in near real time, through pydexcom. It supports the US, outside-US (ous), and Japan (jp) regions, and reports in mg/dL (the default) or mmol/L.
⚠️ Disclaimer. This is not a medical device. The Dexcom Share API is unofficial and undocumented, and it can change or break without notice. Data can be delayed, missing, or wrong. Don't make treatment or dosing decisions from this. Use your receiver, the Dexcom app, or a fingerstick. Dexcom's official OAuth API is about 1 hour delayed in the US and isn't supported in v1.
Prerequisites
In the Dexcom app, turn on Share and invite at least one follower. If nobody follows you, the Share API returns no data.
Use your own Dexcom account username (or email) and password. A follower's own login doesn't work.
Install Python 3.10+ and uv. Plain pip also works.
Related MCP server: Dexcom G7 MCP Server
Setup
cd ~/Projects/dexcom-agent-tools
cp .env.example .env # then fill in DEXCOM_USERNAME / DEXCOM_PASSWORD
uv sync --extra dev # or: python -m venv .venv && . .venv/bin/activate && pip install -e '.[dev]'Environment variables
Credentials are read only from the environment. The server doesn't load .env itself. Export the variables, or pass them through your MCP client config.
Variable | Default | Notes |
| (required) | Dexcom account username, email, or phone ( |
| (none) | Optional. Use this instead of the username. |
| (required) | |
|
|
|
|
|
|
|
| Stats range, always in mg/dL |
|
| Set to |
Run
# Check the config without starting the server (exits 2 with a clear message if credentials are missing)
set -a; . ./.env; set +a
uv run dexcom-mcp --check
# Try it with fake data
DEXCOM_DRY_RUN=1 uv run dexcom-mcp --check
# Run the MCP server on stdio (normally your MCP client starts it)
uv run dexcom-mcp # or: uv run python -m dexcom_agent_tools
# Tests (no network)
uv run pytest -q
# Interactive inspector (optional)
npx @modelcontextprotocol/inspector uv --directory ~/Projects/dexcom-agent-tools run dexcom-mcpAdd to an MCP client
Cursor: put this in ~/.cursor/mcp.json (global) or in .cursor/mcp.json inside a project. Claude Desktop: put it in ~/Library/Application Support/Claude/claude_desktop_config.json.
{
"mcpServers": {
"dexcom": {
"command": "uv",
"args": ["--directory", "/Users/YOU/Projects/dexcom-agent-tools", "run", "dexcom-mcp"],
"env": {
"DEXCOM_USERNAME": "you@example.com",
"DEXCOM_PASSWORD": "…",
"DEXCOM_REGION": "us",
"DEXCOM_UNITS": "mg/dL"
}
}
}
}The JSON file holds your password in plain text, so keep it out of git. Or skip the env block and point command at a small wrapper script that loads the secrets from your keychain.
Claude Code:
claude mcp add dexcom -e DEXCOM_USERNAME=... -e DEXCOM_PASSWORD=... -- \
uv --directory ~/Projects/dexcom-agent-tools run dexcom-mcpInstall the skill
The skill is a plain SKILL.md file with no secrets in it. Copy or symlink it into your agent's skills folder:
# Claude Code (personal skills)
mkdir -p ~/.claude/skills && ln -s ~/Projects/dexcom-agent-tools/skills/analyze-glucose-patterns ~/.claude/skills/
# Cursor / other agents: add skills/analyze-glucose-patterns/SKILL.md as a rule or skillThen ask your agent something like "analyze my glucose patterns from the last 24h" or "how was my overnight?"
Tool details
Times are ISO 8601. A timestamp with no timezone is read as the server's local time. Output times use local time with the UTC offset included.
Share only keeps the last 24 hours at 5-minute intervals (up to 288 readings). A window that reaches back further gets trimmed to 24 hours. A window that ends more than 24 hours ago returns an error.
get_current_glucosefalls back to the newest reading in the last 24 hours. Checkage_minutesto see how stale it is.Stats percentages count readings.
coverage_percentshows how much of the window actually has data.If you need history beyond 24 hours, log the readings locally or add the official API later (open item for v2).
Layout
src/dexcom_agent_tools/
config.py # env settings, unit conversion
source.py # Dexcom Share client (pydexcom) + synthetic dry-run source
stats.py # TIR/TBR/TAR, mean, SD, CV, GMI
server.py # MCP tools + CLI (--check)
skills/analyze-glucose-patterns/SKILL.md
tests/License
MIT
Available Tools
3 toolsget_current_glucoseA
Latest CGM glucose reading with trend arrow and how old it is (minutes).
units: "mg/dL" or "mmol/L" (defaults to DEXCOM_UNITS, else mg/dL).
Inputs: units.
get_glucoseA
CGM readings (every ~5 min, oldest first) between start and end.
start/end: ISO 8601 timestamps; default is the last 3 hours. Dexcom Share only serves the last 24 hours, so the window is clipped to that. units: "mg/dL" or "mmol/L".
Inputs: end, start, units.
get_glucose_statsA
Summary stats for a window: mean, SD, CV, GMI, min/max, and % time in/below/above range.
start/end: ISO 8601 (default last 24 hours, the Share maximum). Target range defaults to DEXCOM_TARGET_LOW/HIGH (70-180 mg/dL). Thresholds are in mg/dL. Also reports very low (<54) and very high (>250). Percentages are by reading count.
Inputs: end, start, units, target_low_mg_dl, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools target clearly distinct outputs: latest single reading, a range of readings, and aggregate statistics. Defaults and parameters are described well enough to avoid confusion between current and historical data.
All tools use a consistent snake_case get_ prefix followed by glucose-related nouns. The pattern is predictable and readable.
Three tools are well-scoped for a read-only CGM data server, with each tool covering a distinct retrieval need. No unnecessary tools are present.
The core read-only surface is covered: current reading, historical range, and summary statistics. Minor gaps exist around connection/account status or target-range introspection, but agents can work around them via environment defaults.
Maintenance
Related MCP Connectors
Your Apple Health data, food diary and lifts, for ChatGPT, Claude and Gemini. Approved on iPhone.
Your own SLATE health data in your AI assistant: read, trend, plan and log. Never suggests a dose.
Glucose readings from your LibreLink Up sensor: graph, logbook, stats and summaries (read-only). Sec
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to query glucose data from health storage APIs, providing natural language access to glucose readings, trends, and statistics for diabetes management and health monitoring.3MIT
- FlicenseNot gradedqualityDmaintenanceProvides access to Dexcom G7 continuous glucose monitor data, enabling AI assistants to retrieve current glucose readings and historical data.14-
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Nightscout for real-time glucose monitoring, analysis, and treatment logging, enabling natural language interaction with CGM data.7MIT
- FlicenseNot gradedqualityDmaintenanceEnables reading real-time continuous glucose monitor data from Dexcom sensors via the Share API, allowing Claude to access glucose levels, trends, and statistics.-