MCP Glucose Server
Click on "Deploy 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 Glucose Serverwhat's 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 Glucose Server
A Model Context Protocol (MCP) server that provides glucose data query tools to AI assistants like Claude and ChatGPT. Connects to the health-data-storage API to retrieve glucose readings.
π― Purpose
This MCP server acts as a specialized interface between AI assistants and your glucose data. It provides natural language tools for querying glucose levels, trends, and statistics.
Related MCP server: MCP Nightscout
ποΈ Architecture Position
ββββββββββββββββββββββββ
β health-data-storage β
β REST API β
ββββββββββββ¬ββββββββββββ
β HTTP GET
βΌ
ββββββββββββββββ
β mcp-glucose β β YOU ARE HERE
β (MCP Server) β
ββββββββ¬ββββββββ
β MCP Tools
βΌ
βββββββββββββββββ
β Claude/ChatGPTβ
βββββββββββββββββπ§ Available Tools
1. get_glucose_readings
Get glucose readings within a date range.
Parameters:
userId(optional): User identifier (defaults to USER_ID env var)startDate(optional): Start date in ISO 8601 formatendDate(optional): End date in ISO 8601 formatlimit(optional): Maximum number of readings (default: 1000)
Example queries:
"What's my glucose been like today?"
"Show me my glucose readings for the past week"
"Get my glucose levels from October 1st to October 22nd"
2. get_latest_glucose
Get the most recent glucose reading.
Parameters:
userId(optional): User identifier (defaults to USER_ID env var)
Example queries:
"What's my current glucose?"
"What was my last glucose reading?"
"Check my latest blood sugar"
3. get_glucose_stats
Get glucose statistics (count, average, min, max) for a time period.
Parameters:
userId(optional): User identifier (defaults to USER_ID env var)startDate(optional): Start date in ISO 8601 formatendDate(optional): End date in ISO 8601 format
Example queries:
"What's my average glucose this week?"
"Show me my glucose stats for the past month"
"What was my glucose range yesterday?"
π Setup
Prerequisites
Node.js 20+
Access to a deployed
health-data-storageinstanceAPI secret for authentication
Installation
# Install dependencies
npm install
# Build TypeScript
npm run buildConfiguration
Create a .env file (or set environment variables):
STORAGE_API_URL=https://your-storage-api.run.app
API_SECRET=your-api-secret
USER_ID=user@example.com # Optional default userUsage with Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"glucose": {
"command": "node",
"args": ["/path/to/mcp-glucose/build/index.js"],
"env": {
"STORAGE_API_URL": "https://your-storage-api.run.app",
"API_SECRET": "your-api-secret",
"USER_ID": "user@example.com"
}
}
}
}Restart Claude Desktop.
Usage with ChatGPT
(ChatGPT MCP support coming soon)
π¬ Example Conversations
Once configured, you can ask Claude:
Simple queries:
"What's my latest glucose?"
{
"value": 95,
"unit": "mg/dL",
"date": "2025-10-22T10:30:00Z",
"source": "Lingo"
}Time range queries:
"Show me my glucose for the past 24 hours"
{
"count": 48,
"readings": [
{ "value": 95, "unit": "mg/dL", "date": "2025-10-22T10:30:00Z", "source": "Lingo" },
...
]
}Statistical queries:
"What's my average glucose this week?"
{
"count": 336,
"average": 98.5,
"min": 75,
"max": 125,
"unit": "mg/dL"
}Analysis queries:
"Analyze my glucose patterns over the last month"
Claude will use the tools to fetch data and provide intelligent analysis of your glucose trends, patterns, and insights.
π Related Projects
health-data-storage: Storage backend that this server queries
health-tracking-app: iOS app that collects the glucose data
mcp-activity: (future) MCP server for activity/exercise data
mcp-nutrition: (future) MCP server for food/nutrition data
π Future Enhancements
Potential additions:
Trend analysis tools: Detect glucose spikes, patterns
Correlation tools: Compare glucose with meals, exercise
Alert tools: Notify when glucose is out of range
Export tools: Generate reports, charts
Multi-user support: Query data for multiple users
π οΈ Development
Local Testing
# Build
npm run build
# Run (will use stdio transport)
npm startThe server runs on stdio (standard input/output) as per MCP specification. Use it with Claude Desktop or the MCP inspector for testing.
Testing with MCP Inspector
npm install -g @modelcontextprotocol/inspector
npx @modelcontextprotocol/inspector node build/index.jsπ License
MIT
Available Tools
3 toolsget_glucose_readingsC
Get glucose/blood sugar readings for a user within a date range. Returns glucose values in mg/dL with timestamps and sources.
| Name | Required | Description | Default |
|---|---|---|---|
| userId | No | User identifier. Defaults to user_12345abcdef67890 if not specified. | |
| startDate | No | Start date in ISO 8601 format (e.g., 2025-10-01T00:00:00Z). Optional. | |
| endDate | No | End date in ISO 8601 format (e.g., 2025-10-22T23:59:59Z). Optional. | |
| limit | No | Maximum number of readings to return (default: 1000) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns glucose values in mg/dL with timestamps and sources, which is useful. However, it lacks critical behavioral details such as whether this is a read-only operation, any authentication requirements, rate limits, error conditions, or pagination behavior (though the 'limit' parameter hints at this). The description is minimal and does not fully compensate for the absence of annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded, consisting of two sentences that directly state the tool's purpose and return format. There is no wasted text, and it efficiently communicates the core functionality. However, it could be slightly improved by structuring usage guidelines or behavioral details more explicitly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (4 parameters, no annotations, no output schema), the description is partially complete. It covers the basic purpose and return format but lacks details on behavioral traits, usage guidelines, and error handling. The absence of an output schema means the description should ideally explain return values more thoroughly, which it does not. It is adequate but has clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, providing clear details for all parameters (userId, startDate, endDate, limit). The description adds no additional parameter semantics beyond what the schema already documents. According to the rules, with high schema coverage (>80%), the baseline score is 3 when no param info is added in the description, which applies here.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get glucose/blood sugar readings for a user within a date range.' It specifies the verb ('Get'), resource ('glucose/blood sugar readings'), and scope ('for a user within a date range'), but does not explicitly differentiate it from sibling tools like 'get_glucose_stats' or 'get_latest_glucose' beyond implying it returns multiple readings with timestamps.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It mentions date ranges and returns glucose values, but does not specify scenarios where this tool is preferred over 'get_glucose_stats' (which likely provides aggregated statistics) or 'get_latest_glucose' (which likely returns only the most recent reading). No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_glucose_statsA
Get glucose statistics (count, average, min, max) for a user within a date range. Useful for understanding glucose trends and patterns.
| Name | Required | Description | Default |
|---|---|---|---|
| userId | No | User identifier. Defaults to user_12345abcdef67890 if not specified. | |
| startDate | No | Start date in ISO 8601 format. Optional. | |
| endDate | No | End date in ISO 8601 format. Optional. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It implies a read-only operation ('Get') and adds useful context about the purpose ('understanding glucose trends and patterns'), but doesn't disclose behavioral traits like authentication requirements, rate limits, error handling, or what happens if parameters are omitted. The description doesn't contradict annotations (none provided).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized with two sentences: the first states the purpose and parameters, and the second adds contextual value about usage. Every sentence earns its place, and it's front-loaded with the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but has gaps. It covers the purpose and usage context well, but lacks details on behavioral aspects (e.g., authentication, errors) and doesn't explain the return format (statistics structure), which is important since there's no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters (userId, startDate, endDate) with their types and optionality. The description adds marginal value by implying date-range filtering and user-specific statistics, but doesn't provide additional syntax, format details, or examples beyond what the schema specifies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Get glucose statistics') and resource ('for a user within a date range'), listing the exact metrics (count, average, min, max). It distinguishes from sibling tools like 'get_glucose_readings' and 'get_latest_glucose' by focusing on aggregated statistics rather than raw readings or latest values.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context ('Useful for understanding glucose trends and patterns'), indicating when this tool is appropriate. However, it doesn't explicitly state when to use alternatives like 'get_glucose_readings' or 'get_latest_glucose', nor does it mention exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_latest_glucoseA
Get the most recent glucose/blood sugar reading for a user. Returns value, unit, timestamp, and source.
| Name | Required | Description | Default |
|---|---|---|---|
| userId | No | User identifier. Defaults to user_12345abcdef67890 if not specified. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It describes the return format (value, unit, timestamp, source) which is helpful, but doesn't mention authentication requirements, error conditions, rate limits, or whether this is a read-only operation. The description adds some behavioral context but leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is perfectly concise with two sentences that each serve distinct purposes: the first states the tool's function and scope, the second specifies the return format. There's no wasted language, and the information is front-loaded with the core purpose stated immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read operation with one parameter and no output schema, the description provides adequate but minimal information. It explains what data is returned but doesn't cover authentication, error handling, or data freshness. Given the lack of annotations and output schema, more behavioral context would be helpful for a complete understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already fully documents the userId parameter. The description doesn't add any parameter-specific information beyond what's in the schema, but with only one parameter that has complete schema documentation, this is acceptable. The baseline for high schema coverage is 3, but the description's clarity about what the tool does provides good overall context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Get the most recent glucose/blood sugar reading'), identifies the resource ('for a user'), and distinguishes from siblings by specifying it returns only the latest reading rather than multiple readings or statistics. It explicitly mentions what data is returned (value, unit, timestamp, source).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying 'most recent' reading, suggesting this tool should be used when only the latest data point is needed. However, it doesn't explicitly state when to use alternatives like get_glucose_readings (for historical data) or get_glucose_stats (for aggregated metrics), leaving some ambiguity about sibling tool differentiation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
- First observed
get_glucose_readings - First observed
get_glucose_stats - First observed
get_latest_glucose
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: get_glucose_readings retrieves raw readings, get_glucose_stats provides aggregated statistics, and get_latest_glucose fetches the single most recent reading. There is no overlap in functionality, making it easy for an agent to select the appropriate tool based on the specific need.
All tool names follow a consistent verb_noun pattern with 'get_' as the prefix and descriptive nouns (readings, stats, latest_glucose). The naming is uniform, predictable, and enhances readability, ensuring agents can easily understand and use the toolset.
With 3 tools, the server is well-scoped for its glucose monitoring purpose, covering key retrieval operations. However, it feels slightly thin as it lacks tools for creating, updating, or deleting glucose data, which might be expected in a full CRUD lifecycle, though this is reasonable for a read-only server.
The toolset is complete for read-only operations, offering raw data, statistics, and the latest reading. However, there are notable gaps in the surface, such as missing create, update, or delete tools, which limits agents to retrieval-only workflows and could cause failures in scenarios requiring data modification.
Maintenance
Related MCP Connectors
- NightscoutOAuthai.b77
Your Nightscout glucose data, conversational.
Your own SLATE health data in your AI assistant: read, trend, plan and log. Never suggests a dose.
Glucose readings from your LibreLink Up sensor: graph, logbook, stats and summaries (read-only). Sec
- freddyOAuthcoach.freddy
Connect your wearables, rings and training apps, then ask your AI about your own health data.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides access to Dexcom G7 continuous glucose monitor data, enabling AI assistants to retrieve current glucose readings and historical data.14-
- AlicenseNot gradedqualityCmaintenanceConnects AI assistants to Nightscout for real-time glucose monitoring, analysis, and treatment logging, enabling natural language interaction with CGM data.5MIT
- FlicenseNot gradedqualityDmaintenanceEnables reading real-time continuous glucose monitor data from Dexcom sensors via the Share API, allowing Claude to access glucose levels, trends, and statistics.-
- AlicenseBqualityDmaintenanceEnables AI assistants to access and analyze Continuous Glucose Monitor (CGM) data from Nightscout, providing real-time readings, history, and analytics.71MIT