Overview
The problem
Architecture
Authentication flow
- Stored tokens. The server loads existing OAuth tokens from ~/.garminconnect/.
- Environment variables. With no stored tokens, it logs in with GARMIN_EMAIL and GARMIN_PASSWORD and saves the tokens it gets back.
- Interactive script. garmin_auth.py handles first-time setup, including the MFA prompt.
- Browser-assisted fallback. garmin_browser_auth.py covers the case where Cloudflare blocks the scripted login.
Tool design
Parallel data fetching
Unit conversion
Running it
Docker (recommended)
Any MCP client
Key design decisions
Tech stack
- Python 3.12 with FastMCP (pinned to 2.13.1) for the MCP server framework
- garminconnect (pinned to 0.2.34, garth-backed) for Garmin Connect API access (OAuth 1.0a)
- garth for browser-assisted OAuth ticket exchange against connectapi.garmin.com
- Streamable HTTP transport for client-agnostic connectivity
- concurrent.futures thread pool for parallel API fetching
- Docker with health checks and compose for deployment
- GitHub Actions to run the unit tests and publish the GHCR image
- MIT licensed and open source