Skip to main content
Glama

garmin-connect-mcp

CI Release npm npm downloads License: AGPL-3.0

MCP server for Garmin Connect. Access your activities, health stats, sleep data, FIT files, and more from Claude Code or any MCP client.

Why This Exists

In March 2026, Garmin changed their authentication API, breaking garth and python-garminconnect — the two most popular libraries for accessing Garmin data programmatically. Garth has been officially deprecated. Garmin added Cloudflare TLS fingerprinting that blocks all non-browser HTTP clients (Node.js fetch, Python requests, curl) from their API endpoints.

This project works around that by routing all API calls through a headless Playwright browser, inheriting a real Chrome TLS fingerprint. Authentication uses browser cookies captured from a manual login session.

Related MCP server: mcp-garmin

Install

npm install -g @etweisberg/garmin-connect-mcp
npx playwright install chromium

Then register with Claude Code:

claude mcp add garmin -- npx @etweisberg/garmin-connect-mcp

You also need the Playwright MCP server for the login flow:

claude mcp add playwright -- npx @playwright/mcp@latest

Prerequisites

  • Node.js 18+

  • Playwright MCP server (for browser-based login)

  • A Garmin Connect account with a synced device

Setup

1. Login

In Claude Code, call the garmin-login tool. It will walk you through:

  1. Opening Garmin Connect in the Playwright browser

  2. Logging in manually

  3. Extracting cookies and CSRF token

  4. Saving the session to ~/.garmin-connect-mcp/session.json

2. Verify

Call the check-session tool to confirm authentication works.

Session cookies expire after a few hours. Re-run the login flow when they do.

Available Tools

Session & Auth

Tool

Description

garmin-login

Returns login instructions for the Playwright MCP browser

check-session

Validates the saved session is still active

run-tests

Returns a test plan to verify all tools work

Activities

Tool

Description

list-activities

List activities with pagination

get-activity

Full activity summary (distance, duration, HR, calories)

get-activity-details

Time-series metrics (HR, cadence, elevation over time)

get-activity-splits

Lap/split data

get-activity-hr-zones

Heart rate time-in-zone breakdown

get-activity-polyline

Full-resolution GPS track

get-activity-weather

Weather conditions during activity

download-fit

Download original FIT file

Daily Health

Tool

Description

get-daily-summary

Steps, calories, distance, intensity minutes

get-daily-heart-rate

Heart rate data throughout the day

get-daily-stress

Stress levels throughout the day

get-daily-summary-chart

Combined wellness chart data

get-daily-intensity-minutes

Intensity minutes for a date

get-daily-movement

Movement/activity data

get-daily-respiration

Respiration rate data

Sleep / Body Battery / HRV

Tool

Description

get-sleep

Sleep score, duration, stages, SpO2

get-body-battery

Body battery charged/drained values

get-hrv

Heart rate variability data

Training & Recovery

Tool

Description

get-training-readiness

Training readiness score (sleep, recovery, load)

get-sleep-stats

Sleep statistics over a date range

get-hydration

Daily hydration/water intake data

Weight / Records / Fitness

Tool

Description

get-weight

Weight measurements over a date range

get-personal-records

All personal records with history

get-fitness-stats

Aggregated activity stats by type

get-vo2max

Latest VO2 Max estimate

get-hr-zones-config

Heart rate zone boundaries

get-power-zones

Power zone config for all sports

get-user-profile

User profile and settings

Calendar, Goals & Badges

Tool

Description

get-calendar

Monthly calendar with activities and events

get-goals

Active, future, or past fitness goals

get-badges

All earned badges/achievements

get-badge-leaderboard

Badge leaderboard among connections

Workouts

Tool

Description

list-workouts

List saved workouts

get-workout

Get workout details (steps, segments)

create-workout

Create a new workout (warmup, intervals, cooldown)

schedule-workout

Schedule a workout to a date (syncs to device)

delete-workout

Delete a workout

download-workout-fit

Download a workout as a FIT file

Architecture

Claude Code / MCP Client
        |
        | MCP (stdio)
        v
garmin-connect-mcp server
        |
        | page.evaluate(fetch(...))
        v
Headless Playwright Chromium
        |
        | HTTPS (real Chrome TLS fingerprint)
        v
connect.garmin.com/gc-api/*

All API calls are made from within a headless Chromium browser context via page.evaluate(fetch(...)). This inherits the real Chrome TLS fingerprint, bypassing Cloudflare's detection of non-browser clients.

Auth flow: Cookies + CSRF token are captured from a manual browser login (via the Playwright MCP server) and stored at ~/.garmin-connect-mcp/session.json. The headless browser loads these cookies on startup.

Why not direct HTTP? Cloudflare blocks Node.js fetch, Python requests, and even curl with a 403. Only requests from a real browser TLS stack are accepted.

Development

git clone https://github.com/etweisberg/garmin-connect-mcp.git
cd garmin-connect-mcp
npm install
npx playwright install chromium
npm run build

Scripts

Command

Description

npm run build

Compile TypeScript

npm run lint

Run ESLint

npm run format

Format with Prettier

npm run typecheck

Type check without emitting

npm test

Run integration tests (requires valid session)

Local Integration Testing

The standalone test suite (npm test) requires a valid Garmin session and hits the real API. Run it locally after authenticating:

npm test

Contributing

  1. Create a feature branch off main

  2. Make your changes

  3. Run checks:

    npm run lint
    npm run format
    npm run typecheck
    npm run build
  4. Test via Claude Code: The recommended way to verify your changes is through Claude Code. After building, call the run-tests MCP tool — it returns a test plan that exercises all 27 tools against the live Garmin API. Tell Claude to execute the plan and report results.

  5. Open a PR against main

CI runs lint, format check, typecheck, and build on every PR. Integration tests run locally only (they require Garmin authentication that can't safely run in CI).

Releasing

Releases are fully automated. Every merge to main triggers the release workflow which:

  1. Runs CI (lint, format, typecheck, build)

  2. Bumps the patch version

  3. Publishes to npm with provenance

  4. Creates a GitHub Release

No manual version bumping or tagging needed — just merge your PR.

License

AGPL-3.0

Available Tools

41 tools
check-sessionA

Check if the saved Garmin Connect session is still valid. MUST be called after garmin-login to verify authentication worked.

Inputs: no named parameters.

create-workoutA

Upload a workout from JSON data.

Creates a new workout in Garmin Connect from structured workout data.

IMPORTANT: Step types must use Garmin's DTO format:

  • Use "ExecutableStepDTO" for regular steps (warmup, interval, cooldown, recovery)

  • Use "RepeatGroupDTO" for repeat/interval groups with numberOfIterations

IMPORTANT: For heart rate zone targets, use "zoneNumber" (1-5), NOT targetValueOne/targetValueTwo. targetValueOne/targetValueTwo are only for absolute value ranges (e.g. pace in m/s, power in watts).

Sport type IDs: 1=running, 2=cycling, 3=swimming, 4=walking, 5=strength_training, 6=fitness_equipment, 7=hiking. Step type IDs: warmup (1), cooldown (2), interval (3), recovery (4), rest (5). End condition IDs: time (2, value in seconds), distance (3, value in meters), lap.button (7, no value), reps (10, value = rep count — use for strength exercises). Target type IDs: no.target (1), speed (2, m/s range via targetValueOne/targetValueTwo), heart.rate.zone (4, use zoneNumber 1-5), power.zone (11, use zoneNumber).

Available Templates: Instead of building workout JSON from scratch, use these MCP resources as starting points:

  • workout://templates/simple-run - Basic warmup/run/cooldown structure

  • workout://templates/interval-running - Interval training with repeat groups

  • workout://templates/tempo-run - Tempo run with heart rate zone targets

  • workout://templates/strength-circuit - Strength training circuit structure

  • workout://reference/structure - Complete JSON structure reference with all fields

Access these resources using your MCP client's resource reading capability, modify the template as needed, and pass the resulting JSON as the workout parameter.

Example workout structure with HR zone target: { "workoutName": "My Workout", "sportType": {"sportTypeId": 1, "sportTypeKey": "running"}, "workoutSegments": [{ "segmentOrder": 1, "sportType": {"sportTypeId": 1, "sportTypeKey": "running"}, "workoutSteps": [{ "type": "ExecutableStepDTO", "stepOrder": 1, "stepType": {"stepTypeId": 3, "stepTypeKey": "interval"}, "endCondition": {"conditionTypeId": 2, "conditionTypeKey": "time"}, "endConditionValue": 1200.0, "targetType": {"workoutTargetTypeId": 4, "workoutTargetTypeKey": "heart.rate.zone"}, "zoneNumber": 3 }] }] }

Example with RepeatGroupDTO for intervals: { "workoutName": "Interval Run", "sportType": {"sportTypeId": 1, "sportTypeKey": "running"}, "workoutSegments": [{ "segmentOrder": 1, "sportType": {"sportTypeId": 1, "sportTypeKey": "running"}, "workoutSteps": [ { "type": "ExecutableStepDTO", "stepOrder": 1, "stepType": {"stepTypeId": 1, "stepTypeKey": "warmup"}, "endCondition": {"conditionTypeId": 2, "conditionTypeKey": "time"}, "endConditionValue": 600.0, "targetType": {"workoutTargetTypeId": 1, "workoutTargetTypeKey": "no.target"} }, { "type": "RepeatGroupDTO", "stepOrder": 2, "numberOfIterations": 6, "workoutSteps": [ { "type": "ExecutableStepDTO", "stepOrder": 1, "stepType": {"stepTypeId": 3, "stepTypeKey": "interval"}, "endCondition": {"conditionTypeId": 2, "conditionTypeKey": "time"}, "endConditionValue": 60.0, "targetType": {"workoutTargetTypeId": 4, "workoutTargetTypeKey": "heart.rate.zone"}, "zoneNumber": 5 }, { "type": "ExecutableStepDTO", "stepOrder": 2, "stepType": {"stepTypeId": 4, "stepTypeKey": "recovery"}, "endCondition": {"conditionTypeId": 2, "conditionTypeKey": "time"}, "endConditionValue": 90.0, "targetType": {"workoutTargetTypeId": 4, "workoutTargetTypeKey": "heart.rate.zone"}, "zoneNumber": 2 } ] }, { "type": "ExecutableStepDTO", "stepOrder": 3, "stepType": {"stepTypeId": 2, "stepTypeKey": "cooldown"}, "endCondition": {"conditionTypeId": 2, "conditionTypeKey": "time"}, "endConditionValue": 600.0, "targetType": {"workoutTargetTypeId": 1, "workoutTargetTypeKey": "no.target"} } ] }] }

Inputs: workout (required).

delete-workoutB

Delete a workout from Garmin Connect

Inputs: workoutId (required).

download-fitB

Download the original FIT file for an activity. Returns the file path.

Inputs: activityId (required), outputDir.

download-workout-fitC

Download a workout as a FIT file

Inputs: workoutId (required), outputDir.

garmin-loginA

Returns step-by-step instructions for authenticating with Garmin Connect. Requires the Playwright MCP server to be installed. After following these steps, ALWAYS call the check-session tool to verify the login worked.

Inputs: no named parameters.

get-activityB

Get full activity summary (name, type, distance, duration, HR, calories, etc.)

Inputs: activityId (required).

get-activity-detailsA

Get time-series metrics for an activity (HR, cadence, elevation, pace over time)

Inputs: activityId (required), maxChartSize.

get-activity-hr-zonesB

Get heart rate time-in-zone breakdown for an activity

Inputs: activityId (required).

get-activity-polylineA

Get full-resolution GPS track/polyline for an activity

Inputs: activityId (required).

get-activity-splitsB

Get lap/split data for an activity

Inputs: activityId (required).

get-activity-weatherB

Get weather conditions during an activity

Inputs: activityId (required).

get-badge-leaderboardB

Get badge leaderboard among your connections

Inputs: limit.

get-badgesA

Get all earned badges/achievements

Inputs: no named parameters.

get-body-batteryA

Get today's body battery charged/drained values

Inputs: no named parameters.

get-calendarB

Get monthly calendar with activities, workouts, and events

Inputs: year (required), month (required).

get-daily-heart-rateB

Get heart rate data throughout the day (resting HR, HR timeline)

Inputs: date.

get-daily-intensity-minutesB

Get intensity minutes earned for a date

Inputs: date.

get-daily-movementB

Get daily movement/activity data

Inputs: date.

get-daily-respirationC

Get respiration rate data for a date

Inputs: date.

get-daily-stressB

Get stress level data throughout the day

Inputs: date.

get-daily-summaryB

Get daily summary: steps, calories, distance, intensity minutes, floors, etc.

Inputs: date.

get-daily-summary-chartB

Get daily wellness summary chart data (combined health metrics)

Inputs: date.

get-fitness-statsB

Get aggregated fitness stats by activity type over a date range

Inputs: startDate (required), endDate (required), aggregation, metric.

get-goalsC

Get fitness goals

Inputs: status.

get-hrvB

Get heart rate variability (HRV) data for a date

Inputs: date.

get-hr-zones-configB

Get your configured heart rate zone boundaries

Inputs: no named parameters.

get-hydrationB

Get daily hydration/water intake data

Inputs: date.

get-personal-recordsA

Get all personal records with history (fastest mile, longest run, etc.)

Inputs: no named parameters.

get-power-zonesA

Get power zone configuration for all sports

Inputs: no named parameters.

get-sleepC

Get sleep data: score, duration, stages, SpO2, HRV during sleep

Inputs: date.

get-sleep-statsB

Get sleep statistics over a date range (averages, trends)

Inputs: startDate (required), endDate (required).

get-training-readinessA

Get training readiness score for a date (based on sleep, recovery, training load)

Inputs: date.

get-user-profileA

Get your Garmin Connect user profile and settings

Inputs: no named parameters.

get-vo2maxB

Get latest VO2 Max / fitness level estimate

Inputs: date.

get-weightB

Get weight measurements over a date range

Inputs: startDate (required), endDate (required).

get-workoutA

Get a single workout by ID with full step/segment details

Inputs: workoutId (required).

list-activitiesA

List your Garmin Connect activities with pagination

Inputs: limit, start.

list-workoutsB

List your saved workouts

Inputs: start, limit.

run-testsA

Returns a test plan for verifying all garmin-connect-mcp tools work. Call each tool listed and report results.

Inputs: no named parameters.

schedule-workoutA

Schedule an existing workout to a date on your calendar. The workout will sync to your device.

Inputs: workoutId (required), date (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 41 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (e.g., get-sleep vs get-sleep-stats), with descriptions clarifying differences. Minor overlap exists between get-daily-summary and get-daily-summary-chart, and between get-activity and get-activity-details, but descriptions help disambiguate.

    Naming Consistency5/5

    All tools use consistent snake_case naming with a clear verb-noun pattern (e.g., check-session, create-workout, list-activities). Verbs are uniformly applied, and no mixing of conventions (camelCase, PascalCase) occurs.

    Tool Count3/5

    With 41 tools, the surface is large but arguably justified by the breadth of Garmin Connect (activities, workouts, daily health, etc.). However, some tools could be merged (e.g., daily metrics) and the count may overwhelm agents, making it borderline.

    Completeness4/5

    The tool set covers core CRUD for workouts and activities, extensive daily health metrics, user profile, badges, and calendar. Minor gaps exist (no update/delete activities, no update workout), but the domain's primary use cases are well-supported.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that provides access to Garmin Connect fitness, health, and training data through 61 specialized tools. It enables users to query activities, sleep metrics, and performance stats directly within AI clients like Claude or Cursor.
      97
      193
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Garmin Connect that enables users to access and manage their personal health and fitness data, including daily summaries, heart rate, sleep, HRV, stress, body composition, activities, and training readiness, with secure per-user authentication.
      Functional Source , Version 1.1, ALv2 Future