Dexcom MCP Server

Dexcom MCP Server

A Model Context Protocol (MCP) server that connects Claude to your personal Dexcom CGM (Continuous Glucose Monitor) for assistive diabetes management intelligence.

Category
Visit Server

README

Dexcom MCP Server

A Model Context Protocol (MCP) server that connects Claude to your personal Dexcom CGM (Continuous Glucose Monitor) for assistive diabetes management intelligence.

๐ŸŽฏ Prime Directive

This is a human-in-the-loop assistive intelligence system:

  • โœ… Claude analyzes, reasons, and recommends
  • โœ… User decides and acts
  • โŒ No automation, no control, no silent changes

๐Ÿš€ Features

  • Real-time CGM Data: Fetch current and historical glucose readings
  • Trend Analysis: Analyze patterns, post-meal spikes, and overnight stability
  • Event Logging: Track insulin doses, carbohydrate intake, and exercise
  • Adaptive Modeling: Learn how your metabolism behaves over time
  • Predictive Intelligence: Estimate glucose impact of insulin and carbs
  • Visualizations: Generate charts and AGP (Ambulatory Glucose Profile)
  • Parameter Drift Detection: Identify when your insulin sensitivity changes

๐Ÿ“‹ Prerequisites

  • Node.js 18+
  • Dexcom Developer API credentials (apply here)
  • A Dexcom CGM device actively transmitting data

๐Ÿ”ง Installation

  1. Clone this repository:

    git clone https://github.com/cykj40/dexcom-mcp-server.git
    cd dexcom-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Configure environment variables:

    cp .env.example .env
    

    Edit .env and fill in your credentials:

    • DEXCOM_CLIENT_ID - From Dexcom Developer Portal
    • DEXCOM_CLIENT_SECRET - From Dexcom Developer Portal
    • DEXCOM_REDIRECT_URI - OAuth redirect URI
    • TURSO_DATABASE_URL - Turso database URL for token and glucose persistence
    • DEXCOM_ACCESS_TOKEN / DEXCOM_REFRESH_TOKEN - Optional one-time bootstrap only when Turso has no tokens
  4. Build the project:

    npm run build
    

๐ŸŽฎ Usage

Running the Server Directly

npm start

Integrating with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "dexcom": {
      "command": "node",
      "args": ["/absolute/path/to/dexcom-mcp-server/dist/index.js"],
      "env": {
        "DEXCOM_CLIENT_ID": "your_client_id",
        "DEXCOM_CLIENT_SECRET": "your_client_secret",
        "DEXCOM_REDIRECT_URI": "your_redirect_uri",
        "TURSO_DATABASE_URL": "libsql://your-db.turso.io",
        "TURSO_AUTH_TOKEN": "your_turso_auth_token"
      }
    }
  }
}

Restart Claude Desktop, and you'll have access to all Dexcom tools.

๐Ÿ› ๏ธ Available Tools

Glucose Reading Tools

  • get_latest_glucose - Get current glucose with trend
  • get_glucose_range - Get readings within a time range
  • get_daily_summary - Daily glucose statistics
  • get_glucose_statistics - Comprehensive stats for any period

Analysis Tools

  • analyze_trends - Analyze patterns over days/weeks
  • compare_expected_vs_actual - Compare predictions to reality
  • detect_parameter_drift - Identify if ISF/ICR has changed

Event Logging Tools

  • log_insulin - Log insulin dose
  • log_carbs - Log carbohydrate intake
  • log_exercise - Log physical activity
  • get_event_timeline - View all events with glucose context

Chart Tools

  • generate_chart - Create visualizations (timeline, daily, weekly, AGP)

Modeling Tools

  • get_baseline_parameters - View your ISF, ICR, and basal dose
  • predict_glucose_impact - Predict effect of insulin or carbs
  • get_adaptive_insights - See how predictions compare to reality

๐Ÿ“Š Database

All data is stored locally in SQLite at ./data/dexcom.db:

  • Glucose readings (from Dexcom API and Share API)
  • Insulin, carb, and exercise events
  • Adaptive observations (expected vs actual outcomes)

No data is shared with third parties.

๐Ÿ”’ Security

  • Environment variables only: Never hardcode credentials
  • Local storage: All data stays on your machine
  • OAuth 2.0: Uses official Dexcom Developer API
  • Read-only device access: Cannot modify pump settings

๐Ÿฅ Medical Disclaimer

This is an assistive tool, not medical advice.

  • All recommendations are based on your personal data
  • You are the final authority on all diabetes management decisions
  • Never rely solely on this tool for treatment decisions
  • Consult your healthcare provider before changing insulin doses
  • This is not FDA-approved medical software

๐Ÿงช Development

Run in Development Mode

npm run dev

Build

npm run build

Project Structure

dexcom-mcp-server/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ config/         # Environment validation
โ”‚   โ”œโ”€โ”€ db/             # SQLite database layer
โ”‚   โ”œโ”€โ”€ services/       # Business logic
โ”‚   โ”œโ”€โ”€ tools/          # MCP tool definitions
โ”‚   โ”œโ”€โ”€ types/          # TypeScript types
โ”‚   โ””โ”€โ”€ index.ts        # Server entrypoint
โ”œโ”€โ”€ data/               # SQLite database (gitignored)
โ””โ”€โ”€ dist/               # Compiled JavaScript

๐Ÿ“ License

ISC License - See LICENSE file for details

๐Ÿค Contributing

This is a personal diabetes management tool. If you'd like to adapt it for your own use:

  1. Update baseline parameters in src/types/index.ts
  2. Adjust target ranges if needed
  3. Modify modeling algorithms to match your physiology

๐Ÿ“ง Support

For issues or questions, please open a GitHub issue.


Remember: This tool learns from your patterns but never acts autonomously. You decide, you act, you control.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured