Metadata-Version: 2.4
Name: mcp-server-dexcom-health
Version: 0.1.0
Summary: MCP server for Dexcom CGM glucose data - continuous health intelligence for AI agents
Author-email: Ishaan Sharma <ishaan02@hotmail.com>
License: MIT
Keywords: ai-agents,cgm,dexcom,diabetes,glucose,health,mcp,model-context-protocol
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: mcp[cli]>=1.26.0
Requires-Dist: pydantic>=2.12.5
Requires-Dist: pydexcom>=0.5.1
Description-Content-Type: text/markdown

# mcp-server-dexcom

MCP server for Dexcom CGM glucose data. Enables AI agents to access and analyze continuous glucose monitor data for health intelligence applications.

## Features

- **Real-time glucose monitoring** - Current readings with trend analysis
- **Historical data access** - Up to 24 hours of glucose history
- **Clinical analytics** - Time-in-range, GMI, CV%, AGP reports
- **Episode detection** - Automatic hypo/hyper event identification with detailed context
- **Time-block analysis** - Identify patterns by time of day
- **Persistence layer support** - Pass external data for long-term analysis

## Tools

| Tool | Description |
|------|-------------|
| `get_current_glucose` | Current glucose reading with trend |
| `get_glucose_readings` | Historical readings (up to 24h) |
| `get_statistics` | TIR, CV%, GMI, and other metrics |
| `get_status_summary` | Complete "how am I doing?" summary |
| `detect_episodes` | Find hypo/hyper episodes |
| `get_episode_details` | Deep analysis of each episode |
| `analyze_time_blocks` | Patterns by time of day |
| `check_alerts` | Real-time threshold alerts |
| `export_data` | Export for external storage |
| `get_agp_report` | Clinical AGP report |

## Installation
```bash
# Using uvx (recommended)
uvx mcp-server-dexcom

# Using pip
pip install mcp-server-dexcom
```

## Configuration

Set environment variables:

| Variable | Required | Description |
|----------|----------|-------------|
| `DEXCOM_USERNAME` | Yes | Dexcom username, email, or phone (+1234567890) |
| `DEXCOM_PASSWORD` | Yes | Dexcom password |
| `DEXCOM_REGION` | No | `us` (default), `ous` (outside US), or `jp` (Japan) |

### Claude Desktop

Add to your `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "dexcom": {
      "command": "uvx",
      "args": ["mcp-server-dexcom"],
      "env": {
        "DEXCOM_USERNAME": "your_username",
        "DEXCOM_PASSWORD": "your_password",
        "DEXCOM_REGION": "us"
      }
    }
  }
}
```

## Usage Examples

### Basic usage with Claude

> "What's my current glucose?"

> "How was my overnight control?"

> "Did I have any lows today?"

> "Give me my statistics for the last 12 hours"

### Persistence Layer Integration

Tools that analyze data accept an optional `data` parameter for external data sources:
```python
# Pass your own historical data
result = get_statistics(
    data=[
        {"glucose_mg_dl": 120, "timestamp": "2024-01-15T08:00:00"},
        {"glucose_mg_dl": 135, "timestamp": "2024-01-15T08:05:00"},
        # ... more readings
    ]
)
```

This enables building long-term analytics by storing data externally and passing it back for analysis.

## Requirements

- Python 3.10+
- Active Dexcom Share session (requires Dexcom mobile app with Share enabled)
- At least one follower configured in Dexcom Share

## License

MIT
```

---

## **3. Create `LICENSE`:**
```
MIT License

Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

---

## **4. Create `.gitignore`:**
```
__pycache__/
*.py[cod]
*$py.class
.env
.venv/
dist/
build/
*.egg-info/
.mypy_cache/
.ruff_cache/
```

---

## **5. Final project structure:**
```
mcp-server-dexcom/
├── pyproject.toml
├── README.md
├── LICENSE
├── .gitignore
├── .env              # (not committed)
└── src/
    └── mcp_server_dexcom/
        ├── __init__.py
        └── server.py