Skip to main content
Glama
MeirKaD

Dexcom + Carb Search

by MeirKaD
README.md
# Dexcom + Carb Search

A tool that helps people with diabetes make informed decisions by bringing together real-time glucose data and nutritional information.

## What This Does

This service connects to two essential data sources:

1. **Your Dexcom glucose monitor** - Retrieves your current blood glucose reading and trend information
2. **Nutritional search** - Finds carbohydrate content for foods you're considering eating

By combining these capabilities, it provides a clearer picture for managing blood sugar levels throughout the day.

## Who This Is For

This tool is designed for individuals managing diabetes who:
- Use Dexcom continuous glucose monitoring systems
- Want quick access to their glucose data alongside nutritional information
- Prefer having relevant health data available in one place

## How It Works

The service integrates with the Dexcom Share platform to access your glucose readings and uses web search to find carbohydrate information for specific foods. All data is retrieved on-demand when requested.

**Privacy Note**: Your Dexcom credentials are stored securely in your session configuration and are only used to authenticate with Dexcom's official servers.

## Setup Requirements

You'll need:
- An active Dexcom account with Share enabled
- A Bright Data API key for nutritional search functionality
- A Smithery account for deployment

## Getting Started

### Local Development

1. Start the development server:
   ```bash
   uv run dev
   ```

2. Test the tools interactively:
   ```bash
   uv run playground
   ```

### Configuration

The service requires four credentials:
- **Dexcom username** - Your Dexcom account email
- **Dexcom password** - Your Dexcom account password
- **Dexcom region** - Either "us" (United States) or "ous" (Outside US)
- **Bright Data API key** - For web search functionality

These can be configured either:
- Through Smithery session settings (recommended for deployment)
- As environment variables for local testing
- As parameters when calling the tools directly

## Available Capabilities

### Read Blood Glucose
Retrieves your most recent glucose reading from Dexcom, including:
- Current blood glucose level (mg/dL)
- Trend direction (rising, falling, steady)
- Timestamp of the reading

### Search Carbs
Finds carbohydrate information for specific foods by searching Google. Simply provide the food name, and the tool returns relevant nutritional data from multiple sources.

## Deployment

To make this service available through Smithery:

1. Create a GitHub repository:
   ```bash
   git init
   git add .
   git commit -m "Initial commit"
   git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
   git push -u origin main
   ```

2. Deploy to Smithery at [smithery.ai/new](https://smithery.ai/new)

3. Configure your Dexcom credentials and Bright Data API key in the Smithery session settings

## Technical Details

Built using:
- [Smithery CLI](https://smithery.ai/docs/getting_started/quickstart_build_python) for MCP server deployment
- Dexcom's official Python SDK ([pydexcom](https://github.com/gagebenne/pydexcom))
- Bright Data API for web search
- FastMCP framework for tool definitions

Server implementation: [bg_server.py](src/bg_server.py)

## Support

For issues or questions about this implementation, please file an issue in this repository.

For Dexcom-related questions, consult [Dexcom Support](https://www.dexcom.com/support).