Nightscout MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NIGHTSCOUT_URL | Yes | Your Nightscout instance URL | |
| NIGHTSCOUT_TOKEN | No | Read token (recommended) | |
| NIGHTSCOUT_UNITS | No | Glucose units: mmol/L or mg/dL | mmol/L |
| NIGHTSCOUT_LOCALE | No | Language: en, uk | en |
| NIGHTSCOUT_READONLY | No | Set false to enable write operations | true |
| NIGHTSCOUT_API_SECRET | No | Or API secret (hashed automatically) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_current_glucoseA | Get the current (latest) glucose value with trend direction, delta from previous reading, and how old the reading is. Always call this first to understand the current state. |
| get_glucose_historyA | Get glucose reading history for a specified time period. Returns SGV values with timestamps and trend directions. Use 'hours' for simple lookback or 'dateFrom'/'dateTo' for precise ranges. |
| get_statisticsA | Calculate glucose statistics: Time in Range (TIR), average glucose, estimated HbA1c, standard deviation (SD), coefficient of variation (CV), and time in various ranges. Essential for understanding overall glucose control quality. |
| get_treatmentsA | Get treatment records: insulin boluses, carb entries, notes, exercise logs, temp basals, and more. Use to understand insulin and carb history for analysis. |
| get_profileA | Get the active Nightscout profile: insulin sensitivity factor (ISF), insulin-to-carb ratio (ICR), basal rates, target glucose ranges, and DIA. Useful for understanding pump/loop settings. |
| get_device_statusA | Get device status: pump reservoir/battery, sensor info, loop status, active IOB (insulin on board), COB (carbs on board), and predictions. Shows the current state of the diabetes management system. |
| get_daily_reportA | Generate a comprehensive daily report: glucose stats (min/max/avg/TIR), all treatments (insulin, carbs, notes), time in ranges, and notable events. Perfect for daily review. |
| detect_patternsA | Analyze glucose data over multiple days to detect recurring patterns: overnight lows, dawn phenomenon, post-meal spikes, time-of-day trends, and day-to-day variability. Requires at least 3 days of data. |
| add_treatmentA | Add a treatment entry to Nightscout: insulin bolus, carbs, note, exercise, site change, etc. Requires NIGHTSCOUT_READONLY=false. Returns the created entry for confirmation. |
| add_noteA | Quickly add a timestamped note to Nightscout. Useful for logging meals, activities, symptoms, or any context. Requires NIGHTSCOUT_READONLY=false. |
| compare_periodsA | Compare glucose statistics between two time periods side by side. Use for: training vs rest days, this week vs last week, before vs after medication changes, weekdays vs weekends. Returns TIR, average, SD, CV, HbA1c, and time-in-ranges for both periods with deltas. |
| find_eventsA | Search treatment entries by text in notes or by event type. Use to answer: 'when did I last change my sensor?', 'show all coffee entries', 'find exercise logs this week'. Searches up to 30 days of history. |
| glucose_at_timeA | Get the glucose reading closest to a specific point in time. Returns the nearest reading within a configurable window, plus surrounding context (readings before and after). Use for: 'what was my glucose at 3 AM?', 'glucose when I woke up yesterday'. |
| analyze_mealA | Automatically analyze post-meal glucose response. Finds the meal bolus/carbs entry, tracks glucose before, during, and after the meal. Calculates: pre-meal glucose, peak value, time to peak, rise amount, time to return to range. Assesses bolus adequacy. |
| overnight_analysisA | Detailed overnight glucose analysis: stability, trend direction, min/max with timestamps, dawn phenomenon detection, time in range, and basal adequacy assessment. Analyzes from evening to morning. |
| export_csvA | Export glucose data (and optionally treatments) as CSV text. Useful for sharing with healthcare providers, importing into spreadsheets, or further analysis. Returns CSV as text content. |
| a1c_estimatorA | Estimate future HbA1c based on current CGM data and optional last lab result. Uses GMI from recent data weighted with historical HbA1c decay. Useful before lab visits to set expectations. |
| weekly_comparisonA | One-call comparison of this week vs last week. Automatically calculates both periods and returns side-by-side stats: TIR, average, CV, HbA1c, time-in-ranges with improvement indicators. No parameters needed. |
| insulin_sensitivity_checkA | Analyze real-world insulin sensitivity by tracking correction boluses and their glucose impact. Compares actual ISF from data with profile ISF to detect if settings need adjustment. Requires at least 3 days with correction events. |
| carb_ratio_checkA | Analyze real-world carb ratios by evaluating meal boluses and their post-meal glucose impact. Compares actual ICR effectiveness vs profile settings. Identifies if you're under- or over-bolusing for meals. |
| compression_low_analysisA | Detect probable compression lows (false low readings caused by lying on the CGM sensor). Identifies characteristic patterns: sudden drop during sleep hours, quick V-shaped recovery without treatment, readings that seem too low for the context. Helps distinguish real lows from sensor artifacts. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| daily_review | Analyze today's glucose data — trends, time in range, notable events |
| meal_analysis | Analyze how a recent meal affected glucose levels |
| weekly_summary | Weekly glucose report with trends and recommendations |
| optimization_advice | Suggest improvements to diabetes management settings |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| nightscout-status | |
| nightscout-profile |
TDQS
Scored across 21 tools
Most tools have a distinct resource type (glucose, treatments, profile, device), but the analytics cluster overlaps: weekly_comparison vs compare_periods, get_statstics vs get_daaily_report, and detect_paterns vs overnight_analysis cover similar ground. Descriptions reduce ambiguity, but an agent could still misselect between comparison/statistics tools.
The majority of names follow a readable snake_case get_/analyze_/compare_ verb pattern, with clear nouns. Minor deviations like weekly_comparison, glucose_at_time, and a1c_estimator omit a verb, but the overall naming is predictable and easy to scan.
21 tool is on the heavy side for an MCP server, especially with many single-purpose analysis tools such as carb_ratio_check, insulin_sensitivity_check, and compression_low_analysis. It is not wildly bloated, but several routines could has been consolidated without hurting the server's utility.
The set covers current glucose, history, treatments, profile/device status, reporting, pattern detection, meal/overnight analysis, CSV export, and adding treatments/notes, so the main Nightscout workflows have no dead ends. Minor gaps include no update/delete for treatments/notes and no dedicated event-type filtering beyond find_events.