cgm-mcp
MCP server bridging AI assistants to a self-hosted Nightscout instance.
endpoint
POST /api/mcp Authorization: Bearer <MCP_BEARER_TOKEN> Content-Type: application/json
tools (14)
get_glucose_recentReturn CGM glucose readings (sgv = serum glucose value, in mg/dL) from the last N hours. Defaults to the last 3 hours. Use for 'what is my glucose right now', 'what's the trend', 'show me the last few readings'.get_glucose_statsAggregate stats over the last N hours: mean, min, max, std dev, and time-in-range percentage. Default range is 70-180 mg/dL (standard CGM TIR). Defaults to last 24 hours.get_loop_statusCurrent Loop algorithm state: insulin on board (IOB), carbs on board (COB), enacted temp basal, latest recommendation, active override, pump reservoir / battery. Reads from the most recent devicestatus from Loop.get_treatmentsTreatment history (boluses, meals, corrections, notes, overrides) from the last N hours. Defaults to last 24 hours.get_predictionsLoop's predicted glucose curve for the next ~6 hours (5-min intervals). Use to answer 'where will my BG be in N minutes' or 'is Loop expecting a low coming?'.get_profileCurrent Nightscout profile: basal rates, carb ratios, insulin sensitivity factors, targets. Read-only view of the active profile.get_statusNightscout server status — version, enabled features, server time. Useful sanity check.log_mealLog a meal as a Carb Correction treatment. Used to tell Loop 'I ate this much carbs at this time' so it can compute COB / bolus. Does NOT issue an actual bolus.log_correction_bolusLog a manual correction bolus that was administered (e.g. user dosed via pen). Records insulin in units. Does NOT command the pump.log_meal_bolusLog a meal bolus that was administered, combining carbs + insulin into a single treatment.log_noteAdd a free-text note to the timeline (no carbs/insulin). Useful for context like 'started exercising', 'feeling low', or arbitrary AI observations.set_temporary_overrideActivate a Loop temporary override by name (must match a preset configured in the Loop app — e.g. 'Exercise', 'Pre-meal', 'Sleep'). Creates a Temporary Override treatment that Loop will pick up.delete_treatmentDelete a treatment by its _id (the one returned in get_treatments). Use carefully — irreversible. Useful for undoing an AI's mistaken log_meal / log_bolus.update_profileReplace the active Nightscout profile (basal rates, ratios, ISF, targets). DESTRUCTIVE — overwrites the entire profile object. Prefer get_profile first, modify the relevant fields, then send back.
connecting
See README.md in the repo for client-specific connection instructions (Claude.ai, Cursor, Grok API, OpenAI MCP).