Garmin Connect MCP Server
A Model Context Protocol (MCP) server that exposes your Garmin Connect health and fitness data to AI assistants. Ask your AI about your sleep, heart rate, workouts, stress, body battery, and more.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
A Model Context Protocol (MCP) server that exposes your Garmin Connect health and fitness data to AI assistants. Ask your AI about your sleep, heart rate, workouts, stress, body battery, and more.
Connect AI assistants to Garmin Connect with 34 MCP tools for health metrics, workouts, training trends, and reports. Python, Streamable HTTP, and Docker support.
# 1. Authenticate with Garmin (one-time)
pip install 'garminconnect>=0.2.20,<0.3'
python garmin_auth.py
# If you hit a 429 from Cloudflare, use the browser-assisted fallback instead:
# python garmin_browser_auth.py
# (see "Browser-assisted login" under Authentication below)
# 2. Build and run
docker compose up -d
# Server is now at http://localhost:8000/mcp
# Install dependencies
pip install -r requirements.txt
# Authenticate (if you haven't already)
python garmin_auth.py
# Run the server
python garmin_mcp_server.py
# Or with FastMCP CLI:
fastmcp run garmin_mcp_server.py --transport streamable-http --host 0.0.0.0 --port 8000
Garmin Connect uses OAuth tokens stored in ~/.garminconnect/. Run the auth script once:
python garmin_auth.py
This will:
~/.garminconnect/Tokens last approximately one year. If they expire, just run garmin_auth.py again.
You can also set environment variables for non-interactive auth:
export GARMIN_EMAIL="[email protected]"
export GARMIN_PASSWORD="your-password"
Note on
garminconnectversion:requirements.txtpins to<0.3. The 0.3.x release rewrote the login flow with new strategies that Cloudflare currently 429s, and it also removed theclient.garthattribute this repo relies on. Stay on0.2.xuntil the upstream situation settles.
If garmin_auth.py fails with 429 Too Many Requests from sso.garmin.com, Garmin's Cloudflare is blocking the scripted login POST from your IP. Use the browser-assisted fallback instead:
python garmin_browser_auth.py
This script:
ticket=ST-... value back into the scriptconnectapi.garmin.com (a different host that isn't Cloudflare-walled) and writes the same ~/.garminconnect/oauth1_token.json and oauth2_token.json files that garmin_auth.py producesNo other code needs to change — garmin_mcp_server.py loads the resulting tokens the same way. The most reliable way to grab the ticket is to open Chrome DevTools → Network tab → enable "Preserve log" before clicking Sign In, then inspect the response body of the POST /sso/signin request and copy the ST-... value.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"garmin": {
"url": "http://localhost:8000/mcp"
}
}
}
Point your client at:
http://localhost:8000/mcp
The server uses Streamable HTTP transport, which is supported by the MCP SDK and most modern clients.
Add to your LiteLLM config.yaml:
mcp_servers:
garmin:
url: "http://localhost:8000/mcp"
transport: "streamable-http"
If your client only supports stdio, you can run directly:
{
"mcpServers": {
"garmin": {
"command": "python",
"args": ["path/to/garmin_mcp_server.py"]
}
}
}
Once connected, ask your AI things like:
├── garmin_mcp_server.py # MCP server (34 tools)
├── garmin_auth.py # One-time Garmin authentication
├── garmin_browser_auth.py # Browser-assisted auth fallback (Cloudflare 429 workaround)
├── run_mcp_server.sh # Server launch script
├── Dockerfile # Container build
├── docker-compose.yml # Docker Compose config
├── requirements.txt # Python dependencies
└── LICENSE # MIT
Authentication failed: Run python garmin_auth.py to re-authenticate. Tokens may have expired.
429 Too Many Requests on login: Garmin's Cloudflare is rate-limiting the scripted login POST to sso.garmin.com/sso/signin. Use python garmin_browser_auth.py instead (see the Browser-assisted login section) — it signs you in via your real browser and then exchanges the SSO ticket against connectapi.garmin.com, which isn't blocked the same way. Also make sure you're on garminconnect<0.3 — the 0.3.x rewrite hits the same wall with every strategy it tries.
AttributeError: 'Garmin' object has no attribute 'garth': You're on garminconnect>=0.3.0, which dropped the garth attribute this repo uses. Downgrade with pip install 'garminconnect>=0.2.20,<0.3'.
Empty data for some metrics: Your Garmin device may not track that metric, or data hasn't synced yet.
Connection refused: Make sure the server is running and port 8000 is accessible. For Docker, check docker compose logs.
MIT — see LICENSE
Connect AI assistants to Garmin Connect with 34 MCP tools for health metrics, workouts, training trends, and reports. Python, Streamable HTTP, and Docker support.
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Garmin 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 Connect AI assistants to Garmin Connect with 34 MCP tools for health metrics, workouts, training trends, and reports. Python, Streamable HTTP, and Docker support.