garmin-mcp
Enables Claude to access and query your Garmin Connect data, including sleep, activities, training load, and health metrics, through a set of read-only MCP tools.
README
garmin-mcp
A remote MCP (Model Context Protocol) server that exposes your Garmin Connect data to Claude as tools. Add it once as a custom connector in Claude.ai (web, desktop, mobile) and you can ask questions like "how did I sleep last night?" or "summarise my training load this week" without copy-pasting screenshots from the Garmin app.
It is single-user, read-only, and designed to deploy to Google Cloud Run for under one dollar a month.
What it does
The server logs into Garmin Connect on your behalf using the unofficial garminconnect Python library, caches the session tokens, and exposes a fixed set of tools over the MCP streamable-HTTP transport. Claude calls those tools when you ask a question that needs Garmin data.
Tools
| Tool | What it returns |
|---|---|
get_sleep |
Sleep duration, stages (deep / light / REM / awake), score, overnight HRV. |
get_recent_activities |
List of recent activities with type, duration, distance, average heart rate. |
get_activity_details |
Full metrics for one activity, including splits, HR zones, and power. |
get_training_load |
Daily training load with acute (ATL), chronic (CTL), and current status. |
get_hrv_status |
Current HRV status, baseline range, and the last 7 nights of readings. |
get_body_battery |
Body battery values across the day with min, max, charged, drained. |
get_steps_and_calories |
Daily step count, distance, calories, floors, and intensity minutes. |
get_resting_heart_rate |
Resting heart rate trend and average over the requested window. |
get_stress |
Stress levels across the day and time-in-zone breakdown. |
Every response is a Pydantic model serialised to JSON, with null for fields Garmin did not record.
Quick start (local)
Requirements: Python 3.12 or later and uv.
# 1. Install dependencies
uv sync
# 2. Configure credentials
cp .env.example .env
# edit .env with your Garmin login
# 3. Inspect the tools in the MCP dev inspector
uv run mcp dev src/garmin_mcp/server.py
mcp dev runs the server over stdio and opens the MCP inspector in your browser. From there you can call any tool and see the JSON it returns. Auth is skipped in stdio mode, so you only need the Garmin credentials set.
To run the production HTTP server locally:
uv run python -m garmin_mcp
# server listens on http://localhost:8080/mcp
Deploying
See DEPLOY.md for the full Cloud Run walkthrough, including building the container, configuring environment variables, and adding the deployed URL as a custom connector in Claude.
How auth works
The server is its own OAuth 2.1 authorisation server. When you add the connector in Claude, Claude registers itself with the server using RFC 7591 Dynamic Client Registration, then sends you through a PKCE-protected authorisation flow. You enter the password you set as MCP_AUTH_PASSWORD, and the server issues a 24-hour JWT access token plus a refresh token that rotates on every use.
This is intentionally minimal: one password, one user. If someone has the password they can read your Garmin data.
Security caveats
- Garmin credentials live in environment variables on Cloud Run. They never leave the server, but anyone with access to the Cloud Run console can read them. Use a Garmin account that does not double as anything important. Disabling MFA on Garmin is required for unattended login.
- The OAuth password is stored as a plain env var and compared with
secrets.compare_digest. Pick a long, random one (32+ bytes). - The unofficial
garminconnectlibrary can break when Garmin changes their internal API. If a tool starts returning empty data, check that package's changelog. - In-memory state (registered clients, refresh tokens) is wiped on every cold start. You will be re-prompted to authorise after the server has been idle for a while; this is expected.
- This server is read-only. It does not write activities, edit profile fields, or upload anything to Garmin.
Project layout
garmin-mcp/
├── pyproject.toml
├── Dockerfile
├── .env.example
├── README.md
├── DEPLOY.md
├── src/
│ └── garmin_mcp/
│ ├── __init__.py
│ ├── __main__.py # python -m garmin_mcp -> HTTP server
│ ├── server.py # FastMCP app, tools, login UI
│ ├── garmin_client.py # garminconnect wrapper
│ ├── auth.py # OAuth 2.1 provider
│ ├── cache.py # TTL cache
│ └── models.py # Pydantic response models
└── tests/
├── test_cache.py
└── test_tools.py
Running tests and lints
uv run pytest # unit tests
uv run ruff check . # lint
uv run ruff format --check .
uv run mypy src tests # type check
Acknowledgements
garminconnectby cyberjunky for doing the hard work of reverse-engineering the Garmin Connect API.- The Model Context Protocol team for the SDK.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.