MCP Nightscout
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP NightscoutWhat is my current glucose level?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Nightscout
An MCP (Model Context Protocol) server that connects AI assistants to Nightscout — the open-source CGM remote monitoring platform for Type 1 Diabetes management.
Built with FastMCP, this server exposes Nightscout data as MCP tools, enabling AI assistants like Claude to read glucose data, analyze patterns, log treatments, and more.
Features
Glucose Monitoring
get_current_glucose — latest CGM reading with value, trend arrow, and device info
get_recent_glucose — recent readings (default: last 3 hours)
get_glucose_by_date_range — readings for a specific date range
Analytics
calculate_time_in_range — TIR stats with breakdown (in range, below, above, very low, very high), estimated A1C, and coefficient of variation
get_daily_glucose_stats — daily stats with hourly averages
analyze_glucose_patterns — multi-day pattern analysis to identify recurring highs/lows by time of day
Treatments
get_recent_treatments — recent insulin boluses, carb entries, temp basals, notes
get_treatments_by_date — treatments for a specific date range
log_treatment — log a new treatment (bolus, carbs, exercise, note, etc.)
remove_treatment — delete a treatment by ID
Device & Profile
get_insulin_on_board — current IOB from loop/pump device status
get_latest_device_status — pump status, loop decisions, CGM status
server_status — Nightscout server version, plugins, thresholds, units
get_current_profile — basal rates, ISF, IC ratios, target BG, DIA
update_nightscout_profile — update profile settings
Related MCP server: T1D Manager
Quick Start
1. Clone and configure
git clone https://github.com/easyweek/mcp-nightscout.git
cd mcp-nightscout
cp .env.example .envEdit .env with your Nightscout instance details:
NIGHTSCOUT_URL=https://your-nightscout.example.com
NIGHTSCOUT_TOKEN=your-readable-token
MCP_AUTH_TOKEN=your-secret-mcp-token2. Run with Docker
docker compose up --buildThe server starts on http://localhost:8000.
3. Connect to Claude
Claude Code (CLI)
Add to your MCP settings:
{
"mcpServers": {
"nightscout": {
"type": "http",
"url": "http://localhost:8000/mcp",
"headers": {
"Authorization": "Bearer your-secret-mcp-token"
}
}
}
}Claude.ai (remote)
When deployed to a public URL, connect using the token-in-path format:
https://your-server.example.com/mcp/your-secret-mcp-tokenAuthentication
The server supports two auth modes for MCP clients:
Method | Format | Use case |
Bearer header |
| Claude Code CLI |
Token in path |
| Claude.ai connectors |
The /health endpoint is always open (no auth required).
Set MCP_AUTH_TOKEN to enable authentication. If unset, the server runs without auth (suitable for local development only).
Nightscout Authentication
Connect to your Nightscout instance using either:
API secret (
NIGHTSCOUT_API_SECRET) — SHA1 hash of your plaintext secret:echo -n "your-secret" | shasum -a 1 | awk '{print $1}'Readable token (
NIGHTSCOUT_TOKEN) — created in Nightscout Admin Tools
Development
Run locally (without Docker)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn src.server:app --host 0.0.0.0 --port 8000 --log-config src/log_config.yamlRun tests
pip install pytest pytest-asyncio
pytest tests/Project structure
src/
server.py # MCP tools, auth middleware, health endpoint
nightscout_client.py # HTTP client for Nightscout REST API v1
log_filter.py # Filters /health from access logs
log_config.yaml # JSON logging configuration
tests/
test_auth.py # Auth middleware testsAdding a new tool
Add the API call to
src/nightscout_client.pyif neededAdd a
@mcp.tool()function insrc/server.pywith a clear docstringTest with
docker compose up --build
Environment Variables
Variable | Required | Default | Description |
| Yes | — | Nightscout instance base URL |
| No* | — | API secret (SHA1 hash) |
| No* | — | Readable token |
| No |
| Request timeout in seconds |
| No | — | MCP server auth token |
* One of NIGHTSCOUT_API_SECRET or NIGHTSCOUT_TOKEN is required.
License
MIT — Copyright (c) 2026 EasyWeek GmbH
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/easyweek/mcp-nightscout'
If you have feedback or need assistance with the MCP directory API, please join our Discord server