### Configure and Run Dexcom G7 Server - Bash Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Sets up environment variables for Dexcom G7 server configuration and starts the Python server. This script is intended for local development using a .env file. ```bash # .env file for local development DEXCOM_USERNAME=user@example.com DEXCOM_PASSWORD=your_secure_password DEXCOM_REGION=us HTTP_PORT=8007 PYTHONUNBUFFERED=1 # Start server with environment file export $(cat .env | xargs) && python server.py ``` -------------------------------- ### Docker Quick Start for Dexcom G7 MCP Server Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Instructions to build and run the Dexcom G7 MCP Server using Docker. This requires the server image to be built and then run with environment variables for Dexcom credentials and region. It exposes the server on port 8007. ```bash # Build the image docker build -t dexcom-mcp . # Run with your credentials docker run -p 8007:8007 \ -e DEXCOM_USERNAME="your-dexcom-username" \ -e DEXCOM_PASSWORD="your-dexcom-password" \ -e DEXCOM_REGION="us" \ dexcom-mcp ``` -------------------------------- ### API Call to Initialize Dexcom G7 MCP Server Connection Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Example using cURL to send a JSON-RPC request to initialize the connection with the Dexcom G7 MCP Server. This sets up the communication channel by providing protocol version, capabilities, and client information. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"} } }' ``` -------------------------------- ### Get 24-Hour Glucose History - Python Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Retrieves and prints the text of the first glucose reading from the last 24 hours using the pydexcom library. Requires the pydexcom library to be installed. ```python history = client.get_glucose_history(hours=24) print(history['result']['content'][0]['text']) ``` -------------------------------- ### API Call to Get Current Glucose Reading (Dexcom G7 MCP Server) Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Example using cURL to retrieve the most recent glucose reading from the Dexcom G7 device via the MCP server. This is done by calling the 'tools/call' method with the 'get_current_glucose' tool. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "get_current_glucose", "arguments": {} } }' ``` -------------------------------- ### Python Client for Dexcom MCP Server Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt An example Python client class `DexcomMCPClient` that demonstrates how to interact with the Dexcom MCP server. It includes methods for initializing the connection, retrieving current glucose readings, and fetching glucose history. This client simplifies data access for Python applications. ```python import requests import json class DexcomMCPClient: def __init__(self, base_url="http://localhost:8007"): self.base_url = base_url self.request_id = 0 def _call(self, method, params=None): self.request_id += 1 payload = { "jsonrpc": "2.0", "id": self.request_id, "method": method, "params": params or {} } response = requests.post(self.base_url, json=payload) return response.json() def initialize(self): return self._call("initialize", { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "python-client", "version": "1.0.0"} }) def get_current_glucose(self): return self._call("tools/call", { "name": "get_current_glucose", "arguments": {} }) def get_glucose_history(self, hours=6): return self._call("tools/call", { "name": "get_glucose_history", "arguments": {"hours": hours} }) # Usage client = DexcomMCPClient() # Initialize connection init_response = client.initialize() print(f"Connected: {init_response['result']['serverInfo']['name']}") # Get current reading current = client.get_current_glucose() print(current['result']['content'][0]['text']) ``` -------------------------------- ### API Call to Get Glucose History (Dexcom G7 MCP Server) Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Example using cURL to retrieve historical glucose readings from the Dexcom G7 device via the MCP server. This uses the 'tools/call' method with the 'get_glucose_history' tool, optionally specifying the number of hours. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "get_glucose_history", "arguments": {"hours": 12} } }' ``` -------------------------------- ### Get Glucose History Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Fetches historical glucose readings for a specified time period, returning up to 10 most recent readings with values, trends, and timestamps. ```APIDOC ## POST /api/tools/call/get_glucose_history ### Description Retrieves historical glucose readings from the Dexcom G7 for a specified duration. The response includes a list of readings with their timestamps, glucose values (in mg/dL and mmol/L), and trend indicators. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (integer) - Required - Unique identifier for the request. - **method** (string) - Required - The method to call, should be 'tools/call'. - **params** (object) - Required - Parameters for the tools/call method. - **name** (string) - Required - The name of the tool to call, which is 'get_glucose_history'. - **arguments** (object) - Optional - Arguments for the 'get_glucose_history' tool. - **hours** (integer) - Optional - The number of past hours to retrieve glucose data for. Defaults to 6 if not provided. ### Request Example ```json { "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "get_glucose_history", "arguments": { "hours": 12 } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **id** (integer) - The identifier for the request. - **result** (object) - The result of the tool call. - **content** (array) - An array containing the output, typically a text object. - **type** (string) - The type of content, expected to be 'text'. - **text** (string) - A formatted string containing the historical glucose readings. #### Response Example ```json { "jsonrpc": "2.0", "id": 4, "result": { "content": [ { "type": "text", "text": "šŸ“Š Last 12h glucose readings:\n1. 2024-01-15 14:30:00 - 120 mg/dL (6.66 mmol/L) [Steady]\n2. 2024-01-15 14:25:00 - 118 mg/dL (6.55 mmol/L) [Steady]\n3. 2024-01-15 14:20:00 - 115 mg/dL (6.39 mmol/L) [Slowly Rising]\n4. 2024-01-15 14:15:00 - 110 mg/dL (6.11 mmol/L) [Rising]\n5. 2024-01-15 14:10:00 - 105 mg/dL (5.83 mmol/L) [Rising]" } ] } } ``` ``` -------------------------------- ### Get Current Glucose Reading Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Retrieves the most recent glucose measurement from the Dexcom G7 device, including the value in both units, trend direction, and timestamp. ```APIDOC ## POST /api/tools/call/get_current_glucose ### Description Fetches the latest glucose reading from the Dexcom G7 continuous glucose monitor. It includes the glucose value in both mg/dL and mmol/L, the trend direction, and the timestamp of the reading. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (integer) - Required - Unique identifier for the request. - **method** (string) - Required - The method to call, should be 'tools/call'. - **params** (object) - Required - Parameters for the tools/call method. - **name** (string) - Required - The name of the tool to call, which is 'get_current_glucose'. - **arguments** (object) - Optional - Arguments for the 'get_current_glucose' tool (currently none are expected). ### Request Example ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "get_current_glucose", "arguments": {} } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **id** (integer) - The identifier for the request. - **result** (object) - The result of the tool call. - **content** (array) - An array containing the output, typically a text object. - **type** (string) - The type of content, expected to be 'text'. - **text** (string) - A formatted string containing the current glucose reading, trend, and time. #### Response Example ```json { "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "🩸 Current Glucose: 120 mg/dL (6.66 mmol/L)\nšŸ“ˆ Trend: Steady\nā° Time: 2024-01-15 14:30:00" } ] } } ``` ``` -------------------------------- ### Get Current Glucose Reading - Bash Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Fetches the most recent glucose measurement from the Dexcom G7 device. This call returns the glucose value in both mg/dL and mmol/L, the trend direction, and the timestamp of the reading. It requires no arguments. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "get_current_glucose", "arguments": {} } }' ``` -------------------------------- ### Get Glucose History - Bash Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Retrieves historical glucose readings from the Dexcom G7 device for a specified number of hours. The function returns up to 10 recent readings, each including the value (mg/dL and mmol/L), trend, and timestamp. An optional 'hours' argument can be provided. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 4, "method": "tools/call", "params": { "name": "get_glucose_history", "arguments": { "hours": 12 } } }' ``` -------------------------------- ### List Available Tools - Bash Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Retrieves a list of all available tools (API methods) that the Dexcom G7 MCP Server provides. This includes the name, description, and input schema for each tool, which is essential for understanding how to interact with the server's functionalities. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }' ``` -------------------------------- ### Deploy Dexcom MCP Server with Docker Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Instructions for building and running the Dexcom MCP server as a Docker container. It covers building the image, running it with different regional configurations (US and Outside-US) using environment variables, and basic container management commands. ```bash # Build the Docker image docker build -t dexcom-mcp . # Run with US Dexcom account docker run -d \ --name dexcom-server \ -p 8007:8007 \ -e DEXCOM_USERNAME="user@example.com" \ -e DEXCOM_PASSWORD="secure_password_here" \ -e DEXCOM_REGION="us" \ -e HTTP_PORT="8007" \ dexcom-mcp # Run with Outside-US Dexcom account docker run -d \ --name dexcom-server \ -p 8007:8007 \ -e DEXCOM_USERNAME="user@example.com" \ -e DEXCOM_PASSWORD="secure_password_here" \ -e DEXCOM_REGION="ous" \ dexcom-mcp # Verify server is running curl http://localhost:8007/ # View logs docker logs dexcom-server # Stop server docker stop dexcom-server ``` -------------------------------- ### Initialize MCP Connection - Bash Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Establishes a connection with the Dexcom MCP server and negotiates protocol capabilities. This is a prerequisite for using any other tools. It sends a POST request to the server with initialization parameters and expects a response detailing protocol and server information. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "diabetes-tracker", "version": "1.0.0" } } }' ``` -------------------------------- ### Configure Claude Desktop for Dexcom MCP Server Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Provides two JSON configurations for integrating the Dexcom MCP server with Claude Desktop. The first uses a Docker command to launch the server, while the second configures an existing HTTP endpoint for data queries. ```json { "mcpServers": { "dexcom": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "DEXCOM_USERNAME=user@example.com", "-e", "DEXCOM_PASSWORD=secure_password_here", "-e", "DEXCOM_REGION=us", "-p", "8007:8007", "dexcom-mcp" ], "env": {} } } } ``` ```json { "servers": [ { "name": "dexcom", "httpEndpoint": "http://localhost:8007", "capabilities": ["tools"], "description": "Dexcom G7 glucose monitor access" } ] } ``` -------------------------------- ### Initialize MCP Connection Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Establishes a connection with the Dexcom MCP server and negotiates protocol capabilities. This must be called before using any other tools. ```APIDOC ## POST /api/initialize ### Description Initializes the connection with the Dexcom G7 MCP Server and negotiates protocol capabilities. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (integer) - Required - Unique identifier for the request. - **method** (string) - Required - The method to call, should be 'initialize'. - **params** (object) - Required - Parameters for the initialize method. - **protocolVersion** (string) - Required - The desired protocol version. - **capabilities** (object) - Optional - Client capabilities. - **clientInfo** (object) - Required - Information about the client. - **name** (string) - Required - The name of the client application. - **version** (string) - Required - The version of the client application. ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "diabetes-tracker", "version": "1.0.0" } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **id** (integer) - The identifier for the request. - **result** (object) - The result of the initialization. - **protocolVersion** (string) - The server's protocol version. - **capabilities** (object) - Server capabilities. - **serverInfo** (object) - Information about the server. - **name** (string) - The name of the server. - **version** (string) - The version of the server. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": {"listChanged": false} }, "serverInfo": { "name": "dexcom-monitor", "version": "1.0.0" } } } ``` ``` -------------------------------- ### Initialize Connection Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Establishes a connection to the Dexcom G7 MCP Server. This is the initial step required before making other API calls. ```APIDOC ## POST / Initialize Connection ### Description Initializes a connection to the Dexcom G7 MCP Server, setting up communication parameters and client information. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version, should be "2.0". - **id** (integer) - Required - A unique identifier for the request. - **method** (string) - Required - The method to call, should be "initialize". - **params** (object) - Required - Parameters for the initialization. - **protocolVersion** (string) - Required - The desired protocol version. - **capabilities** (object) - Optional - Client capabilities. - **clientInfo** (object) - Optional - Information about the client. - **name** (string) - Required - The name of the client application. - **version** (string) - Required - The version of the client application. ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0.0"} } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **id** (integer) - The ID of the request. - **result** (object) - The result of the initialization. - **protocolVersion** (string) - The negotiated protocol version. - **capabilities** (object) - Server capabilities. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": {} } } ``` ``` -------------------------------- ### Verify Dexcom G7 Server Configuration - Bash Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Prints current server configuration values and tests connectivity to the Dexcom API using environment variables. It also retrieves and displays the latest glucose reading. ```bash # Verify configuration echo "Server will start on port: $HTTP_PORT" echo "Using Dexcom region: $DEXCOM_REGION" echo "Username configured: ${DEXCOM_USERNAME:0:3}***" # Test connectivity python -c " from pydexcom import Dexcom import os client = Dexcom( username=os.getenv('DEXCOM_USERNAME'), password=os.getenv('DEXCOM_PASSWORD'), region=os.getenv('DEXCOM_REGION', 'us') ) print('Connection successful!') print(f'Latest reading: {client.get_latest_glucose_reading().value} mg/dL') " ``` -------------------------------- ### List Available Tools Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Retrieves the list of available tools (API methods) provided by the server, including their parameters and schemas. ```APIDOC ## POST /api/tools/list ### Description Retrieves a list of all available tools (functions) that the Dexcom G7 MCP Server can execute, along with their descriptions and input schemas. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (integer) - Required - Unique identifier for the request. - **method** (string) - Required - The method to call, should be 'tools/list'. - **params** (object) - Required - Parameters for the tools/list method (typically empty). ### Request Example ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **id** (integer) - The identifier for the request. - **result** (object) - The result containing the list of tools. - **tools** (array) - A list of available tools. - **name** (string) - The name of the tool. - **description** (string) - A description of what the tool does. - **inputSchema** (object) - The JSON schema defining the expected input parameters for the tool. #### Response Example ```json { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "get_current_glucose", "description": "Get current glucose reading from Dexcom G7", "inputSchema": { "type": "object", "properties": {}, "required": [] } }, { "name": "get_glucose_history", "description": "Get glucose history for specified hours", "inputSchema": { "type": "object", "properties": { "hours": { "type": "integer", "description": "Hours of history (default: 6)", "default": 6 } }, "required": [] } } ] } } ``` ``` -------------------------------- ### Configure Dexcom MCP Server with mcp-compose Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt This section details how to integrate the Dexcom MCP server into an mcp-compose managed infrastructure. It includes a sample `mcp-compose.yaml` file for defining the Dexcom server service and commands for deploying, managing, and viewing logs. ```yaml # mcp-compose.yaml version: '1' servers: dexcom: image: dexcom-mcp:local runtime: docker build: context: . dockerfile: Dockerfile protocol: http http_port: 8007 env: HTTP_PORT: "8007" DEXCOM_REGION: "us" DEXCOM_USERNAME: "user@example.com" DEXCOM_PASSWORD: "secure_password_here" capabilities: [tools] networks: [mcp-net] ``` ```bash # Deploy with mcp-compose mcp-compose up dexcom # Check status mcp-compose ps # View logs mcp-compose logs dexcom # Stop server mcp-compose down dexcom ``` -------------------------------- ### Handle Authentication Failure with Curl Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt Demonstrates how to make a curl request to the MCP server and handle an authentication failure response, typically when the Dexcom client is not initialized. This is useful for debugging client initialization issues. ```bash curl -X POST http://localhost:8007/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "get_current_glucose", "arguments": {} } }' # Expected Response (when client not initialized): # { # "jsonrpc": "2.0", # "id": 5, # "error": { # "code": -32603, # "message": "Dexcom client not initialized" # } # } ``` -------------------------------- ### MCP-Compose Configuration for Dexcom G7 MCP Server Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Configuration for deploying the Dexcom G7 MCP Server using mcp-compose for orchestrated deployment. This YAML file defines the server's image, build context, protocol, ports, environment variables, and network settings. ```yaml # mcp-compose.yaml version: '1' servers: dexcom: image: dexcom-mcp:local runtime: docker build: context: . dockerfile: Dockerfile protocol: http http_port: 8007 env: HTTP_PORT: "8007" DEXCOM_REGION: "us" DEXCOM_USERNAME: "your-dexcom-username" DEXCOM_PASSWORD: "your-dexcom-password" capabilities: [tools] networks: [mcp-net] ``` -------------------------------- ### Tools API - Dexcom G7 MCP Server Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Provides endpoints for interacting with Dexcom G7 data through various tools, including fetching current glucose readings and historical data. ```APIDOC ## POST /tools/call - Dexcom G7 Data Retrieval ### Description This endpoint allows you to call specific tools provided by the Dexcom G7 MCP Server to retrieve glucose data. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version, should be "2.0". - **id** (integer) - Required - A unique identifier for the request. - **method** (string) - Required - The method to call, should be "tools/call". - **params** (object) - Required - Parameters for the tool call. - **name** (string) - Required - The name of the tool to call (e.g., `get_current_glucose`, `get_glucose_history`). - **arguments** (object) - Optional - Arguments for the specified tool. ### Request Examples #### Get Current Glucose ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "get_current_glucose", "arguments": {} } } ``` #### Get Glucose History (last 12 hours) ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "get_glucose_history", "arguments": {"hours": 12} } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **id** (integer) - The ID of the request. - **result** (object) - The result of the tool call. The structure depends on the tool used. - For `get_current_glucose`: - **value** (integer) - Glucose value in mg/dL. - **value_mmol** (float) - Glucose value in mmol/L. - **trend** (string) - Trend information (e.g., "Steady", "Rising"). - **time** (string) - Timestamp of the reading (ISO 8601 format). - For `get_glucose_history`: - **readings** (array) - An array of historical glucose readings. - Each reading object contains: `value`, `value_mmol`, `trend`, `time`. #### Response Examples ##### Current Glucose Example ```json { "jsonrpc": "2.0", "id": 2, "result": { "value": 120, "value_mmol": 6.66, "trend": "Steady", "time": "2024-01-15T14:30:00Z" } } ``` ##### Glucose History Example ```json { "jsonrpc": "2.0", "id": 3, "result": { "readings": [ {"value": 120, "value_mmol": 6.66, "trend": "Steady", "time": "2024-01-15T14:30:00Z"}, {"value": 118, "value_mmol": 6.55, "trend": "Steady", "time": "2024-01-15T14:25:00Z"}, {"value": 115, "value_mmol": 6.39, "trend": "Slowly Rising", "time": "2024-01-15T14:20:00Z"} ] } } ``` ``` -------------------------------- ### Claude Desktop MCP Settings for Dexcom G7 Server Source: https://github.com/phildougherty/dexcom_g7_mcp_server/blob/main/README.md Configuration snippet to add the Dexcom G7 MCP Server to Claude Desktop's settings. This allows Claude Desktop to connect to the server using its HTTP endpoint and identify its capabilities. ```json { "servers": [ { "name": "dexcom", "httpEndpoint": "http://localhost:8007", "capabilities": ["tools"], "description": "Dexcom G7 glucose monitor" } ] } ``` -------------------------------- ### Convert Glucose Units: mg/dL to mmol/L in Python Source: https://context7.com/phildougherty/dexcom_g7_mcp_server/llms.txt This Python function `mg_to_mmol` converts glucose readings from milligrams per deciliter (mg/dL) to millimoles per liter (mmol/L). It's a core utility for standardizing glucose measurements across different regions and for display in API responses. ```python from server import mg_to_mmol # Convert 100 mg/dL to mmol/L mmol_value = mg_to_mmol(100) print(f"100 mg/dL = {mmol_value} mmol/L") # Output: 100 mg/dL = 5.55 mmol/L # Convert typical glucose range for mg_value in [70, 100, 120, 180, 250]: mmol_value = mg_to_mmol(mg_value) print(f"{mg_value} mg/dL = {mmol_value} mmol/L") # Output: # 70 mg/dL = 3.89 mmol/L # 100 mg/dL = 5.55 mmol/L # 120 mg/dL = 6.66 mmol/L # 180 mg/dL = 9.99 mmol/L # 250 mg/dL = 13.88 mmol/L ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.