Dexcom MCP Server
Uses Turso as a remote database for storing Dexcom access tokens and glucose data for persistence across sessions.
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 ServerWhat's my latest glucose reading?"
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 MCP Server
MCP (Model Context Protocol) server that connects an MCP host (such as Claude Desktop) to personal Dexcom CGM data for human-in-the-loop glucose analysis, event logging, and modeling. The host can analyze and recommend; you decide and act. This project does not automate insulin delivery or change pump settings.
Features
Glucose tools — latest reading, ranges, daily summaries, and statistics
Trend analysis — patterns over days/weeks, expected vs actual, parameter-drift signals
Event logging — insulin, carbs, and exercise, plus timeline / per-type retrieval
Charts — timeline, daily, weekly, and AGP-style visualizations
Modeling — baseline ISF/ICR/basal parameters, impact predictions, adaptive insights
Transports —
stdio(local MCP hosts) orhttp(remote connector with OAuth 2.1 + PKCE)
Related MCP server: Garmin MCP Server
Requirements
Node.js 18+ (Docker image uses Node 20)
Dexcom Developer API credentials (developer.dexcom.com)
A Dexcom CGM account with data available via the Developer API
A Turso database (OAuth tokens and persisted readings/events)
Optional: Dexcom Share username/password as a best-effort fallback when the Developer API path fails.
Quick start (local / stdio)
1. Clone and install
git clone https://github.com/cykj40/dexcom-mcp-server.git
cd dexcom-mcp-server
npm install2. Configure environment
cp .env.example .envSet at least:
Variable | Required | Purpose |
| Yes | Dexcom OAuth client ID |
| Yes | Dexcom OAuth client secret |
| Yes | Must match the app redirect (e.g. |
| Yes | Turso |
| Yes | Turso auth token |
| No |
|
| No |
|
| No | IANA timezone for daily buckets (default UTC) |
Optional (stdio / bootstrap):
Variable | Purpose |
| One-time bootstrap only if Turso has no tokens yet |
| Share API fallback |
When TRANSPORT=http, also set:
Variable | Purpose |
| MCP connector client credentials |
| Exact callback URLs, comma-separated |
| Canonical HTTPS origin (no trailing slash) |
| SHA-256 hex digest of your owner approval key |
| Legacy bearer accepted at |
| Listen port (default |
Do not commit .env or any database files.
3. Dexcom OAuth (one-time)
npm run oauthComplete the browser flow so tokens land in Turso (or use the optional bootstrap env vars once). Manual flow: npm run oauth:manual.
4. Build and run
npm run build
npm startDevelopment:
npm run dev5. Claude Desktop (stdio)
Example claude_desktop_config.json (use absolute paths and your own secrets):
{
"mcpServers": {
"dexcom": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/dexcom-mcp-server/dist/index.js"],
"env": {
"TRANSPORT": "stdio",
"DEXCOM_CLIENT_ID": "your_client_id",
"DEXCOM_CLIENT_SECRET": "your_client_secret",
"DEXCOM_REDIRECT_URI": "http://localhost:3000/callback",
"TURSO_DATABASE_URL": "libsql://your-db.turso.io",
"TURSO_AUTH_TOKEN": "your_turso_auth_token",
"DEXCOM_API_ENV": "production"
}
}
}
}Restart Claude Desktop after saving.
HTTP transport (optional / remote)
With TRANSPORT=http, the server exposes:
/.well-known/oauth-authorization-serverand/.well-known/oauth-protected-resource/authorizeand/token(OAuth 2.1 authorization code + PKCE S256, owner-key approval)Authenticated
/mcpPublic
/health
Operator CLI (after build): node dist/auth/admin.js list and node dist/auth/admin.js revoke <grant-id>.
Prefer stdio for local use. Treat HTTP mode as a high-sensitivity deployment: strong secrets, exact redirect allowlists, HTTPS issuer URL, and private hosting.
Optional deploy config lives in fly.toml (Fly.io). Do not publish live app URLs or secrets in docs.
Available MCP tools
Glucose
get_latest_glucoseget_glucose_rangeget_daily_summaryget_glucose_statistics
Analysis
analyze_trendscompare_expected_vs_actualdetect_parameter_drift
Events
log_insulin,log_carbs,log_exerciseget_event_timelineget_insulin_events,get_carb_events,get_exercise_events
Charts
generate_chart
Modeling
get_baseline_parametersupdate_baseline_parameters(requires explicit confirmation in the tool args; treat as sensitive)predict_glucose_impactget_adaptive_insights
Example prompts (generic)
What's my latest glucose and trend?Summarize yesterday's glucose statistics.Log 5 units of rapid insulin for lunch and 45g carbs.Show an event timeline for the last 24 hours.Predict the glucose impact of 40g of carbs with my current baseline.Data storage
Runtime persistence uses Turso (TURSO_DATABASE_URL / TURSO_AUTH_TOKEN): OAuth tokens, glucose readings, events, and related records. This is a third-party hosted database you control via your Turso account.
Do not commit database files; keep data/ and *.db* gitignored. Prefer keeping the repository private while it holds health-data tooling.
Security notes
Keep credentials in environment variables or a secret store — never in source.
Prefer
TRANSPORT=stdiofor local use.HTTP mode uses OAuth 2.1 + PKCE with owner approval and hashed tokens. Rotate any legacy
MCP_AUTH_TOKENif it may have been exposed, and prefer OAuth grants.This server is assistive and must not be treated as a closed-loop controller.
Review git history before making the repo public: do not leave historical database blobs or secrets reachable.
npm scripts
Script | Purpose |
| Compile TypeScript to |
| Run compiled server |
| Dev watch mode |
| Dexcom OAuth helper |
| Manual code exchange helper |
| Vitest |
| Biome |
| Format with Biome |
Project structure
dexcom-mcp-server/
├── src/
│ ├── auth/ # HTTP OAuth, crypto helpers, grant admin CLI
│ ├── config/ # Env validation
│ ├── db/ # Turso client, migrations, queries, token store
│ ├── services/ # Dexcom API/Share, glucose, events, modeling, charts
│ ├── tools/ # MCP tool registration
│ ├── types/ # Shared types
│ ├── utils/
│ ├── oauth-helper.ts
│ ├── manual-oauth.ts
│ └── index.ts # Entrypoint (stdio / http)
├── test/ # Vitest tests and fixtures
├── .env.example
├── fly.toml # Optional Fly.io deploy config
└── package.jsonKnown limitations / missing information
Share API path is undocumented / best-effort and may be unreliable
Baseline updates currently rely on a caller-supplied confirmation flag — treat compromised clients carefully
Schema may seed placeholder physiology defaults on empty DB; bootstrap intentionally for real use
No CI workflows documented in this README
Health data is sensitive — protect the repo, secrets, remote endpoint, and any clones
Medical disclaimer
Assistive tool only — not medical advice and not FDA-approved medical software.
You are responsible for all treatment decisions. Consult your clinician before changing insulin or other therapy. Never rely solely on this tool for dosing.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that gives Claude access to your WHOOP biometric data — recovery, sleep, strain, and workouts.32 npmMIT
- AlicenseNot gradedqualityDmaintenanceThis Model Context Protocol (MCP) server connects to Garmin Connect and exposes your fitness and health data to Claude and other MCP-compatible clients.1MIT
- AlicenseNot gradedqualityAmaintenanceA Model Context Protocol (MCP) server that brings your Withings health data into Claude, allowing natural conversation access to sleep patterns, body measurements, workouts, heart data, and more.43MIT
- AlicenseAqualityBmaintenanceA Model Context Protocol (MCP) server for Garmin Connect integration. Access your activities, health data, training metrics, and more through Claude and other LLMs.2265MIT