libreviewmcp
v0.1.1
Published
Model Context Protocol server for LibreView / FreeStyle Libre glucose data (via the LibreLinkUp API)
Downloads
66
Maintainers
Readme
libreviewmcp
A Model Context Protocol (MCP) server that exposes FreeStyle Libre glucose data to MCP clients (Claude Desktop, Claude Code, etc.) via the unofficial LibreLinkUp API.
Ask your assistant things like "What's my current glucose?", "Show my readings for the last few hours" or "What's my time-in-range today?".
⚠️ Unofficial & not a medical device. This project uses the reverse-engineered LibreLinkUp API. It is not affiliated with or endorsed by Abbott. Do not use it for treatment decisions — always rely on your official reader/app.
Tools
| Tool | Description |
| --- | --- |
| list_connections | List all patients sharing data with your LibreLinkUp account (returns their patientId and name). |
| get_current_glucose | Latest reading: value, trend direction (rising/falling/stable), high/low flags, timestamp. |
| get_glucose_history | Recent history (~12h, as provided by LibreLinkUp) as a time series. Optional limit. |
| get_glucose_stats | Average, min/max, standard deviation, estimated HbA1c (GMI), and time-in-range percentages. |
All tools accept an optional unit (mgdl or mmol) and, where relevant, a
patientId. When your account has exactly one connection, patientId can be
omitted.
Prerequisites
- Install the LibreLinkUp mobile app and create an account.
- Have the FreeStyle Libre user (the patient) share their glucose data with your LibreLinkUp account and accept the invitation. The MCP server reads data through that share — the same way the app does.
Quick install (macOS)
Once the package is published to npm, macOS users can configure Claude Desktop with
a single command — no clone, no build. It checks for Node.js, asks for your
LibreLinkUp credentials, and wires up claude_desktop_config.json to run the server
via npx:
curl -fsSL https://raw.githubusercontent.com/zaengerlein/libreviewmcp/main/install.sh | bashRequires Node.js ≥ 18 (the script tells you how to install it if missing). Your
credentials are stored in plaintext in the Claude Desktop config (as with any MCP
server); the file is locked down to 600. It's good practice to read a script before
piping it into your shell — see install.sh.
The installer speaks English by default and German when the macOS system language is
German; force it with LIBRE_LANG=en or LIBRE_LANG=de.
To remove it again:
curl -fsSL https://raw.githubusercontent.com/zaengerlein/libreviewmcp/main/uninstall.sh | bashSetup (manual / development)
npm install
npm run buildProvide your LibreLinkUp credentials via environment variables (see
.env.example):
| Variable | Required | Description |
| --- | --- | --- |
| LIBRE_EMAIL | ✅ | LibreLinkUp account email. |
| LIBRE_PASSWORD | ✅ | LibreLinkUp account password. |
| LIBRE_REGION | | Region code (e.g. de, eu, us) to skip the login redirect. Auto-detected if omitted. |
| LIBRE_UNIT | | Default output unit: mgdl (default) or mmol. |
Usage with Claude Desktop / Claude Code
Add the server to your MCP client configuration. Once the package is on npm, the
simplest entry uses npx (this is what the quick install
writes for you). Use the absolute path to npx so the client finds it regardless of
its PATH — run command -v npx to get it:
{
"mcpServers": {
"libreview": {
"command": "/absolute/path/to/npx",
"args": ["-y", "libreviewmcp"],
"env": {
"LIBRE_EMAIL": "[email protected]",
"LIBRE_PASSWORD": "your-password"
}
}
}
}Alternatively, from a local checkout you can point at the built entry point directly:
{
"mcpServers": {
"libreview": {
"command": "node",
"args": ["/absolute/path/to/libreviewmcp/dist/index.js"],
"env": {
"LIBRE_EMAIL": "[email protected]",
"LIBRE_PASSWORD": "your-password"
}
}
}
}For local development you can run the server from TypeScript directly:
LIBRE_EMAIL=... LIBRE_PASSWORD=... npm run devThe server communicates over stdio.
How it works
- Authenticates against
api.libreview.ioand follows Abbott's regional redirect automatically (or usesLIBRE_REGIONif set). - Sends the required
product/versionheaders and the SHA-256Account-Idheader that authenticated endpoints expect. - Caches the auth token in memory and refreshes it before expiry (and on a 401).
If logins suddenly start failing, Abbott may have bumped the required client
version — update CLIENT_VERSION in src/libre-client.ts.
Development
npm run typecheck # type-check without emitting
npm run build # compile to dist/
npm run dev # run from source with tsx
npm test # build, then run the test suiteTesting
The suite (Node's built-in test runner, no extra dependencies) runs without any LibreLinkUp credentials or network access:
test/glucose.test.js— unit tests for the pure helpers: unit conversion, trend-arrow mapping, and the statistics (average, min/max, GMI, time-in-range).test/server.test.js— a smoke test that starts the server over stdio with dummy credentials and asserts it registers the four tools with the expected input schemas. The server only authenticates on a tool call, so listing tools needs no network.
npm testTo exercise the server end-to-end against the real LibreLinkUp API, set your credentials and drive it with the MCP Inspector:
LIBRE_EMAIL=... LIBRE_PASSWORD=... npx @modelcontextprotocol/inspector node dist/index.jsLicense
MIT
