Polar Health Data — Claude Code MCP server for Polar health
A self-hosted server that syncs Polar health data into PostgreSQL and exposes it to your agent over MCP: sleep, HRV, workouts, personal baselines.
Open on GitHubWhat Polar Health Data (self-hosted) does
Polar's API shows you roughly the last 28-30 days. This server pulls everything it can reach and keeps it in your own PostgreSQL, with no cloud sitting in between. Thirteen endpoints feed it: sleep stages, nightly recharge, daily activity, exercises, cardio load, SleepWise, SpO2, ECG, body and skin temperature. Baselines are recomputed per person using rolling averages and IQR anomaly bounds, so a question about whether something is normal gets answered against your own history.
The MCP server is built into the main process at /mcp and speaks streamable HTTP. Ten tools cover a one-shot assessment, sleep, recovery, activity, workouts, seven biosensing streams, baselines and sync control. With BASE_URL set, the server acts as its own OAuth 2.1 authorization server: user-scoped tokens, refreshed automatically and revocable from settings. Headless clients can authenticate with an API key instead.
You will need PostgreSQL plus ENCRYPTION_KEY, a 32-byte Fernet key used to encrypt stored tokens. Polar credentials come from the AccessLink admin console, and the redirect URI has to point at /admin/oauth/callback on your instance. The stack is Litestar with SQLAlchemy 2.0 and the polar-flow SDK. Dashboard assets are vendored, so it renders on a LAN without CDN access.
What it helps with
- keep Polar history past the 28-30 day window
- compare overnight HRV against your own normal
- ask an agent whether today calls for hard training
- pull sleep, load and SpO2 into one store
- connect a health server through OAuth
Example prompts for the agent
- Add my
polar-healthMCP server athttps://your-server/mcpand list the tools it exposes - Compare last night's HRV to my baseline and tell me if a hard session makes sense today
- Chart my skin temperature over the past week against its baseline
How to install Polar Health Data (self-hosted)
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Polar Health Data (self-hosted)
How do I install Polar Health Data in Claude Code?
There is no packaged install command: run the server first, then add https://your-server/mcp as an HTTP connector in your client and sign in through OAuth.
What does Polar Health Data do?
It syncs Polar data across 13 endpoints, keeps it in PostgreSQL, computes personal baselines and serves all of it through a built-in MCP server.
What does the server need to run?
PostgreSQL via DATABASE_URL, an ENCRYPTION_KEY and Polar AccessLink app credentials. The key is generated with a short Python line using cryptography.