Garmin MCP Server

Garmin MCP Server

Integrates with Garmin Connect to retrieve activity data, health metrics, and provide AI-powered training insights and personalized coaching recommendations based on your fitness activities and performance trends.

Category
访问服务器

README

Garmin MCP Server

A Model Context Protocol (MCP) server that integrates with Garmin Connect to provide activity insights and training suggestions for Claude Desktop.

Features

  • Activity Tracking: Retrieve recent activities from Garmin Connect
  • Activity Insights: Get detailed analysis of individual activities or activity patterns
  • Training Suggestions: AI-powered recommendations based on your training data and health metrics
  • Health Metrics: Access to comprehensive health data including heart rate, sleep, stress, and body battery
  • Performance Analysis: Automated analysis of training load, recovery, and performance trends

Installation

  1. Clone or download this repository

  2. Install dependencies:

    cd garmin-mcp
    npm install
    
  3. Build the TypeScript code:

    npm run build
    

Configuration

Environment Variables Setup (Recommended)

For security and convenience, you can store your Garmin Connect credentials in environment variables:

  1. Create a .env file:

    touch .env
    
  2. Add your credentials to the .env file:

    # .env
    GARMIN_USERNAME=your.email@example.com
    GARMIN_PASSWORD=your_secure_password
    GARMIN_AUTO_AUTH=true
    
  3. Secure the file:

    chmod 600 .env
    

With environment variables configured, the MCP server will:

  • Automatically authenticate on startup (if GARMIN_AUTO_AUTH=true)
  • Use your stored credentials as fallback for authentication commands
  • Keep your credentials secure and out of version control

Claude Desktop Setup

Add the MCP server to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\\Claude\\claude_desktop_config.json

{
  "mcpServers": {
    "garmin": {
      "command": "node",
      "args": ["path/to/garmin-mcp/dist/index.js"]
    }
  }
}

Triathlon Expert Mode (Recommended)

For the best coaching experience, add the triathlon expert prompt to your Claude project:

  1. Create or open your project in Claude Desktop
  2. Add the expert prompt by copying the contents of TRIATHLON_EXPERT_PROMPT.md to your project's context
  3. Enable code execution in your project settings for accurate calculations

This prompt transforms Claude into a world-class triathlon coach that:

  • Uses code for all calculations to prevent estimation errors
  • Provides data-driven training insights
  • Offers personalized coaching based on your Garmin data
  • Analyzes performance trends with scientific accuracy

Garmin Connect Authentication

The MCP server supports multiple authentication methods:

Option 1: Environment Variables (Recommended)

Set up your .env file as described above. The server will automatically authenticate on startup.

Option 2: Manual Authentication

Use the authenticate_garmin tool within Claude Desktop. If you have environment variables set, you can simply call:

  • "Please authenticate with Garmin Connect" (uses env vars)
  • Or provide credentials manually: "Authenticate with username X and password Y"

Important: Credentials are only stored in memory during the session and are not persisted to disk.

Available Tools

1. authenticate_garmin

Authenticate with Garmin Connect using your username and password.

Parameters:

  • username: Your Garmin Connect username
  • password: Your Garmin Connect password

2. get_activities

Retrieve recent activities from Garmin Connect.

Parameters:

  • days (optional): Number of days to look back (default: 30)
  • limit (optional): Maximum number of activities to return (default: 50)

3. get_activity_insights

Get detailed insights for a specific activity or recent activities.

Parameters:

  • activityId (optional): Specific activity ID to analyze
  • days (optional): Number of days to analyze if no activity ID specified (default: 7)

4. get_training_suggestions

Get AI-powered training suggestions based on recent activities and performance.

Parameters:

  • activityType (optional): Type of activity to focus on ('running', 'cycling', 'swimming', 'strength', 'all')
  • days (optional): Number of days of history to consider (default: 14)

5. get_health_metrics

Get health and wellness metrics from Garmin Connect.

Parameters:

  • startDate (optional): Start date in YYYY-MM-DD format
  • endDate (optional): End date in YYYY-MM-DD format
  • metrics (optional): Specific metrics to retrieve (['heartRate', 'stress', 'sleep', 'bodyBattery', 'vo2Max'])

Usage Examples

Getting Started

  1. Authenticate: "Please authenticate with my Garmin Connect account"
  2. View Recent Activities: "Show me my recent activities"
  3. Get Insights: "Analyze my running performance from the last week"
  4. Training Advice: "Give me training suggestions based on my recent workouts"

Detailed Analysis

  • "What are my sleep patterns and how do they affect my recovery?"
  • "Analyze my heart rate trends during cycling activities"
  • "Give me specific recommendations for improving my running pace"
  • "How is my training load compared to my recovery metrics?"

Data Privacy

  • This MCP server accesses your Garmin Connect data only during active sessions
  • No data is stored permanently on your device
  • Authentication credentials are not persisted between sessions
  • All data processing happens locally on your machine

Dependencies

  • @modelcontextprotocol/sdk: MCP SDK for TypeScript
  • garmin-connect: Unofficial Garmin Connect API client
  • zod: Schema validation

Development

To run in development mode:

npm run dev

To build:

npm run build

Limitations

  • Requires valid Garmin Connect credentials
  • Depends on the unofficial Garmin Connect API (may break with Garmin updates)
  • Some advanced metrics may not be available depending on your Garmin device
  • Rate limiting by Garmin Connect may apply

Troubleshooting

Authentication Issues

  • Ensure your Garmin Connect credentials are correct
  • Check if your account requires two-factor authentication (not currently supported)
  • Verify your account is not locked or suspended

Missing Data

  • Some metrics require specific Garmin devices
  • Ensure your device is synced with Garmin Connect
  • Check that the requested date range contains activities

Connection Issues

  • Verify your internet connection
  • Check if Garmin Connect services are operational
  • Try authenticating again if the session has expired

License

MIT License - see LICENSE file for details

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选