# Polar Health Data (self-hosted) [Health: Active]

**Category:** 🏃 Sports  
**Repository:** https://github.com/StuMason/polar-flow-server  
**GitHub Stars:** 23  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/polar-health-data-self-hosted

## Description
Self-hosted Polar health analytics with a built-in MCP server: sleep, HRV, workouts, baselines.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "polar-health-data-self-hosted": {
    "url": "https://your-server/mcp"
  }
}
```

## Documentation

## What Polar Health Data (self-hosted) MCP server does

The Polar Health Data (self-hosted) MCP server connects to Polar Flow through the Polar API, retains synchronized records in PostgreSQL, and makes those records available through a dashboard, REST API, and MCP. It is designed to preserve more history than the Polar API's stated 28–30-day access window and to evaluate measurements against individual baselines.

The application synchronizes sleep, nightly recovery, daily activity, exercises, cardio load, SleepWise predictions, activity samples, continuous heart rate, SpO2, ECG, body temperature, and skin temperature. It calculates rolling personal averages and IQR-based anomaly bounds, supporting questions about whether a reading is typical for the user.

## How it works

A background sync service retrieves data from Polar through the `polar-flow` SDK and writes it to PostgreSQL. By default, synchronization runs hourly; startup synchronization and the history lookback period can be changed through environment variables. The dashboard is served by the application and uses HTMX and vendored frontend assets, so the interface can run on a local network without external CDNs.

The MCP interface is built into the main web application rather than deployed as a separate process. It uses streamable HTTP at `/mcp`. Claude Desktop and other compatible clients can connect through the server's OAuth 2.1 authorization flow when `BASE_URL` is configured. Headless clients can instead send a per-user API key or the configured master API key.

## Setup and configuration

The recommended deployment uses Docker Compose. After starting the application, open `/admin`, provide Polar credentials from the Polar AccessLink administration site, and use the callback URL configured for the deployment. Select “Sync Now” to begin importing data; automatic synchronization then follows the configured interval.

At minimum, configure `DATABASE_URL` with a PostgreSQL connection string. Production deployments also require `ENCRYPTION_KEY`, a 32-byte Fernet key used to protect stored tokens. Optional settings include `DEPLOYMENT_MODE`, `SYNC_INTERVAL_HOURS`, `SYNC_ON_STARTUP`, `SYNC_DAYS_LOOKBACK`, `LOG_LEVEL`, and `API_KEY`.

## Tools and capabilities

The Polar Health Data (self-hosted) MCP server includes ten curated tool areas covering:

- A consolidated health assessment
- Sleep and recovery information
- Activity and workouts
- Seven biosensing data streams
- Personal baselines
- Detected patterns and anomalies
- Synchronization control

MCP Apps-compatible clients can render a health assessment card in the conversation. The admin dashboard provides overview metrics, readiness recommendations, trend and baseline views, sleep charts, heart-rate and HRV charts, biosensing data, training-load charts, selectable 7-, 14-, and 30-day ranges, and CSV export.

## Limitations and notes

Polar device compatibility varies by data type; SpO2 and ECG records require compatible devices. API endpoints are authenticated, and the documentation recommends keeping health data private. Per-user API keys are rate-limited to 1,000 requests per hour by default, while the master `API_KEY` bypasses that limit.

The Polar Health Data (self-hosted) MCP server is self-hosted software, so PostgreSQL, deployment, credential management, and network exposure remain the operator's responsibility. OAuth tokens expire hourly and refresh automatically; connected applications can be revoked from Settings. A hosted version is mentioned as planned, but the described project is the self-hosted deployment.

_Full upstream README: https://allmcps.com/mcp/polar-health-data-self-hosted/readme_

