garmin-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@garmin-mcpshow my last 3 runs with heart rate data"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
garmin-mcp
MCP server that exposes Garmin Connect data and workout management to AI agents. Supports tools, resources, and prompts — covering reading health data, creating and scheduling structured workouts, and guided coaching workflows.
Setup
git clone https://github.com/marcelohensantos/garmin-mcp
cd garmin-mcp
make setupmake setup handles everything interactively:
prompts for your Garmin Connect credentials and creates
.envcreates the virtual environment and installs dependencies
tests the connection against the Garmin API
prints the exact JSON snippet to paste into your MCP client
First login triggers a Garmin OAuth flow. If you have MFA enabled, check your email for a verification link, then re-run
make setupormake check.
Switching accounts? Clear the cached tokens first:
make clean-auth && make setup
Configure your MCP client
Claude Desktop — edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"garmin": {
"command": "/path/to/garmin-mcp/.venv/bin/python",
"args": ["/path/to/garmin-mcp/src/server.py"]
}
}
}Claude Code — add to .mcp.json at the project root:
{
"mcpServers": {
"garmin": {
"command": "/path/to/garmin-mcp/.venv/bin/python",
"args": ["/path/to/garmin-mcp/src/server.py"]
}
}
}Restart the client after saving.
Docker (no Python setup required)
# First run — authenticate and cache OAuth tokens
docker run --rm -it \
--env-file .env \
-v garmin-tokens:/root/.garminconnect \
--entrypoint python \
ghcr.io/marcelohensantos/garmin-mcp src/check.py
# MCP client config
{
"mcpServers": {
"garmin": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"--env-file", "/path/to/garmin-mcp/.env",
"-v", "garmin-tokens:/root/.garminconnect",
"ghcr.io/marcelohensantos/garmin-mcp"
]
}
}
}The garmin-tokens volume persists OAuth tokens across container restarts — you only authenticate once. Create .env with your credentials before the first run (see Setup).
Related MCP server: GC-MCP
Available tools
Activities
Tool | Description |
| Most recent N activities; optional |
| Activities in a date range; same optional |
| Full details for one activity |
| Download GPX / TCX / FIT / CSV for one activity |
| Summary CSV for a date range |
Health & wellness
Tool | Description |
| Daily steps, calories, floors |
| Heart-rate timeline |
| Sleep stages and score |
| Stress levels throughout the day |
| Body Battery charge curve |
| Weight, BMI, body fat |
| Heart Rate Variability |
| Blood oxygen saturation |
Training & fitness
Tool | Description |
| Training load and status |
| All-time PRs |
| VO2 max estimates |
Workouts & calendar
Tool | Description |
| Structured running workout — pace zones, repeat groups, distance/time-based steps |
| Update an existing running workout in-place via PUT (preserves calendar scheduling) |
| Structured pool swimming workout — stroke types, pool length, repeat groups |
| Strength session — exercises grouped as repeat sets with weight and rest |
| Schedule an existing workout on the Garmin calendar |
| List saved workouts |
| Delete a workout by ID |
| List scheduled workouts in a date range |
Plans
Tool | Description |
| Persist an agent-generated training plan as JSON to |
Profile & devices
Tool | Description |
| Account profile |
| Linked Garmin devices |
| Shoes, bikes, and other gear |
Resources
Resources provide persistent context the agent can read without an explicit tool call.
URI | Contents |
| User profile + all personal records |
| Today's stats, Body Battery, HRV, and sleep snapshot |
Both resources are cached for 5 minutes to avoid redundant API calls.
Prompts
Guided workflow templates for common coaching tasks.
Prompt | Purpose |
| Step-by-step guide: spec format, pace syntax, examples, schedule call |
| Multi-step protocol: assess recovery data → check calendar → create and schedule workouts |
| Pre-session readiness: Body Battery, HRV, sleep, stress → go / reduce / rest decision |
Project layout
src/
├── server.py # Entry point — imports all modules to trigger registration
├── app.py # FastMCP instance (shared across all modules)
├── auth.py # Garmin client singleton; wraps login errors in GarminAuthError
├── cache.py # @cached(ttl_seconds) in-memory TTL decorator
├── errors.py # GarminAPIError hierarchy + tool_guard decorator
├── utils.py # serialize(), today(), export_dir()
├── resources.py # MCP resources: athlete/profile, health/today
├── prompts.py # MCP prompts: create_running_workout, plan_training_week, …
├── check.py # Connectivity smoke test (make check)
└── tools/
├── builder.py # WorkoutBuilder base class + repeat_group() helper
├── running.py # RunningBuilder + create/update_running_workout
├── swimming.py # SwimmingBuilder + create_swimming_workout
├── strength.py # StrengthBuilder + create_strength_workout
├── calendar.py # schedule, get, delete, get_scheduled workouts
├── activities.py # Activity retrieval, filtering, and export
├── health.py # Health & wellness tools (cached 5 min)
├── training.py # Training status, VO2 max, PRs (cached 5–10 min)
├── profile.py # User profile, devices, gear (cached 10 min)
└── plans.py # save_plan — persist plans to data/
tests/
├── unit/ # Mocked — 50 tests, no network required
└── integration/ # Live tests against Garmin Connect APIRunning tests
# Unit tests (no credentials needed)
make test
# Integration tests (requires real Garmin account)
make test-integrationNotes
Caching — health, training, and profile tools cache responses for 5–10 minutes. If you need fresh data immediately, restart the server.
Error types — API errors are typed:
GarminAuthError,GarminRateLimitError,GarminNotFoundError. Tools return{"error": "...", "type": "..."}on failure.Exported files land in
~/garmin_exports/.MFA accounts — set
return_on_mfa=Trueinauth.pyand handle the prompt manually.First run triggers a full OAuth login; subsequent runs reuse cached tokens at
~/.garminconnect/.Pace zones —
pace.zonetargets use m/s internally (targetValueOne > targetValueTwo). Single pace"4:31"applies a tolerance (default ±10 s); range["5:26", "5:59"]uses exact bounds.Easy runs — a single no-pace interval with warmup/cooldown merges into one time step + lap-button cooldown.
Distance-based warmup/cooldown — use
warmup_km+warmup_pace: ["fast", "slow"]for E zone guidance on distance steps.Bodyweight exercises — set
weight_kg: -1.0increate_strength_workout.Activity filter —
get_activitiesfilters byactivityType.typeKeyclient-side; use a largerlimitwhen filtering to avoid truncation before the filter runs.save_planalways writes to~/devel/garmin/data/— the directory is created if absent.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/marcelohensantos/garmin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server