Garmin Workouts MCP Server
Enables creation, management, and scheduling of Garmin Connect workouts from natural language descriptions, plus viewing activities, calendar data, and weather information from completed workouts.
README
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
- Activity management: List, view, and get weather data for completed activities
- Calendar integration: View calendar data with workouts and activities
- MCP Integration: Works with any MCP-compatible client (Claude Desktop, etc.)
Setup
- Install and run using uvx:
uvx garmin-workouts-mcp
- 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:
-
Install
garth:pip install garth -
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,
garthwill 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_HOMEenvironment 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")
List Activities
Use the list_activities tool to view completed activities (runs, rides, swims, etc.) from Garmin Connect:
list_activities()
Optional parameters:
limit: Number of activities to return (default: 20)start: Starting position for pagination (default: 0)activityType: Filter by activity type (e.g., "running", "cycling", "swimming")search: Search for activities containing specific text
Example with filters:
list_activities(limit=50, activityType="running", search="Marathon")
Get Activity Details
Use the get_activity tool to retrieve detailed information about a specific activity:
get_activity("activity_id_here")
Returns comprehensive activity data including distance, duration, pace, heart rate, and more.
Get Activity Weather
Use the get_activity_weather tool to get weather conditions during a specific activity:
get_activity_weather("activity_id_here")
Returns weather data including temperature, humidity, wind conditions, and weather descriptions.
Get Calendar Data
Use the get_calendar tool to view calendar data with workouts and activities:
get_calendar(2024, 7) # Monthly view for July 2024
get_calendar(2024, 7, 15) # Weekly view including July 15th
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
Creating New Workouts
"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)"
Querying Activities
"Show me my last 10 running activities""Find all cycling activities from last month""What was the weather like during my morning run on July 4th?""Get details for my longest run this year"
Supported Activity Types
The list_activities tool supports filtering by the following activity types:
running,cycling,swimming,walking,hikingfitness_equipment,multi_sport,yoga,divingauto_racing,motorcycling,surfing,windsurfingskiingvariants:backcountry_skiing_snowboarding_ws,cross_country_skiing_ws,resort_skiing_snowboarding_ws,skate_skiing_wsclimbingvariants:bouldering,indoor_climbingspecialized:breathwork,e_sport,safetywater_sports:offshore_grinding,onshore_grindingotherandwinter_sportsfor general categorization
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。