Skip to main content

Garmin Workouts MCP Server

Project description

Garmin Workouts MCP Server

An MCP server that allows you to create, list, and manage Garmin Connect workouts using natural language descriptions through MCP-compatible clients.

Features

  • Create workouts: Generate structured Garmin workouts from natural language descriptions using AI
  • List workouts: View all your existing workouts on Garmin Connect
  • Get workout details: Retrieve detailed information about specific workouts
  • Schedule workouts: Schedule workouts on specific dates in Garmin Connect
  • Delete workouts: Remove workouts from Garmin Connect
  • MCP Integration: Works with any MCP-compatible client (Claude Desktop, etc.)

Setup

  1. Install and run using uvx:
uvx garmin-workouts-mcp
  1. Configure in your MCP client (e.g., Claude Desktop):

Add to your MCP client configuration:

{
  "mcpServers": {
    "garmin-workouts": {
      "command": "uvx",
      "args": ["garmin-workouts-mcp"],
      "env": { # See Authentication section for details
        "GARMIN_EMAIL": "your_email@example.com",
        "GARMIN_PASSWORD": "your_password"
      }
    }
  }
}

Authentication

The Garmin Workouts MCP Server authenticates with Garmin Connect using garth [https://github.com/matin/garth]. There are two primary ways to provide your Garmin credentials:

1. Using Environment Variables

You can set your Garmin Connect email and password as environment variables before starting the MCP server.

  • GARMIN_EMAIL: Your Garmin Connect email address.
  • GARMIN_PASSWORD: Your Garmin Connect password.

Example:

export GARMIN_EMAIL="your_email@example.com"
export GARMIN_PASSWORD="your_password"
uvx garmin-workouts-mcp

2. Out-of-Band Authentication with garth

Alternatively, you can log in to Garmin Connect once using the garth library directly and save your authentication tokens to a directory, which the MCP server will then use for subsequent sessions. This method is useful if you prefer not to store your credentials as environment variables or as part of your MCP client configuration.

To log in out-of-band:

  1. Install garth:

    pip install garth
    
  2. Run the following Python script in your terminal:

    import garth
    from getpass import getpass
    
    email = input("Enter email address: ")
    password = getpass("Enter password: ")
    # If there's MFA, you'll be prompted during the login
    garth.login(email, password)
    
    garth.save("~/.garth")
    

    Follow the prompts to enter your Garmin Connect email and password. Upon successful login, garth will save your authentication tokens to ~/.garth.

    The MCP server will automatically look for these saved tokens. If you wish to store them in a custom location, you can set the GARTH_HOME environment variable.

Usage

This server provides the following MCP tools that can be used through any MCP-compatible client:

Generate Workout Data Prompt

Use the generate_workout_data_prompt tool to create a prompt for an LLM to generate structured workout data:

generate_workout_data_prompt("10 min warmup, 5x(1km at 4:30 pace, 2min recovery), 10 min cooldown")

Upload Workout

Use the upload_workout tool to upload structured workout data to Garmin Connect:

upload_workout(workout_data_json)

Schedule Workout

Use the schedule_workout tool to schedule a workout on a specific date:

schedule_workout("workout_id_here", "2024-01-15")

Delete Workout

Use the delete_workout tool to remove a workout from Garmin Connect:

delete_workout("workout_id_here")

List Workouts

list_workouts()

Get Workout Details

get_workout("workout_id_here")

The tool supports various workout types:

  • Running: pace targets, distance/time based intervals
  • Cycling: power, cadence, speed targets
  • Swimming: time/distance based sets
  • Strength training: circuit-style workouts
  • General cardio: heart rate based training

Workout Description Examples

  • "30min easy run at conversational pace"
  • "5km tempo run at 4:15 min/km pace"
  • "10 min warmup, 3x(20min at 280w, 5min at 150w), 10min cooldown"
  • "Swimming: 400m warmup, 8x(50m sprint, 30s rest), 400m cooldown"
  • "Strength circuit: 5x(30s pushups, 30s squats, 30s plank, 60s rest)"

Environment Variables

  • GARMIN_EMAIL: Your Garmin Connect email address (optional)
  • GARMIN_PASSWORD: Your Garmin Connect password (optional)
  • GARTH_HOME: Custom location for Garmin credentials (optional, defaults to ~/.garth)

Credits

This project incorporates ideas and prompt designs inspired by openai-garmin-workout, which is licensed under the MIT License.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

garmin_workouts_mcp-0.4.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garmin_workouts_mcp-0.4.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file garmin_workouts_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: garmin_workouts_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for garmin_workouts_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c83208a3cf6af940af7ed9e1db6fd7d44dc6e0d067d27874d5dc0f9f76aa7dea
MD5 e8eecfa43acaac871a6bbaeda8685af5
BLAKE2b-256 2a2355b1ffa817c925e52fa626a060473d986bacaf16048a51d293984f4ce4b6

See more details on using hashes here.

File details

Details for the file garmin_workouts_mcp-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for garmin_workouts_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17d7b0ac06ab236ed933346c417d365cd57ed1d8063b06b4866dc1bd3bc1b6d4
MD5 106efe4d6d36ea09e09485ee31b95769
BLAKE2b-256 de4a0493b615acbb8eab680997b3a43052ddb9a90f810e5c95692848ea11e569

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page