garmin-mcp-server

garmin-mcp-server

MCP server that connects AI assistants to Garmin Connect health and fitness data, enabling natural language queries about workouts, sleep, heart rate, and more.

Category
访问服务器

README

Garmin Connect MCP Server

A Model Context Protocol (MCP) server that connects AI assistants to your Garmin Connect health and fitness data. Ask Claude, ChatGPT, OpenCode, or any MCP-compatible client about your workouts, sleep, heart rate, and more -- using natural language.

Built on python-garminconnect and the MCP Python SDK.

Features

29 tools across 6 categories, giving your AI assistant access to:

Category Tools Examples
Health 5 Daily summary, heart rate, sleep stages, stress, body battery
Activities 4 Recent workouts, search by date/type, detailed splits
Body 3 Weight trends, body composition, hydration tracking
Fitness 6 Training readiness, VO2 Max, HRV, race predictions, endurance score
Devices 6 Device info, step trends, personal records, SpO2, respiration, goals
Export 5 Download FIT, GPX, TCX, KML, and CSV files

Quick Start

Prerequisites

  • Python 3.10+
  • uv package manager
  • A Garmin Connect account with a paired device

1. Clone and install

git clone https://github.com/JohanBellander/garmin-mcp-server.git
cd garmin-mcp-server
uv sync

2. Authenticate with Garmin

Run the one-time setup to save your OAuth tokens:

uv run garmin-mcp-setup

You'll be prompted for your email, password, and MFA code (if enabled). Tokens are saved to ~/.garminconnect/ and last approximately one year -- you won't need to re-authenticate until they expire.

3. Connect to your AI assistant

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "garmin": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/garmin-mcp-server",
        "run",
        "garmin-mcp-server"
      ]
    }
  }
}

OpenCode

Add to your .opencode.json MCP config:

{
  "mcp": {
    "garmin": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/garmin-mcp-server",
        "run",
        "garmin-mcp-server"
      ]
    }
  }
}

Any MCP Client

The server uses STDIO transport. Point your client at:

uv --directory /path/to/garmin-mcp-server run garmin-mcp-server

Example Conversations

Once connected, you can ask your AI assistant things like:

  • "How did I sleep last night?"
  • "Show me my runs from the past two weeks"
  • "What's my training readiness today?"
  • "Compare my resting heart rate over the last 7 days"
  • "Download the GPX file for my last bike ride"
  • "What are my race predictions for a half marathon?"
  • "How many steps have I averaged this month?"

Available Tools

Health Data

Tool Description
get_daily_summary Steps, distance, calories, floors climbed, active minutes for a date
get_heart_rate Resting HR, min/max, heart rate zone breakdown
get_sleep Sleep duration, stages (deep/light/REM/awake), sleep score
get_stress All-day stress levels, average, duration by category
get_body_battery Energy reserve levels throughout the day

Activities

Tool Description
get_recent_activities Most recent workouts with key metrics
get_activities_by_date Activities in a date range, filterable by type (running, cycling, etc.)
get_activity_details Full detail for a specific activity: pace, HR zones, elevation, training effect
get_activity_splits Per-split/lap breakdown: pace, distance, HR, elevation

Body Composition

Tool Description
get_weight Weight measurements, BMI, body fat %
get_body_composition Weight, body fat, muscle mass, bone mass, body water
get_hydration Daily water intake and progress toward goal

Fitness Metrics

Tool Description
get_training_readiness Readiness score, HRV status, sleep quality, recovery time
get_vo2max Estimated VO2 Max for running and cycling
get_training_status Training load and status classification
get_race_predictions Predicted times for 5K, 10K, half marathon, and marathon
get_hrv Heart Rate Variability: status, weekly average, baseline
get_endurance_score Aerobic fitness score over time

Export & Download

Tool Description
download_activity_fit Original FIT file (as ZIP) -- raw sensor data
download_activity_gpx GPX track -- GPS coordinates for mapping
download_activity_tcx TCX file -- GPS + HR + cadence
download_activity_kml KML file -- for Google Earth
download_activity_csv CSV file -- tabular data for spreadsheets

Additional Tools

Tool Description
get_devices Connected devices: model, firmware, battery, last sync
get_daily_steps Step counts per day over a date range
get_personal_records Personal bests across all activities
get_respiration Breathing rate: waking, sleeping, high, low
get_spo2 Blood oxygen saturation readings
get_goals Active fitness goals and current progress

Configuration

Environment Variable Default Description
GARMIN_TOKEN_STORE ~/.garminconnect Directory where OAuth tokens are stored
GARMIN_EXPORT_DIR ~/garmin-exports Directory for downloaded activity files

Development

Testing with MCP Inspector

uv run mcp dev src/garmin_mcp/server.py

This opens a web UI where you can invoke tools individually and inspect responses.

Project Structure

src/garmin_mcp/
├── server.py            # FastMCP server entry point
├── auth.py              # OAuth token management + garmin-mcp-setup CLI
└── tools/
    ├── health.py        # Daily health metrics
    ├── activities.py    # Workout listing and details
    ├── body.py          # Weight, body composition, hydration
    ├── fitness.py       # Training metrics, HRV, race predictions
    ├── devices.py       # Devices, steps, records, SpO2, goals
    └── export.py        # Activity file downloads

Important Notes

  • Unofficial API -- This uses undocumented Garmin Connect endpoints via python-garminconnect. Endpoints may change without warning.
  • Rate Limits -- Garmin enforces rate limits. Avoid rapid-fire requests; the AI assistant handles this gracefully with error messages.
  • Token Refresh -- The underlying garth library handles token refresh automatically. Tokens typically last ~1 year.
  • STDIO Safety -- The server never writes to stdout (which would corrupt the MCP transport). All logging goes to stderr.
  • No Interactive Auth -- The MCP server only uses pre-saved tokens. Run garmin-mcp-setup separately to authenticate.

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选