LibreLink MCP Server
Provides access to Abbott FreeStyle LibreLink continuous glucose monitoring data, including current glucose readings with trends, historical glucose history, statistics and time-in-range analytics, pattern analysis, and sensor status information.
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., "@LibreLink MCP 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.
LibreLink MCP Server
A local Model Context Protocol (MCP) server that provides Claude Desktop with secure access to your FreeStyle LibreLink continuous glucose monitoring (CGM) data.
š Features
Real-time glucose monitoring - Get current readings with trend arrows
Historical data analysis - Retrieve glucose history over customizable periods
Comprehensive analytics - Time-in-range, GMI, variability metrics
mg/dL or mmol/L - Choose your unit; analytics stay accurate either way
Pattern recognition - Dawn phenomenon, meal responses, stability analysis
Privacy-first design - All data stays local on your machine
Secure credential management - Local encrypted storage
Cross-platform health integration - Works alongside other health MCP servers
Related MCP server: LibreLink MCP Server
š Prerequisites
LibreLink Account: Active FreeStyle LibreLink account with glucose data
Compatible Sensor: FreeStyle Libre 2 or 3 with data sharing enabled
Node.js: Version 18.0.0 or higher
Claude Desktop: For MCP integration
š Quick Start
1. Installation
# Clone the repository
git clone https://github.com/donnycrash/librelink-mcp-http.git
cd librelink-mcp-http
# Install dependencies
npm install
# Build the project
npm run build2. Configuration
# Configure your LibreLink credentials
npm run configureYou'll be prompted for:
Email: Your LibreLink account email
Password: Your LibreLink account password
Region: US or EU (based on your location)
Units: mg/dL (United States) or mmol/L (UK, Europe, South Africa, Australia)
Target ranges: Glucose target ranges, entered in your chosen unit (default: 70-180 mg/dL, shown as 3.9-10.0 mmol/L)
3. Test Connection
# Test your LibreLink connection
node test-real-connection.js4. Claude Desktop Integration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"librelink": {
"command": "node",
"args": ["/path/to/librelink-mcp-server/dist/index.js"],
"env": {
"LIBRE_LINK_UP_VERSION": "4.16.0"
}
}
}
}The
envblock is required. Abbott rejects the client version pinned by the upstream API library with403/ status920and aminimumVersionin the response body. SetLIBRE_LINK_UP_VERSIONto at least that version. See Troubleshooting.
If you already have other MCP servers configured, merge the librelink key
into the existing mcpServers object rather than replacing the file.
5. Restart Claude Desktop
Restart Claude Desktop to load the new MCP server.
𩸠Usage Examples
Once integrated with Claude Desktop, you can ask:
Basic Glucose Queries
"What's my current glucose level?"
"Show me my glucose readings from the past 6 hours"
"What's my average glucose today?"
Analytics & Insights
"Calculate my time in range for this week"
"Analyze my glucose patterns and trends"
"Do I have dawn phenomenon?"
"How stable are my overnight glucose levels?"
Health Correlations
When combined with other health MCP servers:
"How does my sleep quality affect my glucose control?"
"Compare my glucose variability with my stress levels"
"Show the impact of my supplements on glucose stability"
š Available MCP Tools
Tool | Description | Parameters |
| Real-time glucose reading with trend | None |
| Historical glucose data |
|
| Statistics and time-in-range |
|
| Pattern analysis |
|
| Sensor status and info | None |
| Update LibreLink credentials |
|
| Set target glucose ranges, in the configured unit |
|
| Switch between mg/dL and mmol/L |
|
| Test LibreLink connection | None |
š Sample Output
Samples below use the default mg/dL. With mmol/L configured, every glucose
value converts and units reports mmol/L.
Current Glucose Reading
{
"current_glucose": 105,
"units": "mg/dL",
"timestamp_local": "Jul 14, 2025, 11:19:24 PM",
"timestamp_utc": "2025-07-14T21:19:24.000Z",
"timezone": "Europe/London",
"trend": "Flat",
"status": "Normal",
"color": "green"
}Glucose Statistics
{
"analysis_period_days": 7,
"units": "mg/dL",
"average_glucose": 93.46,
"glucose_management_indicator_percent": 5.55,
"time_in_range": {
"target_range": "70-180 mg/dL",
"in_range_percent": 100.0,
"below_range_percent": 0.0,
"above_range_percent": 0.0
},
"variability": {
"standard_deviation": 7.52,
"coefficient_of_variation_percent": 8.04
}
}GMI is an estimated A1C percentage and the variability figures are ratios, so
they read the same in either unit. average_glucose and standard_deviation
are concentrations and convert with the configured unit.
Trend Analysis
{
"period": "daily",
"units": "mg/dL",
"patterns": [
"Good postprandial glucose control",
"Excellent overnight glucose stability"
],
"dawn_phenomenon": false,
"meal_response_average": 0,
"overnight_stability": 2.08
}Sensor Information
{
"timezone": "Europe/London",
"active_sensors": [
{
"device_id": "8389721a-5e5d-11ef-82f7-923037a589ee",
"serial_number": "MH00XXXXXX",
"device_type": "FreeStyle Libre 3",
"state": "Active",
"applied_local": "Sep 3, 2026, 11:05:28 AM",
"applied_utc": "2026-09-03T09:05:28.000Z",
"warmup_minutes": 60,
"started_local": "Sep 3, 2026, 12:05:28 PM",
"started_utc": "2026-09-03T10:05:28.000Z"
}
],
"sensor_count": 1
}applied_* is when the sensor was attached; started_* adds the reported
warmup period and is the figure the LibreLink app shows as the sensor start.
Timestamps are given in both the host timezone and UTC.
š Environment Variables
Variable | Default | Purpose |
|
| Client version sent to Abbott. Must meet the API's current |
|
| Directory holding |
| unset | LibreLink account email. Overrides the value in |
| unset | LibreLink account password. Overrides the value in |
| from config ( |
|
| from config ( |
|
| unset | HTTP mode only. Bearer token every request to |
|
| HTTP mode only. Port the HTTP server listens on. |
Environment values take precedence over config.json, so an injected secret is
never shadowed by a stale file. Invalid LIBRELINK_REGION or LIBRELINK_UNITS
values are ignored with a warning.
āļø Remote Deployment (Northflank)
The default dist/index.js speaks MCP over stdio, which only works when a
client launches it as a child process. For a hosted deployment the server also
ships a Streamable HTTP entrypoint, dist/http.js, that listens on PORT,
exposes POST /mcp behind bearer-token auth, and answers GET /health for
platform health checks. The included Dockerfile builds that entrypoint.
Hosting this server moves your LibreLink password and glucose history onto a third-party platform. The local-only privacy posture described below does not apply to a remote deployment. Keep
MCP_AUTH_TOKENlong and random and treat the URL as sensitive.
Northflank setup
Create a project, then add a Combined service linked to this repository and branch.
Build type Dockerfile, path
/Dockerfile.Under Networking, add port
3000, protocol HTTP, publicly exposed. Northflank issues a*.code.runURL with TLS.Create a Secret group with
LIBRELINK_EMAIL,LIBRELINK_PASSWORD,LIBRELINK_REGION, andMCP_AUTH_TOKEN(for exampleopenssl rand -hex 32), and link it to the service. The Dockerfile defaultsLIBRE_LINK_UP_VERSIONto4.16.0; add it to the group only if Abbott starts reporting a higherminimumVersion.Set the health check to HTTP
GET /healthon port3000.Run a single replica. The glucose cache and the LibreLink login session live in process memory, and multiple replicas would each log in to Abbott separately.
Connecting a client
# Claude Code
claude mcp add --transport http librelink https://<your-service>.code.run/mcp \
--header "Authorization: Bearer <MCP_AUTH_TOKEN>"In Claude Desktop, add the same URL as a remote connector with the
Authorization: Bearer <MCP_AUTH_TOKEN> header.
Running the HTTP server locally
npm run build
MCP_AUTH_TOKEN=dev-token npm run start:http
curl http://localhost:3000/healthOr with Docker:
docker build -t librelink-mcp .
docker run --rm -p 3000:3000 \
-e MCP_AUTH_TOKEN=dev-token \
-e LIBRELINK_EMAIL=you@example.com \
-e LIBRELINK_PASSWORD=secret \
librelink-mcpš§ Development
Running Tests
# Run all tests
npm test
# Test MCP protocol
npm run test:mcp
# Test analytics with mock data
npm run test:analytics
# Test environment-variable config overrides
npm run test:config
# Test the HTTP entrypoint (health, auth, tools/list)
npm run test:http
# Test with real LibreLink data (requires configuration)
node test-real-data.jsnpm run test:mcp calls the configure_credentials tool with dummy values. It
points LIBRELINK_MCP_CONFIG_DIR at a temporary directory it removes on
teardown, so your real credentials in ~/.librelink-mcp/config.json are left
untouched. Tests that exercise live data (test-real-connection.js,
test-real-data.js) deliberately read the real configuration, and need
LIBRE_LINK_UP_VERSION set in the environment.
Building
# Build TypeScript
npm run build
# Type checking
npm run typecheck
# Development mode
npm run devProject Structure
librelink-mcp-server/
āāā src/
ā āāā index.ts # Main MCP server
ā āāā librelink-client.ts # LibreLink API wrapper
ā āāā glucose-analytics.ts # Analytics and statistics
ā āāā config.ts # Configuration management
ā āāā configure.ts # CLI configuration tool
ā āāā units.ts # mg/dL <-> mmol/L conversion
ā āāā types.ts # TypeScript definitions
āāā config/
ā āāā default.json # Default configuration
āāā test-*.js # Test suites
āāā package.json
āāā README.mdš Security & Privacy
Data Privacy
Local processing only - No data sent to external servers
Your data stays on your machine - Complete privacy control
No analytics or tracking - Zero telemetry
Credential Security
Local storage - Credentials stored in
~/.librelink-mcp/config.jsonFile permissions - Automatically set to user-only access (600)
No cloud storage - Never uploaded or shared
Security Best Practices
# Verify file permissions
ls -la ~/.librelink-mcp/config.json
# Should show: -rw------- (user read/write only)
# Optional: Encrypt config directory
# (Implementation details in documentation)ā ļø Important Notes
LibreLink API Usage
This project uses an unofficial API through reverse engineering
Not affiliated with Abbott or FreeStyle Libre
Use at your own discretion and ensure compliance with LibreLink terms
API may change - community maintained compatibility
Data Sharing Requirements
Ensure your LibreLink app has data sharing enabled
Your sensor must be active and transmitting data
LibreLink account (not LibreLinkUp) credentials required
Sensor Compatibility
ā FreeStyle Libre 2
ā FreeStyle Libre 3
ā FreeStyle Libre 1 (may work, not tested)
š Troubleshooting
Common Issues
403 with {"status": 920, "data": {"minimumVersion": "..."}}
Abbott is rejecting the client version, not your credentials ā login succeeds and the failure appears on the next request
Set
LIBRE_LINK_UP_VERSIONto at least theminimumVersionin the responseIf Abbott raises the minimum again, the symptom is identical; raise the value
"No connections found"
The API authenticates against LibreLinkUp; verify your email and password sign in to the LibreLinkUp app itself
Check that data sharing is enabled in your LibreLink app
Ensure your sensor is active and connected
"Authentication failed"
Double-check email and password
Verify correct region (US/EU)
Try logging into LibreLink app to confirm credentials
"Connection timeout"
Check internet connection
Verify LibreLink service status
Try again after a few minutes
Getting Help
Run diagnostics:
node diagnose-account.jsCheck logs: Look for error messages in the console output
Test connection:
node test-real-connection.jsOpen an issue: Include diagnostic output and error messages
š¤ Contributing
We welcome contributions! Please:
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureMake your changes with tests
Follow the existing code style
Submit a pull request
Development Guidelines
TypeScript required - Maintain type safety
Test coverage - Add tests for new features
Documentation - Update README for new functionality
Security first - Never commit credentials or sensitive data
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
libre-link-unofficial-api - Community-maintained LibreLink API client
MCP Protocol - Anthropic's Model Context Protocol
FreeStyle Libre Community - Inspiration and reverse engineering efforts
Open Source Diabetes Projects - Nightscout, OpenAPS, and others
ā Support
If this project helps you manage your diabetes with AI assistance, please:
ā Star the repository
š Report issues you encounter
š” Suggest improvements
š¤ Contribute to the project
Disclaimer: This is an unofficial project not affiliated with Abbott or FreeStyle Libre. Use responsibly and in compliance with applicable terms of service. Always consult healthcare professionals for medical decisions.
This server cannot be deployed
Maintenance
Related MCP Connectors
Glucose readings from your LibreLink Up sensor: graph, logbook, stats and summaries (read-only). Sec
- NightscoutOAuthai.b77
Your Nightscout glucose data, conversational.
Multi-tenant hosted MCP server for Oura Ring ā 21 read-only tools, OAuth per user.
Read-only glucose, meal and spike data the user chooses to share from Journey for Health.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables access to FreeStyle Libre glucose data through Claude Desktop, providing current readings, historical data, statistics, and trend analysis from LibreLinkUp accounts with secure credential storage.101MIT
- FlicenseAqualityDmaintenanceEnables Claude Desktop to securely access FreeStyle LibreLink continuous glucose monitoring data, providing real-time readings, historical analysis, and health insights through natural language queries.815-
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for accessing glucose readings, charts, logbook, and statistics from LibreLink Up sensors, supporting any MCP client.MIT
- AlicenseNot gradedqualityDmaintenanceEnables clinical teams to list patients with active sharing and read glucose, graph, logbook, and statistics from LibreLink Up, with secure magic-link login and encrypted credentials.MIT