Skip to main content
Glama

garmin-mcp

English | Tiếng Việt | 简体中文

npm version License: MIT Node.js >= 20 MCP Docs

Open-source Node.js / TypeScript CLI & library implementing a Model Context Protocol (MCP) server for Garmin Connect.

📖 Documentation: https://duongtungls.github.io/garmin-mcp/

Connect AI assistants (Claude Desktop, Cursor, Windsurf, Antigravity, and any MCP-compatible client) directly to your Garmin Connect data — activities, health & wellness, sleep, weight, calendar, workouts, training metrics, courses, challenges, nutrition, women's health, devices, and gear — via standard stdio transport.


Features

  • 103 MCP Tools across 11 domains — full coverage of Garmin Connect read & management endpoints.

  • Read-only safety mode — pass --read-only or set GARMIN_READ_ONLY=true to expose only 81 read-only tools (disables all write/delete operations).

  • Interactive CLI login with 2FA / MFA support — sign in once via garmin-mcp login and cache OAuth1/OAuth2 tokens locally at ~/.garmin-mcp/tokens.

  • Automatic session refresh & re-authentication — persists refreshed tokens and automatically re-authenticates on 401/403 when credentials are provided.

  • Dual-purpose package — run directly as a CLI MCP server (garmin-mcp) or import programmatically in your own Node.js / TypeScript project.

  • Global & China domains — supports both garmin.com (default) and garmin.cn.


Related MCP server: Garmin Personal API MCP

Requirements

  • Node.js >= 20.0.0

  • A Garmin Connect account


Installation

From source

git clone https://github.com/duongtungls/garmin-mcp.git
cd garmin-mcp
npm install
npm run build

Optional global CLI link:

npm link

As a dependency or via npx (Recommended)

# Run directly without cloning:
npx -y @duongtungls/garmin-mcp --help
npx -y @duongtungls/garmin-mcp login

# Or install globally / as a library:
npm install -g @duongtungls/garmin-mcp
npm install @duongtungls/garmin-mcp

Authentication

garmin-mcp login
# or from source:
npm run login

Enter your Garmin email, password, and MFA code (if enabled). OAuth1 & OAuth2 tokens are cached in ~/.garmin-mcp/tokens (mode 0700).

Manage your session anytime:

garmin-mcp status   # Verify cached session
garmin-mcp logout   # Remove cached OAuth tokens

Option 2: Environment Variables (for non-2FA accounts)

Copy .env.example to .env or set env vars in your MCP client config:

GARMIN_EMAIL=your-email@example.com
GARMIN_PASSWORD=your-password
GARMIN_DOMAIN=garmin.com
# GARMIN_TOKEN_DIR=/custom/path/to/tokens
# GARMIN_READ_ONLY=false

MCP Client Configuration

Add the following to your MCP client configuration (Claude Desktop, Cursor, Antigravity, etc.):

{
  "mcpServers": {
    "garmin": {
      "command": "npx",
      "args": ["-y", "@duongtungls/garmin-mcp"],
      "env": {
        "GARMIN_DOMAIN": "garmin.com"
      }
    }
  }
}

Read-Only Mode

To prevent any write or delete operations (exposes 81 read-only tools):

{
  "mcpServers": {
    "garmin": {
      "command": "npx",
      "args": ["-y", "@duongtungls/garmin-mcp", "--read-only"],
      "env": {
        "GARMIN_DOMAIN": "garmin.com"
      }
    }
  }
}

Agent Use Cases & Example Prompts

Once connected to Claude Desktop, Cursor, Windsurf, or Antigravity, you can use natural language to turn your AI assistant into a personal Garmin data analyst and training assistant:

1. Morning Health & Readiness Briefing

  • Prompt: "Give me a morning readiness check: summarize last night's sleep score, HRV, Body Battery, resting HR, and Training Readiness. Should I push hard today or do an easy recovery session?"

  • Tools used: get_sleep_data, get_hrv, get_body_battery, get_heart_rate, get_training_readiness

2. Running / Cycling Training & Race Prep Coach

  • Prompt: "Analyze my last 10 runs, my VO2 max trend over the past 30 days, and my current race predictions. How is my aerobic base progressing and what pace should I target for my next 10K?"

  • Tools used: get_activities, get_activity_splits, get_activity_hr_in_timezones, get_vo2_max, get_training_status, get_race_predictions

3. Sleep & Recovery Deep Dive

  • Prompt: "Compare my sleep duration, sleep stages, and stress levels over the past 14 days. Which days had the worst recovery and did they follow high-intensity workouts?"

  • Tools used: get_sleep_range, get_stress, get_activities_by_date

4. Workout & Calendar Planning

  • Prompt: "Check my Garmin calendar for this week and upcoming races. Reschedule Thursday's interval workout to Friday and add a calendar note for Sunday's long run."

  • Tools used: get_calendar_week, get_scheduled_workouts, get_upcoming_events, reschedule_workout, create_calendar_note

5. Weight, Hydration & Nutrition Tracking

  • Prompt: "Show my weight trend over the last 30 days against my weight goal, check today's calories and hydration, and log 500 ml of water."

  • Tools used: get_weight_range, get_weight_goals, get_daily_summary, get_nutrition_daily_food_log, add_hydration_data

6. Gear & Equipment Mileage Check

  • Prompt: "List all my running shoes with their total mileage and tell me which pair is close to 600 km and needs replacing."

  • Tools used: get_gear, get_activity_gear


Programmatic Library Usage

You can embed the MCP server or reuse GarminClientManager in your own Node.js / TypeScript application:

import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { createGarminMcpServer, GarminClientManager } from '@duongtungls/garmin-mcp';

const garminManager = new GarminClientManager({
  domain: 'garmin.com',
  tokenDir: '~/.garmin-mcp/tokens',
});

const server = createGarminMcpServer({
  garminManager,
  readOnly: true, // optional
});

const transport = new StdioServerTransport();
await server.connect(transport);

You can also register individual tool groups (registerActivityTools, registerHealthTools, registerSleepTools, registerWeightTools, registerCalendarTools, registerMetricsTools, registerCourseTools, registerChallengeTools, registerNutritionTools, registerWomensHealthTools, registerProfileTools) onto an existing McpServer.


Available MCP Tools (103 Tools)

1. Activities (20)

  • Read: get_activities, get_activities_by_date, get_activity, get_activity_details, get_activity_splits, get_activity_typed_splits, get_activity_split_summaries, get_activity_hr_in_timezones, get_activity_power_in_timezones, get_activity_exercise_sets, get_activity_weather, get_activity_types, get_power_duration_curve, get_progress_summary_between_dates, count_activities

  • Write / Download: download_activity_file, create_manual_activity, set_activity_name, update_activity, delete_activity

2. Health & Wellness (17)

  • Read: get_daily_summary, get_heart_rate, get_steps, get_stress, get_body_battery, get_hrv, get_spo2, get_respiration, get_hydration, get_intensity_minutes, get_floors, get_all_day_events, get_lifestyle_logging_data, get_blood_pressure, get_glucose

  • Write: add_hydration_data, set_blood_pressure

3. Sleep (3)

  • get_sleep_data, get_sleep_range, get_naps

4. Weight & Body Composition (6)

  • Read: get_daily_weight, get_weight_range, get_latest_weight, get_weight_goals

  • Write: add_weigh_in, delete_weigh_in

5. Calendar & Workouts (15)

  • Read: get_calendar_month, get_calendar_year, get_calendar_week, get_scheduled_workouts, get_upcoming_events, get_workouts, get_workout_by_id

  • Write / Download: schedule_workout, reschedule_workout, unschedule_workout, delete_workout, push_workout_to_device, download_workout, create_calendar_note, delete_calendar_note

6. Training Metrics & Performance (15)

  • get_training_readiness, get_training_status, get_vo2_max, get_race_predictions, get_fitness_age, get_endurance_score, get_hill_score, get_acclimation, get_running_tolerance, get_lactate_threshold, get_cycling_ftp, get_heart_rate_zones, get_power_zones, get_critical_swim_speed, get_personal_records

7. Courses (4)

  • Read: get_courses, get_course_details, download_course_gpx

  • Write: delete_course

8. Challenges, Goals & Badges (5)

  • get_goals, get_earned_badges, get_badge_challenges, get_virtual_challenges, get_adhoc_challenges

9. Nutrition (7)

  • Read: get_nutrition_daily_food_log, get_nutrition_daily_meals, get_nutrition_daily_settings, search_foods, get_custom_foods

  • Write: quick_add_foods, delete_food_logs

10. Women's Health (2)

  • get_menstrual_data_for_date, get_menstrual_calendar_data

11. Profile, Devices & Gear (9)

  • Read: get_user_profile, get_user_statistics, get_devices, get_device_settings, get_device_solar_data, get_gear, get_activity_gear

  • Write: add_gear_to_activity, remove_gear_from_activity


Acknowledgments & Inspiration


Disclaimer

This is an unofficial, community-built open-source project and is not affiliated with, endorsed by, or supported by Garmin Ltd. It interacts with private Garmin Connect endpoints via @flow-js/garmin-connect. Use responsibly with your own account.


Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a Pull Request.


License

Licensed under the MIT License.

Available Tools

103 tools
add_gear_to_activityC

Associate a gear item (e.g. shoes or bike) with a Garmin activity.

Inputs: gearUuid (required), activityId (required).

add_hydration_dataB

Add (or subtract with a negative value) water intake in millilitres for a specific date.

Inputs: valueInML (required), date.

add_weigh_inC

Add a new weight measurement to Garmin Connect.

Inputs: weight (required), date, unit, timezone.

count_activitiesB

Get total lifetime activity count from Garmin Connect.

Inputs: no named parameters.

create_calendar_noteC

Add a note to the Garmin Connect calendar on a specific date.

Inputs: content (required), noteName (required), date.

create_manual_activityB

Log a manual activity in Garmin Connect (for workouts done without a watch).

Inputs: activityName (required), activityType (required), startTimeISO (required), durationInSeconds (required), +3 more.

delete_activityB

Permanently delete an activity from Garmin Connect.

Inputs: activityId (required).

delete_calendar_noteC

Delete a note from the Garmin Connect calendar.

Inputs: noteId (required).

delete_courseB

Delete a course from Garmin Connect.

Inputs: courseId (required).

delete_food_logsB

Delete food log entries for a specific date by logIds.

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

delete_weigh_inB

Delete a specific weight entry by date and samplePk.

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

delete_workoutC

Delete a saved workout from Garmin Connect.

Inputs: workoutId (required).

download_activity_fileB

Download an activity file (zip/fit, gpx, tcx, or kml) into the allowed download directory (GARMIN_DOWNLOAD_DIR or ~/Downloads/garmin-mcp).

Inputs: activityId (required), dir, format.

download_course_gpxA

Export a Garmin Connect course as GPX XML content.

Inputs: courseId (required).

download_workoutA

Download a saved workout as a FIT file into the allowed download directory (GARMIN_DOWNLOAD_DIR or ~/Downloads/garmin-mcp).

Inputs: workoutId (required), dir.

get_acclimationB

Get heat and altitude acclimation status as of a specific date.

Inputs: date.

get_activitiesC

Get recent Garmin Connect activities with pagination and optional activity type filter.

Inputs: limit, start, activityType, subActivityType.

get_activities_by_dateB

Search Garmin Connect activities between specified dates with optional keyword, type, and pagination.

Inputs: limit, start, search, endDate, +2 more.

get_activityC

Get detailed information for a single Garmin activity by activityId.

Inputs: activityId (required).

get_activity_detailsB

Get chart metrics, samples, and GPS polyline for a specific activity.

Inputs: activityId (required), maxChartSize, maxPolylineSize.

get_activity_exercise_setsB

Get exercise sets and reps for a strength training activity.

Inputs: activityId (required).

get_activity_gearC

Get gear items associated with a specific Garmin activity.

Inputs: activityId (required).

get_activity_hr_in_timezonesC

Get time spent in each heart rate zone for a specific activity.

Inputs: activityId (required).

get_activity_power_in_timezonesB

Get time spent in each power zone for a specific cycling/running activity.

Inputs: activityId (required).

get_activity_splitsC

Get lap/split breakdown for a specific Garmin activity.

Inputs: activityId (required).

get_activity_split_summariesC

Get split summaries for a specific activity.

Inputs: activityId (required).

get_activity_typed_splitsB

Get typed splits (e.g. run/walk/interval segments) for a specific activity.

Inputs: activityId (required).

get_activity_typesB

Get all available Garmin activity type definitions.

Inputs: no named parameters.

get_activity_weatherA

Get weather conditions recorded during a specific activity.

Inputs: activityId (required).

get_adhoc_challengesB

Get user-created social/group ad-hoc challenges (active/non-completed or historical).

Inputs: filter.

get_all_day_eventsA

Get daily wellness events (auto-detected naps, stress events, activities) for a specific date.

Inputs: date.

get_badge_challengesA

Get Garmin badge challenges (completed, in-progress/non-completed, or available to join).

Inputs: filter.

get_blood_pressureB

Get blood pressure measurements for a single date or over a date range.

Inputs: date, endDate, startDate.

get_body_batteryB

Get Body Battery reports over a date range, optionally with charge/drain events for a specific date.

Inputs: endDate, startDate, includeEventsForDate.

get_calendar_monthA

Get Garmin Connect calendar items (activities, workouts, weight, sleep, events) for a specific month.

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

get_calendar_weekB

Get Garmin Connect calendar events for the week containing a given date.

Inputs: date, firstDayOfWeek.

get_calendar_yearB

Get Garmin Connect calendar overview for an entire year.

Inputs: year (required).

get_course_detailsC

Get full details of a Garmin Connect course by courseId.

Inputs: courseId (required).

get_coursesA

List all courses (routes) saved on Garmin Connect.

Inputs: no named parameters.

get_critical_swim_speedA

Get latest Critical Swim Speed (CSS) as of a specific date.

Inputs: date.

get_custom_foodsC

Search or list the user's custom foods in Garmin nutrition library.

Inputs: limit, start, searchExpression.

get_cycling_ftpB

Get latest Functional Threshold Power (FTP) for a sport (default: CYCLING).

Inputs: sport.

get_daily_summaryA

Get comprehensive daily health & activity summary (calories, steps, distance, heart rate, stress, Body Battery, SpO2, intensity minutes) for a date.

Inputs: date.

get_daily_weightA

Get weight and body composition measurements (weight, BMI, body fat, muscle mass, etc.) for a specific date.

Inputs: date.

get_devicesA

Get all registered Garmin devices and the last used device.

Inputs: no named parameters.

get_device_settingsB

Get settings for a specific Garmin device by deviceId.

Inputs: deviceId (required).

get_device_solar_dataB

Get solar charging data for a solar-capable Garmin device on a specific date.

Inputs: deviceId (required), date.

get_earned_badgesB

Get badges earned by the user on Garmin Connect.

Inputs: no named parameters.

get_endurance_scoreC

Get Endurance Score for a specific date.

Inputs: date.

get_fitness_ageA

Get Fitness Age and its components as of a specific date.

Inputs: date.

get_floorsA

Get floors climbed/descended for a single date or daily totals over a date range.

Inputs: date, endDate, startDate.

get_gearA

Get user's gear (running shoes, bikes, etc.) with usage mileage and totals.

Inputs: no named parameters.

get_glucoseB

Get blood glucose readings for a single date or over a date range.

Inputs: date, endDate, startDate.

get_goalsB

Get Garmin Connect goals filtered by status ("active", "future", or "past").

Inputs: limit, start, status.

get_heart_rateA

Get heart rate data (resting HR, min/max HR, intraday values) for a date, or resting heart rate trend over a date range.

Inputs: date, endDate, startDate.

get_heart_rate_zonesB

Get user's configured heart rate training zones per sport.

Inputs: no named parameters.

get_hill_scoreC

Get Hill Score for a specific date.

Inputs: date.

get_hrvA

Get Heart Rate Variability (HRV) data for a single night or trend over a date range.

Inputs: date, endDate, startDate.

get_hydrationB

Get daily hydration total and goal (in mL) for a date, or daily hydration stats over a date range.

Inputs: date, endDate, startDate.

get_intensity_minutesA

Get moderate/vigorous intensity minutes for a single date (with weekly goal) or over a date range.

Inputs: date, endDate, startDate.

get_lactate_thresholdB

Get latest lactate threshold heart rate and pace/speed data.

Inputs: no named parameters.

get_latest_weightB

Get the latest weigh-in recorded on or before a specific date.

Inputs: date.

get_lifestyle_logging_dataB

Get lifestyle logging data (logged habits/behaviors) for a specific date.

Inputs: date.

get_menstrual_calendar_dataC

Get menstrual cycle calendar data between two dates.

Inputs: endDate, startDate.

get_menstrual_data_for_dateA

Get menstrual cycle day view and summary for a specific date.

Inputs: date.

get_napsC

Get recorded naps for a specific date.

Inputs: date.

get_nutrition_daily_food_logC

Get daily food consumption records and meals for a specific date.

Inputs: date.

get_nutrition_daily_mealsC

Get daily meal summaries for a specific date.

Inputs: date.

get_nutrition_daily_settingsB

Get nutrition plan, calorie/macro targets, and tracking status for a date.

Inputs: date.

get_personal_recordsB

Get personal records (fastest 1K, 5K, 10K, longest run, etc.) from Garmin Connect.

Inputs: no named parameters.

get_power_duration_curveB

Get best power held for each duration (Power Duration Curve).

Inputs: no named parameters.

get_power_zonesB

Get user's configured power training zones per sport.

Inputs: no named parameters.

get_progress_summary_between_datesB

Get aggregated activity statistics over a date range (e.g. distance, duration, calories).

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

get_race_predictionsA

Get Garmin race time predictions (5K, 10K, Half Marathon, Marathon), latest or over a date range.

Inputs: endDate, startDate.

get_respirationB

Get respiration rate for a single date or daily respiration stats across a date range.

Inputs: date, endDate, startDate.

get_running_toleranceB

Get Running Tolerance statistics over a date range (daily or weekly).

Inputs: endDate, startDate, aggregation.

get_scheduled_workoutsA

Get workouts scheduled on the Garmin calendar between two dates.

Inputs: endDate, startDate.

get_sleep_dataA

Get sleep data for a specific date (sleep stages, duration, sleep score, respiration, SpO2). Set summaryOnly=true for a compact summary without raw sensor arrays.

Inputs: date, summaryOnly.

get_sleep_rangeB

Get nightly sleep statistics and averages across a date range.

Inputs: endDate, startDate, includeScores.

get_spo2A

Get blood oxygen saturation (SpO2) summary and readings for a specific date.

Inputs: date.

get_stepsA

Get step count for a single date (optionally with 15-minute chart intervals) or daily step totals & goals across a date range.

Inputs: date, endDate, startDate, includeChart.

get_stressB

Get all-day stress data for a single date or daily stress stats across a date range.

Inputs: date, endDate, startDate.

get_training_readinessC

Get Training Readiness score and contributing factors for a specific date.

Inputs: date.

get_training_statusA

Get aggregated Training Status (status, load balance, VO2 max, acclimation) as of a specific date.

Inputs: date.

get_upcoming_eventsB

Get upcoming Garmin calendar events (races, goals, milestones) and primary race event.

Inputs: days, limit, startDate.

get_user_profileA

Get the signed-in user's Garmin Connect social profile, personal info, and settings.

Inputs: no named parameters.

get_user_statisticsA

Get lifetime activity totals per activity type for the signed-in user.

Inputs: no named parameters.

get_virtual_challengesB

Get available virtual challenges/expeditions on Garmin Connect.

Inputs: no named parameters.

get_vo2_maxB

Get latest VO2 max values as of a date, or VO2 max trend over a date range.

Inputs: date, endDate, startDate.

get_weight_goalsC

Get active weight goals over a date range.

Inputs: endDate, startDate.

get_weight_rangeA

Get weigh-ins grouped by day and averages over a date range (up to 13 months).

Inputs: endDate, startDate.

get_workout_by_idA

Get full steps and target details for a specific saved workout by workoutId.

Inputs: workoutId (required).

get_workoutsB

Get saved workouts from the user's Garmin Connect workout library.

Inputs: limit, start.

push_workout_to_deviceC

Queue a saved workout for delivery to a Garmin device.

Inputs: deviceId (required), workoutId (required), messageName.

quick_add_foodsC

Quick-add nutrition entries (calories/macros) to the food log for a specific date.

Inputs: items (required), date.

remove_gear_from_activityC

Remove a gear item association from a Garmin activity.

Inputs: gearUuid (required), activityId (required).

reschedule_workoutB

Move a scheduled workout to another calendar date.

Inputs: newDate (required), scheduleId (required).

schedule_workoutC

Schedule a saved workout onto a specific calendar date (YYYY-MM-DD).

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

search_foodsC

Search Garmin's food catalog by keyword.

Inputs: query (required), limit, start.

set_activity_nameC

Rename an existing Garmin activity.

Inputs: newName (required), activityId (required).

set_blood_pressureC

Log a manual blood pressure measurement (systolic, diastolic, pulse, optional notes).

Inputs: pulse (required), systolic (required), diastolic (required), date, +2 more.

unschedule_workoutA

Remove a scheduled workout from the Garmin Connect calendar (keeps the workout in library).

Inputs: scheduleId (required).

update_activityC

Update an activity's name, description, activity type, event type, or privacy.

Inputs: activityId (required), privacy, eventType, description, +2 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 103 tools

    Disambiguation3/5

    The set covers many clearly distinct Garmin domains, but several clusters overlap: get_activity_splits/get_activity_typed_splits/get_activity_split_summaries, nutrition food-log vs meal-summary tools, and calendar-week/month/year vs scheduled-workout tools. Descriptions help, but these clusters still create meaningful misselection risk.

    Naming Consistency4/5

    Nearly all tools use a predictable snake_case verb_noun pattern such as get_, add_, delete_, set_, schedule_, and download_. A few outliers like quick_add_foods and count_activities are minor deviations, but the overall convention is clear and readable.

    Tool Count2/5

    103 tools is far beyond a practical MCP tool surface and will make discovery and selection difficult for an agent. The broad Garmin domain explains many operations, but this set would benefit heavily from consolidation into grouped endpoints.

    Completeness3/5

    Read coverage is extensive across activities, health metrics, workouts, nutrition, devices, calendar, and gear. However, write/lifecycle coverage is uneven: there is no create/update workout, no create/update course, no create/update/delete goal, and only limited calendar-event creation beyond notes.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP-capable AI apps to query a user's own Garmin sleep, HRV, stress, Body Battery, heart-rate, activity, and body-metric data through Garmin's official Personal API in a read-only, locally run setup.
      14
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      A read-only MCP server that lets AI agents query a user's own Garmin Connect data via Garmin's official Personal API. It exposes activities, daily wellness metrics, sleep and recovery, and body/profile data as tools for natural-language analysis.
      21
      Apache 2.0