Skip to main content
Glama

fitness-mcp

A Model Context Protocol server that lets Claude read your Garmin fitness data.

License: MIT Python 3.12+

Ask Claude "how was my training this week?", "is my resting heart rate trending down?", "find me every run over 10 km since April" — and get real answers from your own Garmin data. The server runs on your machine; nothing is uploaded, nothing is shared with the author of this project. Bring your own Garmin Personal API key.

Built on the official garmin-connect-personal-api-python client — no reverse engineering, no scraping.

┌───────────────────────────┐          ┌────────────────────────┐
│ Claude Desktop / Code /   │  stdio   │  fitness-mcp           │
│ claude.ai (via connector) │ ───────► │  (MCP + SQLite cache)  │
└───────────────────────────┘          └──────────┬─────────────┘
                                                  │ Garmin Personal API
                                                  │ (on cache miss only)
                                                  ▼
                                      ┌─────────────────────────┐
                                      │  Garmin Connect         │
                                      └─────────────────────────┘

Features

  • Five high-level tools for activities, sleep, daily wellness, trends, and per-activity detail.

  • Lazy, on-demand sync — the first call to a fresh date range fetches from Garmin; subsequent calls read from local SQLite. Recent days auto-refresh as Garmin finalises sleep/HRV.

  • Multi-provider by design — adding Strava, Coros, or Apple Health is a new file under providers/ and one line of registration.

  • Corporate-friendly — if your network uses Zscaler/Netskope TLS inspection, point it at your CA bundle and it just works.

  • Two transports — stdio for local Claude installs (default) or Streamable HTTP for self-hosting.


Related MCP server: Garmin Connect MCP

Install

Not published on PyPI. Install from GitHub.

Option A — uvx (no install, recommended)

uvx --from "git+https://github.com/letsjustrun/fitness-mcp.git" fitness-mcp --help

Option B — pipx (keep it on your PATH)

pipx install "git+https://github.com/letsjustrun/fitness-mcp.git"
fitness-mcp --help

Option C — from source

git clone https://github.com/letsjustrun/fitness-mcp.git
cd fitness-mcp
uv venv --python 3.12
uv pip install -e ".[dev]"
.venv/bin/fitness-mcp --help

Get a Garmin Personal API key

  1. Sign in to Garmin Connect on the web.

  2. Settings → Account → Personal API Token.

  3. Create a key. It looks like GCDC_<uuid>.<uuid>.<base64>.<id>.

  4. Keep it private — treat it like a password.

This is a per-user, read-only, own-data-only key. Garmin's Personal API does not support "sharing" or "delegation" — this project cannot use anyone else's data on your behalf and vice versa.


Register with Claude Desktop

Download fitness-mcp.dxt from the Releases page and double-click. Claude Desktop will prompt for your Garmin key during install.

Option 2 — manual config

Open Settings → Developer → Edit Config and add:

{
  "mcpServers": {
    "fitness": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/letsjustrun/fitness-mcp.git",
        "fitness-mcp"
      ],
      "env": {
        "GARMIN_PERSONAL_API_KEY": "paste-your-key-here"
      }
    }
  }
}

Fully quit and relaunch Claude Desktop. Ask a new chat "Using the fitness tools, show my last 3 nights of sleep."

If you installed from source, replace "command": "uvx", "args": ["fitness-mcp"] with the absolute path to your venv's fitness-mcp script.


Register with Claude Code

claude mcp add fitness \
  -e GARMIN_PERSONAL_API_KEY=your-key-here \
  -- uvx --from "git+https://github.com/letsjustrun/fitness-mcp.git" fitness-mcp

Tools exposed

Tool

Purpose

get_activities(start, end, sport?, force_refresh?)

Summary list of workouts in a date range

get_activity_detail(activity_id)

One activity — splits, HR zones, elevation profile if upstream exposes them

get_sleep(start, end, force_refresh?)

Per-night sleep: hours, deep/REM/light/awake, score

get_daily_summary(start, end, force_refresh?)

Daily wellness + sleep rollup

get_trends(metric, start, end, bucket?)

Aggregated time series: resting_hr, steps, vo2max, hrv, sleep_score, training_load, …

Dates are YYYY-MM-DD. Full tool reference: docs/mcp-tools.md.


Running behind corporate TLS inspection (Zscaler, Netskope, …)

If your machine's HTTPS goes through a corporate proxy that re-signs certificates, Python won't trust the chain by default. Export the inspection root CA and point this server at it:

mkdir -p ~/.fitness_mcp
# macOS, Zscaler example:
security find-certificate -a -c "Zscaler" -p /Library/Keychains/System.keychain \
  > ~/.fitness_mcp/zscaler_ca.pem
CERTIFI=$(python -c 'import certifi; print(certifi.where())')
cat "$CERTIFI" ~/.fitness_mcp/zscaler_ca.pem > ~/.fitness_mcp/ca_bundle.pem

Then add FITNESS_MCP_CA_BUNDLE=$HOME/.fitness_mcp/ca_bundle.pem to your env (or the env block in your Claude Desktop config).


Self-host over HTTP (optional)

If you want one long-running server that many clients share:

# Generate a bearer token (anyone with this token can call the server)
TOKEN=$(python -c 'import secrets; print(secrets.token_urlsafe(32))')

FITNESS_MCP_HTTP_BEARER_TOKENS="$TOKEN" \
GARMIN_PERSONAL_API_KEY="your-key" \
  fitness-mcp --http --host 127.0.0.1 --port 8000

Safety rail: the server refuses to bind off localhost without a token set.

Clients then connect to http://your-host:8000/mcp with Authorization: Bearer <token>. For public exposure, terminate TLS at a reverse proxy (cloudflared, Caddy, nginx) and keep the token strong. Full HTTP + scaling notes in docs/architecture.md.


Configuration reference

All settings are env vars (loaded from the process environment or .env in the working directory or ~/.fitness_mcp/.env):

Variable

Default

Purpose

GARMIN_PERSONAL_API_KEY

—

Required. Your Garmin Personal API key.

FITNESS_MCP_TRANSPORT

stdio

stdio or http.

FITNESS_MCP_DB_PATH

~/.fitness_mcp/data.db

SQLite cache location.

FITNESS_MCP_LOG_LEVEL

INFO

DEBUG/INFO/WARNING/ERROR.

FITNESS_MCP_HTTP_TIMEOUT

30

Per-request Garmin timeout, seconds.

FITNESS_MCP_MAX_RANGE_DAYS

90

Hard cap on tool-call date ranges. Clamped silently.

FITNESS_MCP_CA_BUNDLE

(certifi default)

Path to a custom CA bundle for TLS-inspected networks.

FITNESS_MCP_HTTP_HOST

127.0.0.1

HTTP bind host.

FITNESS_MCP_HTTP_PORT

8000

HTTP port.

FITNESS_MCP_HTTP_PATH

/mcp

HTTP mount path.

FITNESS_MCP_HTTP_BEARER_TOKENS

(empty)

Comma-separated list of accepted bearer tokens. Required to bind off localhost.

FITNESS_MCP_HTTP_CORS_ORIGINS

(empty)

Comma-separated origins for claude.ai web.


Development

uv venv --python 3.12
uv pip install -e ".[dev]"
.venv/bin/pytest                 # 26 unit tests, no network
.venv/bin/ruff check .           # lint

Tests stub the Garmin provider — no real API calls happen in CI.

Add a new provider? Walk-through: docs/adding-a-provider.md.


Privacy

This server runs on your machine. Your Garmin data is cached to a SQLite file under your home directory. The author receives nothing, sees nothing, and keeps nothing.

If you self-host over HTTP, you become the data custodian — anyone with a valid bearer token can read your data. Keep tokens secret, keep TLS on, keep logs trimmed.


License

MIT — see LICENSE.

Credits

Available Tools

5 tools
get_activitiesA

List workouts between start and end (YYYY-MM-DD, inclusive).

    Returns a summary per activity: sport, name, start time, duration (min),
    distance (km), avg/max HR, elevation, training load. Use this to answer
    "what did I do last week?" or "show me every run since April".

    - `sport`: optional filter (e.g. "running", "cycling"). Matches case-insensitively.
    - `force_refresh`: skip the freshness cache and refetch every day in range.

    Use `get_activity_detail(activity_id)` for splits / HR zones of one activity.
    

Inputs: end (required), start (required), sport, force_refresh.

get_activity_detailA

Full detail for one activity: splits, HR zones, elevation profile where the provider exposes them. Call after get_activities to drill in.

Inputs: activity_id (required).

get_daily_summaryB

One row per day combining wellness (steps, resting HR, stress, body battery) and sleep (hours, score). Use this for "how was my recovery last week?" style questions.

Inputs: end (required), start (required), force_refresh.

get_sleepA

Per-night sleep in [start, end] (YYYY-MM-DD, inclusive).

    Returns hours slept, deep/REM/light/awake minutes, and sleep score per
    night. Recent nights may silently refresh — watches sync late and Garmin
    finalises sleep scoring the following morning.
    

Inputs: end (required), start (required), force_refresh.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation4/5

    The tools mostly have distinct purposes: listing activities, drilling into one activity, aggregating daily metrics, retrieving per-night sleep, and combining wellness/sleep into a daily summary. There is some overlap because sleep data appears in get_sleep, get_trends, and get_daily_summary, but the descriptions clarify different granularities and use cases.

    Naming Consistency5/5

    All tools use the same get_ verb prefix and snake_case noun style: get_activities, get_activity_detail, get_trends, get_sleep, get_daily_summary. The pattern is predictable and easy to scan.

    Tool Count5/5

    Five tools is well-scoped for a read-only fitness analytics server. Each tool covers a meaningful slice of the domain without redundant operations.

    Completeness4/5

    The surface covers activity listing/detail, trends, sleep, and daily recovery summaries, which addresses core fitness questions. Minor gaps may exist around richer activity streams or profile/settings data, but most agent workflows can be handled with the provided tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables Claude to access and query your Garmin Connect data—sleep, training, heart rate, and more—through a suite of read-only tools, with an optional write path for creating strength workouts.
      63
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude and any MCP client to read a user's own Garmin account in plain language, covering activities, time-series charts, thresholds, sleep, HRV, Body Battery, stress, readiness and trends. It also serves a private local dashboard that downloads the full training and health history, correlates metrics across views, and exports any table as CSV.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude to read and review your own Garmin training and recovery data through Garmin's official Connect Personal API, with tools for activities, daily summaries, sleep, HRV, and period analytics.
      7
      1
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables Claude to answer questions about your own Garmin Connect data — sleep, steps, heart rate, HRV, Body Battery, weight, and workouts including strength sets — by exposing read-only tools backed by Garmin's official Personal API. Access is locked behind GitHub OAuth and responses are stripped of names, photos, and GPS coordinates to keep the data private.
      MIT