Skip to content
MCP server

Polar Health Data (self-hosted)

Self-hosted Polar watch data with baselines, anomaly alerts and an MCP endpoint

Install
Pricing
Open source
Platforms
self-hosted, API
Runs
Remotely
Version
1.6.3
Listing updated
3 days ago

About Polar Health Data (self-hosted)

Polar Health Data (self-hosted) is an open-source MCP server for health and science. It runs as a hosted remote server, so there is nothing to install locally.

Polar's own API only serves roughly the last 28 to 30 days of data. This server syncs all 13 Polar AccessLink endpoints into your own PostgreSQL database, so the history stays with you instead of expiring.

On top of the stored sleep, Nightly Recharge, daily activity and workout records it computes personal baselines with IQR-based anomaly detection, 7, 30 and 90-day rolling averages, a Spearman sleep and HRV correlation, a training load ratio and a composite overtraining risk score. The built-in MCP server uses OAuth sign-in, so an assistant can answer a question such as whether to train hard today by comparing last night's HRV with your own baseline.

It runs as a Docker image with Litestar and SQLAlchemy underneath. A single-user self-hosted mode and a multi-user mode are described, and every table carries a user_id column.

Install

Run in a terminal

claude mcp add polar-flow-server --env DATABASE_URL='<DATABASE_URL>' --env POLAR_CLIENT_ID='<POLAR_CLIENT_ID>' --env POLAR_CLIENT_SECRET='<POLAR_CLIENT_SECRET>' -- docker run -i --rm -e DATABASE_URL -e POLAR_CLIENT_ID -e POLAR_CLIENT_SECRET docker.io/stumason/polar-flow-server:1.6.3

Add to claude_desktop_config.json

{
  "mcpServers": {
    "polar-flow-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "-e",
        "POLAR_CLIENT_ID",
        "-e",
        "POLAR_CLIENT_SECRET",
        "docker.io/stumason/polar-flow-server:1.6.3"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "POLAR_CLIENT_ID": "<POLAR_CLIENT_ID>",
        "POLAR_CLIENT_SECRET": "<POLAR_CLIENT_SECRET>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "polar-flow-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "-e",
        "POLAR_CLIENT_ID",
        "-e",
        "POLAR_CLIENT_SECRET",
        "docker.io/stumason/polar-flow-server:1.6.3"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "POLAR_CLIENT_ID": "<POLAR_CLIENT_ID>",
        "POLAR_CLIENT_SECRET": "<POLAR_CLIENT_SECRET>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "polar-flow-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "-e",
        "POLAR_CLIENT_ID",
        "-e",
        "POLAR_CLIENT_SECRET",
        "docker.io/stumason/polar-flow-server:1.6.3"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "POLAR_CLIENT_ID": "<POLAR_CLIENT_ID>",
        "POLAR_CLIENT_SECRET": "<POLAR_CLIENT_SECRET>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "polar-flow-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "-e",
        "POLAR_CLIENT_ID",
        "-e",
        "POLAR_CLIENT_SECRET",
        "docker.io/stumason/polar-flow-server:1.6.3"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "POLAR_CLIENT_ID": "<POLAR_CLIENT_ID>",
        "POLAR_CLIENT_SECRET": "<POLAR_CLIENT_SECRET>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "polar-flow-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URL",
        "-e",
        "POLAR_CLIENT_ID",
        "-e",
        "POLAR_CLIENT_SECRET",
        "docker.io/stumason/polar-flow-server:1.6.3"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "POLAR_CLIENT_ID": "<POLAR_CLIENT_ID>",
        "POLAR_CLIENT_SECRET": "<POLAR_CLIENT_SECRET>"
      }
    }
  }
}

Configuration

  • DATABASE_URLPostgreSQL connection string, e.g. postgresql+asyncpg://user:pass@host:5432/polarRequired
  • POLAR_CLIENT_IDPolar AccessLink OAuth client id (register at admin.polaraccesslink.com)Required
  • POLAR_CLIENT_SECRETPolar AccessLink OAuth client secretRequired
  • BASE_URLPublic HTTPS base URL of this deployment; enables OAuth sign-in for MCP connectors

What it does

Full Polar history
Syncs all 13 Polar API endpoints and keeps the records beyond Polar's 28 to 30 day window.
Personal baselines
Flags anomalies against your own IQR-based baselines with warning and critical severity.
Recovery analytics
Includes sleep and HRV correlation, training load ratio, trend detection and an overtraining risk score.
Built-in MCP server
Exposes the data to assistants over streamable HTTP with OAuth sign-in.
REST API
Serves sleep, baselines, patterns, anomalies and insights endpoints for dashboards.
Docker deployment
Runs from one image against your own PostgreSQL database.

Good for

  • Ask an assistant whether today suits a hard session based on overnight HRV
  • Keep years of Polar sleep and workout history instead of a month
  • Spot unusual resting metrics before they turn into an overtraining problem
  • Feed your own dashboard from a local REST API

Pricing

Open source

Self-hosted; you supply PostgreSQL and a Polar AccessLink app

Prices change. Check stumason.github.io before you buy.

Polar Health Data (self-hosted) FAQ

What do I need to run it?

A PostgreSQL connection string, a Polar AccessLink client id and secret, and the Docker image. BASE_URL is optional and enables OAuth sign-in for MCP connectors.

Does my data go to a cloud service?

The README says everything is stored in your local PostgreSQL database with no cloud between you and your data.

Which Polar data does it store?

Sleep with HRV and stages, Nightly Recharge, daily activity and exercises with detailed metrics.

Does it support more than one user?

Yes. Every table has a user_id column, with a single-user self-hosted mode and a multi-user mode.

Is Polar Health Data (self-hosted) free?

Yes. Polar Health Data (self-hosted) is open source, so you can use and self-host it for free.

How do I add Polar Health Data (self-hosted) to Claude Code?

Run this command in your terminal: claude mcp add polar-flow-server --env DATABASE_URL='<DATABASE_URL>' --env POLAR_CLIENT_ID='<POLAR_CLIENT_ID>' --env POLAR_CLIENT_SECRET='<POLAR_CLIENT_SECRET>' -- docker run -i --rm -e DATABASE_URL -e POLAR_CLIENT_ID -e POLAR_CLIENT_SECRET docker.io/stumason/polar-flow-server:1.6.3

What are the best alternatives to Polar Health Data (self-hosted)?

The closest alternatives to Polar Health Data (self-hosted) are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Tooluniverse, Oya Browser and Tapetide - Indian Stock Market MCP.

Alternatives to Polar Health Data (self-hosted)

  1. Open-source analytics app where an AI agent builds charts and dashboards from your data

    • Remote
    • Open source
    • 7.7K GitHub stars
    • Analytics and data
  2. Hosted MCP connector for managing Google Ads, Meta Ads, GA4 and Search Console from chat

    • 8 tools
    • Remote
    • Freemium
    • 8.1K GitHub stars
    • Marketing and SEO
  3. Tooluniverse

    MCP server

    MCP server giving AI agents access to thousands of scientific research tools

    Runs locally
    • Open source
    • 1.8K GitHub stars
    • Health and science
  4. Oya Browser

    MCP server

    HIPAA-oriented agentic browser with replayable playbooks, reachable over MCP

    • 32 tools
    • Remote
    • Freemium
    • 349 GitHub stars
    • Browser automation
  5. Indian NSE and BSE stock market data for AI assistants through 48 MCP tools

    • 17 tools
    • Remote
    • Freemium
    • 150 GitHub stars
    • Finance and payments
  6. World Monitor

    MCP server

    Live geopolitical intelligence dashboard with an API and MCP server for agents

    • Remote
    • Freemium
    • Analytics and data