Skip to main content
Glama

Garmin MCP Server

Connect Claude (or any MCP client) to your Garmin Connect data — activities, sleep, heart rate, body battery, and training status.

Python 3.10+ MIT License CI

What you can ask

  • "How did I sleep this week?"

  • "What was my average pace on my last 5 runs?"

  • "Is my resting heart rate trending down?"

  • "Should I train hard today based on my body battery?"

  • "Summarize my training status and VO2 max trend."

  • "What's my lactate threshold heart rate and pace right now?"

  • "What 10k time does Garmin predict for me?"

  • "What are my running personal records?"

  • "Has my threshold pace improved over the last three months?"

Related MCP server: Garmin MCP Server

Quick Start

1. One-time login

uvx --from git+https://github.com/Sinfjell/garmin-mcp garmin-mcp-auth

Prompts for your Garmin Connect email and password (or reads GARMIN_EMAIL / GARMIN_PASSWORD from the environment), handles MFA if your account uses it, and caches a session token locally so you won't be prompted again.

2. Add it to your MCP client

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "garmin": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Sinfjell/garmin-mcp", "garmin-mcp"]
    }
  }
}

Claude Code:

claude mcp add garmin -- uvx --from git+https://github.com/Sinfjell/garmin-mcp garmin-mcp

Cursor — add to .cursor/mcp.json:

{
  "mcpServers": {
    "garmin": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Sinfjell/garmin-mcp", "garmin-mcp"]
    }
  }
}

3. Ask a question

Restart your client and ask something like "How did I sleep last night?"

Tools

Tool

Returns

list_recent_activities(limit=10)

Recent activities: date, type, name, distance, duration, avg HR, pace

get_activity_details(activity_id)

Full detail for one activity, incl. explicit elapsed/timer/moving/stopped timing (stripped of bulky sample/GPS data)

get_activity_laps(activity_id, include_gps=False)

Per-lap breakdown: distance, durations, pace, HR, power, cadence, interval intensity (WARMUP/ACTIVE/REST)

list_activities_by_date(start_date, end_date)

Activity summaries in a date range

get_daily_stats(date)

Steps, calories, resting HR, stress for one day

get_sleep(date)

Sleep stages, sleep score, overnight HRV and resting HR

get_heart_rate(date)

Min/max/resting HR and 7-day average resting HR for one day

get_body_battery(start_date, end_date)

Body Battery charged/drained/highest/lowest per day

get_training_status(date)

Training status, load, VO2 max, heat/altitude acclimation

get_performance_metrics(date=None)

Running fitness/threshold snapshot: lactate threshold (LTHR + pace), VO2 max + fitness age, and 5k/10k/half/marathon race predictions

get_personal_records()

Personal records / PBs: fastest 1km/1mile/5km/10km, longest run (labeled), plus raw type/value for any other record

get_threshold_history(start_date, end_date, aggregation="weekly")

Lactate-threshold HR + pace as a dated trend series over a range

get_running_threshold()

The threshold anchor for prescribing a session: lactate-threshold pace + LTHR with its measured date, plus the five HR zones with explicit floor and ceiling

get_activity_intervals(activity_id)

The work reps of an interval session, warm-up and cool-down excluded (rests come back flagged is_work_rep: false) — with classified_by showing whether Garmin's workout structure or its lap intensity was used, an aggregate over the reps, and what was dropped and why

get_activity_hr_zones(activity_id)

Time in heart-rate zones 1–5 for one activity: seconds and minutes per zone, each zone's floor/ceiling bpm, and has_hr_data (false = recorded without HR, so the minutes are unknown rather than zero)

find_comparable_intervals(target_distance_m, tolerance_pct=10, activity_limit=10)

Work reps of a given distance across recent runs, e.g. every 1000 m rep from the last ten running sessions

All dates are "YYYY-MM-DD". All tools return compact JSON.

Reps come from Garmin's recorded workout structure, not from the lap intensity field, which mislabels in both directions — a whole session tagged INTERVAL, or a cool-down jog tagged ACTIVE. An unstructured run returns no reps rather than one covering the entire activity: the activity's own average pace is never reported as a rep pace.

Authentication

garmin-mcp-auth is the recommended way to log in — it supports MFA and caches a token so the server doesn't need your password on every run.

Environment variable alternative: set GARMIN_EMAIL and GARMIN_PASSWORD (see .env.example) and the server will log in non-interactively if no cached token is found. This does not support MFA — accounts with MFA enabled should use garmin-mcp-auth instead.

Token cache location: ~/.garminconnect by default, or the path in GARMIN_TOKENS if set.

Official OAuth (eval / prod-candidate instance)

Hosted with Docker: docker compose up -d with the GARMIN_OAUTH_* secrets in .env. See docs/docker-deploy.md for the host setup, nginx, upgrades and backup.

Set GARMIN_AUTH_MODE=oauth and the GARMIN_OAUTH_* variables in .env.example to run a separate instance against the Garmin Connect Developer Program (OAuth 2.0 PKCE, Health + Activity APIs only). This does not replace the default session path. Every user adds the same connector URL (<base>/garmin-oauth/mcp) to their AI client, which then signs them in: our consent page, then Garmin's. Data arrives through Garmin's Ping/Push notifications and is stored per user on the host. Deploy notes and a smoke checklist: docs/oauth-deploy.md. Training status, lactate threshold, and personal records are not available via official APIs.

Remote / hosted mode (use from Claude mobile & web)

By default this server speaks stdio and is meant to run as a local subprocess of your MCP client. You can instead run it as a long-lived HTTP service and add it to claude.ai as a custom connector, which also makes it reachable from Claude on mobile.

1. Log in once, on the host

garmin-mcp-auth

Run this on the machine that will host the server (interactively, so it can handle MFA). The cached token in ~/.garminconnect (or GARMIN_TOKENS) is reused on every request — the server does not log in again per request. Avoid triggering fresh logins often: Garmin rate-limits and sometimes blocks sign-ins from datacenter IPs, so a stable, long-lived cached session is the goal, not routine re-auth.

2. Run the server in streamable-http mode

garmin-mcp --transport streamable-http --host 127.0.0.1 --port 8765 --path /<random-secret>/mcp
  • --transport streamable-http switches from stdio to an HTTP endpoint.

  • --host / --port control what the server binds to (default 127.0.0.1:8765 — bind to 127.0.0.1 and put a reverse proxy in front rather than exposing the process directly).

  • --path sets the URL path the MCP endpoint mounts at (default /mcp). Set it to a long random value (e.g. /8f2c1a9e7b.../mcp) and treat it as a secret — see below.

3. Put TLS and a reverse proxy in front

This mode has no built-in authentication. The security model is:

  • The path is the secret. Anyone with the full URL — including the random path segment — can call every tool and read your Garmin data. Anyone without it gets a 404. This is possession-of-URL security, not real authentication — good enough for a personal deployment you control, not for anything shared or high-stakes.

  • TLS is required in practice. Run the server behind a reverse proxy (Caddy, nginx, Cloudflare Tunnel, etc.) that terminates HTTPS, so the secret path isn't sent in the clear. Point the proxy at 127.0.0.1:<port> and expose only the proxy's HTTPS URL.

  • Don't log the URL, commit it, or paste it anywhere public — it's effectively a credential.

4. Add it to claude.ai as a custom connector

In claude.ai: Settings → Connectors → Add custom connector, then paste your full HTTPS URL (e.g. https://mcp.example.com/8f2c1a9e7b.../mcp). Once added, it's available from Claude on web and mobile, not just Claude Code or Desktop.

5. Optional: serve several people from one process (multi-tenant)

A single hosted server can serve more than one Garmin account. Set GARMIN_MULTI_TENANT_ROOT to a directory of per-user token stores:

GARMIN_MULTI_TENANT_ROOT=/srv/garmin-tenants \
  garmin-mcp --transport streamable-http --port 8766 --path /u

Each subdirectory is one user's token store, and its name is the user ID that appears in that user's endpoint URL:

/srv/garmin-tenants/<user-id>/     ->  https://host/u/<user-id>/mcp
  • User IDs are 32–128 chars of [a-z0-9-] and must be generated randomly (≥128 bits). As in single-tenant hosting, possession of the URL is the authentication, so a guessable ID is a leaked account.

  • An unknown or malformed ID gets a 404. A request never falls back to another user's token store, and never to the GARMIN_EMAIL / GARMIN_PASSWORD environment credentials — those belong to the host, not to a tenant.

  • Requests are served statelessly, so a session cannot outlive the URL that created it.

  • Leaving GARMIN_MULTI_TENANT_ROOT unset changes nothing: the server runs exactly as it did before, single-tenant, on the --path you give it.

A token store can be populated by hand — run garmin-mcp-auth with GARMIN_TOKENS pointed at that user's directory — but the point of the onboarding app below is that nobody has to.

Stores hold a Garmin session token, never a password.

6. Optional: let people onboard themselves

GARMIN_MULTI_TENANT_ROOT=/srv/garmin-tenants \
GARMIN_CONNECTOR_BASE_URL=https://host.example.com \
  garmin-mcp-onboarding --port 8767

Put it behind the same reverse proxy. Someone opens the page, logs in with their own Garmin account (Garmin's one-time code included), and the page hands them their personal connector URL. Their token store is created for them; you are not involved.

The password is passed straight to Garmin and dropped from memory in the same call — it is never written to disk, never logged, and is not held across the one-time-code wait. The consent text on the first page says so, in Norwegian.

Expect the login itself to be slow, and sometimes blocked. Garmin treats datacenter IPs far more harshly than home connections. A single login attempt runs five strategies with 12–20s waits between them — a minute or two of real time — and from a hosted IP some or all of those strategies can come back 429 or with a Cloudflare challenge. Give the reverse proxy a generous proxy_read_timeout (300s), and don't add retries on top: garminconnect already backs off internally, so retrying just spends more attempts against an IP that is already refusing them.

Measured from both sides on 2026-08-11, same code and same throwaway account: a residential IP reached the credential check (401 Invalid Username or Password) in 27s, while the hosted IP got a Cloudflare 403 after 1m45s. The library and the flow are fine; the location of the login is the problem.

So when server-side login is blocked, move that one step to where it works:

# on their own machine, where the IP is fine and the password never leaves
garmin-mcp-auth

# on the host, with the ~/.garminconnect directory they send you
garmin-mcp-tenant import ./their-garminconnect
# -> Imported as 3f9a...  https://host.example.com/u/3f9a.../mcp

import copies (never moves), clamps the directory to 0700 and the token to 0600, mints the random ID, and prints the finished connector URL. No new unit, no nginx change — that is what multi-tenant hosting buys even when self-service can't complete.

To remove someone:

garmin-mcp-tenant list
garmin-mcp-tenant delete <user-id>

Their URL 404s immediately afterwards. Deletion is a command rather than a web endpoint deliberately: with possession-of-URL auth, a delete endpoint would let anyone who ever saw a URL wipe that person's access.

docs/e2e-onboarding.md has the full verification sequence.

Security & privacy

  • Your credentials never leave your machine and are never stored by this server — only a session token is cached locally.

  • This server is read-only: it never writes to, modifies, or deletes anything in Garmin Connect.

  • Nothing is sent anywhere except Garmin's own API — no third-party telemetry, analytics, or logging.

Troubleshooting

"Garmin authentication expired" / auth errors — run garmin-mcp-auth again to refresh your session.

Stuck in an MFA loop — make sure you're running garmin-mcp-auth interactively (not through a client that swallows stdin); the MFA code prompt needs a real terminal.

Wrong Python version — this package requires Python 3.10+. Check with python3 --version; uvx will otherwise fail to build the environment.

Disclaimer

This project uses the unofficial, community-maintained garminconnect library to talk to Garmin Connect. It is not affiliated with, endorsed by, or supported by Garmin. Garmin Connect's API is not public, and it can change or break without notice.

License

MIT — see LICENSE.

Available Tools

16 tools
find_comparable_intervalsA

Find recent work reps of a given distance, across your last running activities.

Answers "what have I been running 1000m reps at lately?" in one call, replacing list-activities → laps-per-activity → filter-by-hand. Every rep returned has been through the same classification as get_activity_intervals, so warm-ups, rests and cool-downs never appear.

target_distance_m is the rep distance to match (e.g. 1000). Reps within tolerance_pct of it are returned (default 10%, so 900-1100 m). activity_limit (default 10) caps how many running activities are opened — each one costs a Garmin call — and they are taken from the most recent activities of any type, so a long stretch without running returns fewer.

Returns a JSON object with "matches" (each rep plus its activity_id, date and name, newest first), "match_count", and "activities_scanned".

Inputs: target_distance_m (required), tolerance_pct, activity_limit. Returns: result

get_activity_detailsA

Get full detail for a single activity by its id.

activity_id is the numeric id string returned by list_recent_activities or list_activities_by_date (the "id" field). Returns a JSON object combining the activity summary (name, type, distance, duration, HR, training effect) with a nested "details" object (measurement counts). A "timing" object gives the explicit elapsed / timer / moving / stopped breakdown so the caller never has to guess which duration is the finish time. For a per-lap breakdown (interval or km splits), call get_activity_laps. Bulky per-sample metric arrays and GPS polylines are stripped to keep the response small — use Garmin Connect directly for raw sample data.

Inputs: activity_id (required). Returns: result

get_activity_hr_zonesA

Get the time spent in each heart-rate zone (1-5) for one activity.

activity_id is the numeric id from list_recent_activities or list_activities_by_date. Returns a JSON object with "zones": one entry per zone with secs and minutes spent in it, plus the zone's floor_bpm and ceiling_bpm as configured when the activity was recorded (zone 5 has no ceiling). "total_secs" / "total_minutes" sum the zones.

"has_hr_data" is false when the activity was recorded without heart rate (Garmin returns no zones, or every zone at zero): treat the minutes as unknown then, never as zero. This is the per-activity breakdown behind get_activity_details' hasHrTimeInZones flag; for the zone limits themselves, without an activity, use get_running_threshold.

Inputs: activity_id (required). Returns: result

get_activity_intervalsA

Get the work reps of an interval session, with warm-up and cool-down excluded.

activity_id is the numeric id from list_recent_activities. Use this instead of get_activity_laps when you need what the reps were actually run at: it answers "how fast were the intervals", not "how fast was the run".

Returns a JSON object with "classified_by" — typed_splits (Garmin's recorded workout structure, preferred) or garmin_intensity (the lap intensity field, used only when an activity has no typed structure) — so the caller can see how certain the classification is. "reps" holds one entry per work rep and per rest between them — read is_work_rep rather than assuming every entry is a rep — each with distance_m, duration_s, pace_per_km, avg/max HR. "work_summary" aggregates the work reps only (count, total distance, average/fastest/slowest pace, pace spread, HR). "excluded" lists what was dropped and why.

An unstructured run returns zero work reps rather than one rep covering the whole activity: the activity's own average pace is never a rep pace.

Inputs: activity_id (required). Returns: result

get_activity_lapsA

Get the individual laps of an activity (intervals or auto-km splits).

activity_id is the numeric id from list_recent_activities. Returns a JSON object with "lap_count" and a "laps" array, one entry per real Garmin lap: lap number, distance_m, the three durations (elapsed_time_s, timer_time_s, moving_time_s), pace_min_per_km, avg/max HR, avg/max power, avg_run_cadence, "intensity" (e.g. WARMUP/ACTIVE/REST — the interval structure), and elevation gain/loss. Use this instead of get_activity_details when you need per-lap threshold or split analysis. GPS start/end coordinates are omitted by default; pass include_gps=true to include them.

Inputs: activity_id (required), include_gps. Returns: result

get_body_batteryA

Get Body Battery (energy reserve) summary per day over a date range.

start_date and end_date must be "YYYY-MM-DD". Returns a JSON array with one object per day: date, charged (points gained), drained (points lost), highest, and lowest Body Battery level. Per-minute level arrays are stripped; highest/lowest are derived from them before stripping.

Inputs: end_date (required), start_date (required). Returns: result

get_daily_statsB

Get daily summary stats for one day: steps, calories, resting HR, stress, etc.

date must be "YYYY-MM-DD". Returns a JSON object with fields such as totalSteps, totalKilocalories, restingHeartRate, averageStressLevel, bodyBatteryHighestValue/LowestValue, and floorsAscended.

Inputs: date (required). Returns: result

get_heart_rateA

Get heart rate summary for one day.

date must be "YYYY-MM-DD". Returns a JSON object with minHeartRate, maxHeartRate, restingHeartRate, and lastSevenDaysAvgRestingHeartRate. The per-minute heartRateValues time series is stripped to keep the response small.

Inputs: date (required). Returns: result

get_performance_metricsA

Get current running fitness/threshold snapshot: lactate threshold, VO2 max, race predictions.

Answers "where is my fitness right now?" in one call. date is optional ("YYYY-MM-DD", defaults to today) and only affects which day's VO2 max is read; lactate threshold and race predictions always return Garmin's latest available values. Returns a JSON object with three independent sections:

  • "lactate_threshold": threshold heart rate (LTHR, bpm) and threshold pace ("M:SS/km" plus decimal min/km and raw m/s) — the numbers used to set training zones. (Garmin's "heart rate threshold" and "lactate threshold" are the same value.)

  • "vo2max": VO2 max (decimal precise value + rounded) and fitness age.

  • "race_predictions": predicted 5k / 10k / half-marathon / marathon finish times as clock strings.

Each section is fetched independently: if one Garmin endpoint is unavailable it becomes {"error": ...} while the others still return. Every section carries its own "measured_date" so stale values are visible.

Inputs: date. Returns: result

get_personal_recordsA

Get the user's Garmin personal records (running PBs and bests).

Returns a JSON array, one object per record: record (human label for the common running types — fastest 1km/1mile/5km/10km, longest run — or null for other/unmapped types), type_id (Garmin's raw record type), value (raw: seconds for time records, metres for distance), value_formatted (clock string or "X.XX km" for mapped running types, else null), activity_id, and date. The raw type_id and value are always kept so an unmapped or non-running record is still usable, just unlabeled.

Inputs: no named parameters. Returns: result

get_running_thresholdA

Get the running threshold anchor: lactate threshold pace, LTHR, and HR zones.

This is the number a threshold or interval session should be prescribed from — never an activity's average pace. Returns a JSON object with:

  • "lactate_threshold": threshold heart rate (LTHR, bpm) and threshold pace ("M:SS/km" plus decimal min/km and raw m/s), with the date Garmin last measured it. Check that date: a threshold from months ago is stale.

  • "heart_rate_zones": the five zones with explicit floor_bpm and ceiling_bpm, plus max and resting HR and the method Garmin used.

Each section is fetched independently, so one dead endpoint leaves the other intact. For VO2 max and race predictions use get_performance_metrics.

Inputs: no named parameters. Returns: result

get_sleepA

Get sleep summary for the night ending on the given date.

date must be "YYYY-MM-DD" (the calendar date the sleep session ends on). Returns a JSON object with the daily sleep summary (dailySleepDTO: sleep stages in seconds, sleep scores, average HR/SpO2/respiration/stress) plus overnight HRV and resting HR. Per-minute sleep-stage and movement arrays are stripped to keep the response small.

Inputs: date (required). Returns: result

get_threshold_historyA

Get lactate-threshold heart rate + pace over time (the threshold trend).

start_date and end_date are "YYYY-MM-DD" (start no more than a year before end). aggregation is one of "daily", "weekly" (default), "monthly", "yearly". Returns a JSON object with "points": a dated series, each entry giving lthr_bpm (threshold heart rate) and threshold pace (pace_per_km "M:SS", decimal pace_min_per_km, raw speed_m_s). Use this to see whether threshold HR/pace is trending up over a training block — for the single latest value use get_performance_metrics instead. If Garmin's range payload can't be parsed into a series it is returned verbatim under "raw".

Inputs: end_date (required), start_date (required), aggregation. Returns: result

get_training_statusB

Get training status for a given day: fitness trend, load, VO2 max, acclimation.

date must be "YYYY-MM-DD". Returns a JSON object with mostRecentTrainingStatus (training status, acute/chronic training load), mostRecentVO2Max, and heatAltitudeAcclimationDTO.

Inputs: date (required). Returns: result

list_activities_by_dateA

List activities between two dates (inclusive).

start_date and end_date must be "YYYY-MM-DD". Returns a JSON array of activity summaries in the same shape as list_recent_activities.

Inputs: end_date (required), start_date (required). Returns: result

list_recent_activitiesA

List the most recent Garmin activities, newest first.

Returns a JSON array of activity summaries with: id (use with get_activity_details), date (YYYY-MM-DDTHH:MM local time), type (e.g. "running", "cycling"), name, distance_km, duration_min, avg_hr, and pace_min_per_km. limit caps how many activities come back (default 10).

Inputs: limit. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 16 tools

    Disambiguation4/5

    Most tools target clearly distinct resources (sleep, heart rate, body battery, daily stats, personal records), and the descriptions explicitly tell the caller when to prefer one over another (e.g. get_activity_laps vs get_activity_intervals vs get_activity_details). The main remaining overlap is lactate-threshold/VO2 data appearing in get_performance_metrics, get_running_threshold, and get_threshold_history, which an agent could still pick wrong despite the cross-references.

    Naming Consistency4/5

    Nearly everything follows a predictable get_/list_ + noun snake_case pattern (get_sleep, list_recent_activities, get_activity_hr_zones), with the activity sub-resources consistently namespaced. The single deviation is find_comparable_intervals, which uses a different verb than the rest of the set.

    Tool Count4/5

    At 16 tools the surface sits at the upper end of comfortable but each tool maps to a distinct Garmin data domain or analysis question, so none look like filler. It is slightly heavy, with three tools touching threshold/performance data, but that reflects the domain rather than padding.

    Completeness4/5

    The read-only analytics lifecycle is well covered: activities, laps, intervals, HR zones, daily stats, sleep, HR, body battery, training status, performance, and personal records, with sensible aggregation and history for thresholds. Gaps are minor for an analysis-focused server (no weight/body-composition, no scheduled workouts/calendar, and no write operations), which agents can work around by using Garmin Connect directly.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Connects Garmin Connect data to MCP-compatible clients, providing access to fitness activities, health metrics, and training plans. It supports advanced features like headless 2FA and automated MFA retrieval to enable seamless health data interaction through natural language.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects to Garmin Connect and exposes fitness and health data (activities, steps, heart rate, sleep, body composition) to MCP-compatible clients like Claude.
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Provides read-only access to your Garmin Connect health data, including sleep, HRV, body battery, stress, training readiness, and activities, through an MCP server.
      14
      -
    • A
      license
      B
      quality
      D
      maintenance
      Connects to Garmin Connect and exposes fitness and health data via 110+ tools for activities, health metrics, workouts, training analytics, and more to MCP-compatible clients.
      138
      MIT