garmin-mcp
Enables retrieval of Garmin Connect data such as activities, sleep, heart rate, and body battery levels using unofficial API through MCP tools.
README
garmin-mcp
Garmin Connect data (activities, sleep, heart rate, body battery) as MCP tools.
An MCP server built on the unofficial garminconnect library, which authenticates via the same SSO flow as the Garmin Connect mobile app. There's no official public API for personal Garmin data, so this reverse-engineered client is the standard approach.
Setup
1. Install dependencies
cd /Users/ronkatz/tools/garmin-mcp
uv pip install -e .
2. One-time login (handles MFA if enabled)
GARMIN_EMAIL=you@example.com GARMIN_PASSWORD=yourpassword python3 auth_setup.py
This caches a token at ~/.garminconnect. Re-run it any time the token expires.
3. Register with Claude
Add to ~/.claude.json under mcpServers (same pattern as google-docs):
"garmin": {
"command": "uvx",
"args": ["--from", "/Users/ronkatz/tools/garmin-mcp", "garmin-mcp"],
"env": {
"GARMIN_EMAIL": "you@example.com",
"GARMIN_PASSWORD": "yourpassword"
}
}
Restart Claude Code / Claude Desktop after adding this.
Tools
get_activities(limit=10)— recent workouts/activitiesget_resting_heart_rate(cdate=None)— heart rate data for a date (defaults to today)get_sleep(cdate=None)— sleep data for a date (defaults to today)get_body_battery(startdate=None, enddate=None)— body battery levels for a date range (defaults to today)
Architecture
Auth and login logic (garmin_auth.py) is shared by every consumer in this repo:
garmin_auth.py (TOKEN_STORE, get_client(), login_interactive())
├── server.py MCP server (stdio) — used by local Claude Code sessions
├── auth_setup.py one-time interactive login (handles MFA)
└── scripts/fetch.py plain CLI, no MCP — same data, used by the
remote Garmin → Calendar sync routine (claude.ai)
scripts/fetch.py exists so the remote routine can clone this repo and call
real, reviewed code instead of carrying its own copy-pasted fetch logic:
python3 -m scripts.fetch activities [--limit N]
python3 -m scripts.fetch resting-hr [--date YYYY-MM-DD]
python3 -m scripts.fetch sleep [--date YYYY-MM-DD]
python3 -m scripts.fetch body-battery [--start YYYY-MM-DD] [--end YYYY-MM-DD]
Refreshing the token used by the remote routine
The remote routine reads Garmin auth from its own GARMIN_TOKENS_B64 env
var (base64 of ~/.garminconnect/garmin_tokens.json), decoded into its
sandbox at the start of each run. It drifts out of sync whenever the local
token is refreshed and the routine's copy isn't updated — this is what
caused a prior 401 failure.
When the routine fails with a 401:
./scripts/print_token_b64.sh
This verifies the local token still logs in (refresh first via
auth_setup.py if not), then prints the base64 value to paste into the
routine's GARMIN_TOKENS_B64 env var in claude.ai routine settings.
There's no known API to update a routine's env vars remotely, so this
paste step stays manual.
Notes
- This library is unofficial and reverse-engineered from Garmin's mobile app; it can break when Garmin changes internal endpoints.
- Credentials should only live in
~/.claude.json's localenvblock, the remote routine's own env var settings, or a local, gitignored.env— never committed to this repo.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.