Project Info
Inspiration
Living with diabetes means juggling between multiple tasks everyday from checking glucose levels to calculating carbs to giving right dosing of insulin, all while trying to live normally. We thought, what if instead of using complex apps and manual tracking, you could simply text your phone like you're talking to a friend, and get instant, intelligent help with your diabetes management?
What it does
Sweet lets users manage diabetes through conversational text messages with an AI assistant. The AI analyzes meals, monitors glucose levels, and calculates insulin doses using real-time data integration. Users text the Poke AI to get instant health insights, and the system learns patterns over time to provide personalized recommendations. Real-time Dexcom CGM integration AI-powered meal analysis from photos Personalized insulin dose calculations Glucose pattern tracking based on food/activity and send alerts when needed SMS-based conversational interface
How we built it
Sweet is built as an MCP (Model Context Protocol) server that integrates multiple APIs and AI services: FastMCP Framework: Used FastMCP as the foundation for our MCP server, enabling seamless integration with Poke's conversational interface Dexcom Integration: Connected to Dexcom's Share API for real-time CGM data retrieval and glucose trend analysis AI-Powered Intelligence: Integrated Gemini API for NLP, food recognition, and personalized nutrition analysis SMS Communication: Implemented Twilio for reliable text message alerts in an urgent situation Python Backend: Built custom modules for insulin calculation algorithms, carb ratio management, and pattern recognition logic
Challenges we ran into
MCP Learning Curve: First-time developers struggling with Model Context Protocol architecture and tool structuring Stateless Communication: Managing HTTP requests without persistent state for real-time health data Multi-API Coordination: Synchronizing Dexcom, Gemini, and Twilio APIs in a single conversational flow Medical Data Reliability: Ensuring accurate, safe handling of critical health information under all conditions. (Our tool is still in its early stages, so insulin dosage and macros predictions may not yet be fully reliable.) Dexcom API Complexity: Navigating between Sandbox and Share APIs, understanding authentication flows, and parsing complex glucose data structures
Accomplishments we're proud of
Seamless Multi-API Integration: Successfully unified Dexcom, Gemini AI, and Twilio into the MCP server Natural Conversation Interface: Transformed complex diabetes management into simple text-based interactions Adaptive Pattern Learning: Created a system that learns and personalizes to individual users over time Real Impact Potential: Built something that could genuinely reduce the daily burden of diabetes management
What we learned
We learned that working with healthcare data requires serious responsibility. Even a tiny mistake can have big consequences. Our goal is to build something that genuinely helps people, but safety always comes first. Creating our first healthcare MCP taught us how important it is to spot patterns and use context, so our tool can truly support users where it matters.
What's next
Multi-Platform Expansion: Bring Sweet to Discord, Slack, WhatsApp, and native mobile apps Predictive Intelligence: ML-powered glucose forecasting and smart meal database that learns from users Clinical Integration: Web dashboard with comprehensive weekly/monthly reports for patients, healthcare provider access. Connect Poke with closed loop insulin pump for insulin dosage automation. Community Platform: Enable users to share interesting use cases and strategied they find while using the chat interface. Disclaimer: Sweet is still in development. While real-time glucose data is pulled from your sensor, macro tracking and insulin dosage suggestions are early-stage and may not be fully reliable. Please do not rely on these features for critical decisions.
Sweet by Metabolic Company of CalHacks
Manage diabetes from your textbox
Features:
- π Dexcom Integration - Real-time glucose monitoring with trend analysis and historical data
- π AI Food Analysis - Smart nutrition breakdown with personalized tips using Gemini AI
- π Insulin Calculator - Precise dosing based on carbs and glucose with safety checks (keep in mind this is a fun hack, dont take it too seriosly: at least for now.)
- π Pattern Learning - Track meals and glucose responses for personalized recommendations
- π¨ Smart Alerts - Background monitoring with AI-generated suggestions for high/low glucose
- π€ MCP Server - Works seamlessly with Poke AI assistant through conversational text
π» Start:
Prerequisites
- Dexcom Account (username and password)
- Gemini API Key
- Python 3.8+
- Ngrok account (for exposing local server)
Setup
-
Clone the repository
git clone <repository-url> cd sweet -
Set up Python environment
cd mcp python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt -
Configure environment variables Create a
.envfile in themcp/directory:DEXCOM_USERNAME=your_dexcom_userame DEXCOM_PASSWORD=your_dexcom_password DEXCOM_REGION=your_region # Options: us, ous, jp (us=United States, ous=Outside US, jp=Japan) GEMINI_API_KEY=your_gemini_api_key # Server Configuration PORT=8000 ENVIRONMENT=development -
Start the MCP server
cd mcp/src python server.py -
Expose server via Ngrok In a new terminal:
ngrok http 8000Copy the HTTPS URL (e.g.,
https://randommonkey.ngrok-free.app)
Connecting to Poke
-
Configure Poke MCP Integration
In your Poke dashboard, add the Sweet MCP server:
- Go to your Poke MCP integration settings
- Add your ngrok URL (e.g.,
https://randommonkey.ngrok-free.app/mcp) as the server endpoint - This allows Poke to communicate with your running Sweet server
-
Start using Sweet!
Simply text Poke on your phone with messages like:
- "What is my current glucose level?"
- "I'm having this meal, could you please analyze the macros based on the description/image?"
- "How much insulin should i be taking for this meal?"
- "Analyze my glucose levels starting this morning, what meal has affected me the most?"
Sweet can do much more, your imagination is the limit.
Available tools
Main Functions:
get_current_glucose()- Get real-time glucose reading from Dexcom CGManalyze_food(food_description)- AI-powered nutrition analysis with personalized tipscalculate_insulin_dose(carb_grams, ...)- Calculate insulin dose based on carbs and glucosetrack_meal_context(food, carbs, insulin, glucose)- Log meals for pattern learningstart_glucose_alerts(thresholds)- Begin background glucose monitoring with AI alertsget_diabetes_management_summary()- Get comprehensive diabetes management overview
Wohoo have a sweet life π
Disclaimer: Sweet is still in development. While real-time glucose data is pulled from your sensor, macro tracking and insulin dosage suggestions are early-stage and may not be fully reliable. Please do not rely on these features for critical decisions.
Analysis
View
Metric
- 11
- 10
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- PythonIn code
1 of 1 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
70 KB
Source files
11
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
hemanthkapa/Sweet
14 files Β· 75 KB Β· @ 7149371
Structure
Application logic
5 files Β· 36%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here β open the file browser to check anything the diagram implies.
Languages
- Python92%
- Markdown8%
- YAML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
mcp/requirements.txt
pypi Β· 7- fastmcp
- google-generativeai
- pydexcom
- python-dotenv
- requests
- twilio
- uvicorn
Declared in the repositoryβs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
FastMCP framework foundationVerified
Used FastMCP as the foundation for the MCP server
Claimed on Devposthigh confidencemcp/src/server.py:5β from fastmcp import FastMCP, and mcp = FastMCP(...) with @mcp.tool decorators throughout the file
Personalized insulin dose calculationsVerified
Insulin Calculator: precise dosing based on carbs and glucose with safety checks
Claimed on readmehigh confidencemcp/src/server.py:318β calculate_insulin_dose() implements carb ratio, correction factor (500/1800 rules), and explicit safety warnings for high/low glucose
Real-time Dexcom CGM integrationVerified
Real-time Dexcom CGM integration with trend analysis and historical data
Claimed on readmehigh confidencemcp/src/server.py:65β get_current_glucose() uses pydexcom.Dexcom to fetch live glucose readings with trend datamcp/src/server.py:259β get_glucose_readings() fetches historical readings for a time range via Dexcom Share API
Smart alerts for high/low glucoseVerified
Smart Alerts: background monitoring with AI-generated suggestions for high/low glucose, sends SMS in urgent situations
Claimed on readmehigh confidencemcp/src/glucose_monitor.py:112β _monitor_loop polls Dexcom on an interval, compares against low/high thresholds, calls Gemini for a suggestion, and triggers notifications.send_glucose_alert with cooldown logicmcp/src/notifications.py:217β send_glucose_alert formats and sends the alert via Twilio SMS (or dry-run fallback) to configured recipients
SMS-based conversational interface via Poke/MCPVerified
SMS-based conversational interface; MCP server works seamlessly with Poke AI assistant
Claimed on Devposthigh confidencemcp/src/server.py:33β FastMCP("ilovesugar MCP Server") exposes all tools over MCP/HTTP for Poke to call; test_poke_connection tool exists explicitly for Poke connectivity checksmcp/src/server.py:674β mcp.run() serves via HTTP transport, matching the README's ngrok-exposed MCP endpoint setup for Poke
Twilio SMS alertingVerified
Implemented Twilio for reliable text message alerts in urgent situations
Claimed on Devposthigh confidencemcp/src/notifications.py:133β _twilio_client_or_none constructs a twilio.rest.Client and send_sms_to_all uses client.messages.create to send real SMS when credentials are configuredmcp/requirements.txt:7β twilio>=9.2.3 is declared as a dependency
AI-powered meal analysis from photosCode-supported
AI-powered meal analysis from photos using Gemini
Claimed on Devpostmedium confidencemcp/src/server.py:166β analyze_food() only accepts a text food_description string passed to Gemini; no image/photo upload or base64 handling found anywhere in mcp/src
Gemini API integration for NLP/nutrition analysisCode-supported
Integrated Gemini API for NLP, food recognition, and personalized nutrition analysis
Claimed on Devpostmedium confidencemcp/src/server.py:9β google.generativeai is configured and used in analyze_food() for text-based nutrition analysis, but 'food recognition' (image-based) is not implemented, only text description parsing
Glucose pattern tracking / pattern learningCode-supported
Glucose pattern tracking based on food/activity; adaptive pattern learning that personalizes over time
Claimed on Devpostmedium confidencemcp/src/diabetes_context.py:92β track_meal_with_context/log_glucose_response/analyze_meal_patterns/learn_from_outcome only build text prompts telling Poke (external AI) to remember and analyze patterns; there is no local database or persistent storage of meal/glucose history in this repo, so actual learning happens outside this codebase, if at all
Clinical web dashboard / provider reportsClaimed only
What's next: web dashboard with weekly/monthly reports, healthcare provider access, closed-loop insulin pump integration
Claimed on Devposthigh confidenceMulti-platform expansion (Discord, Slack, WhatsApp, mobile)Claimed only
What's next: bring Sweet to Discord, Slack, WhatsApp, and native mobile apps
Claimed on Devposthigh confidencePredictive ML glucose forecastingClaimed only
What's next: ML-powered glucose forecasting and smart meal database
Claimed on Devposthigh confidence
An AI agent derived these features from the projectβs Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.