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.
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
-
Clone this repository:
git clone https://github.com/cykj40/dexcom-mcp-server.git cd dexcom-mcp-server -
Install dependencies:
npm install -
Configure environment variables:
cp .env.example .envEdit
.envand fill in your credentials:DEXCOM_CLIENT_ID- From Dexcom Developer PortalDEXCOM_CLIENT_SECRET- From Dexcom Developer PortalDEXCOM_REDIRECT_URI- OAuth redirect URITURSO_DATABASE_URL- Turso database URL for token and glucose persistenceDEXCOM_ACCESS_TOKEN/DEXCOM_REFRESH_TOKEN- Optional one-time bootstrap only when Turso has no tokens
-
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 trendget_glucose_range- Get readings within a time rangeget_daily_summary- Daily glucose statisticsget_glucose_statistics- Comprehensive stats for any period
Analysis Tools
analyze_trends- Analyze patterns over days/weekscompare_expected_vs_actual- Compare predictions to realitydetect_parameter_drift- Identify if ISF/ICR has changed
Event Logging Tools
log_insulin- Log insulin doselog_carbs- Log carbohydrate intakelog_exercise- Log physical activityget_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 dosepredict_glucose_impact- Predict effect of insulin or carbsget_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:
- Update baseline parameters in
src/types/index.ts - Adjust target ranges if needed
- 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。