io.github.matisdsp/fartlek
A local, offline Garmin training-analysis MCP server that synthesizes your exported Garmin data into compact, verdict-first coaching reports for any LLM.
Daily readiness verdict (
garmin_brief): GREEN/AMBER/RED go/modify/rest call against your own baselines, with alerts, yesterday's session and today's planned workout.Session deep dives (
garmin_activity,garmin_activities): execution vs. structure, rep-by-rep fade, decoupling, lap splits, HR/pace curves, and comparison to your most similar past session; browse the log to get activity IDs.Load & periodization (
garmin_load): CTL/ATL/TSB, ramp rate, ACWR, monotony/strain, intensity drift over multi-week windows.Recovery & overtraining (
garmin_recovery): sleep, HRV, resting HR, load structure vs. baselines, plus a multi-marker overtraining audit.Fitness & race planning (
garmin_fitness): VO2max and efficiency trends, durability, race projection against your goal, taper guidance.Weekly review (
garmin_week): day-by-day session table with activity IDs, intensity distribution, recovery and plan compliance.Change detection (
garmin_whats_changed): only statistically significant shifts over a window, ranked safety-first, or "nothing notable".Athlete profile (
garmin_athlete,garmin_set_profile): zones, thresholds, PRs, goal race/phase, availability, LT1 override.Subjective logging (
garmin_log): session RPE, Hooper wellness scores, illness/injury flags and notes, feeding sRPE load and capping readiness.Data management (
garmin_sync,garmin_setup): refresh, resumable historical backfill, configuration/coverage checks.Transparency & escape hatch (
garmin_reference,garmin_raw): formulas, inputs, caveats and trust level per metric; bounded, compacted raw access to named Garmin sources.CLI & storage:
fartlek import/accounts/export/reset, SQLite store at~/.fartlek(orFARTLEK_HOME), stdio transport, Docker support — no credentials or network needed.Token-disciplined: every response hard-capped (600–5,000 tokens per tool; ~17K for the whole catalog), with disclosed truncation.
Provides a coach's morning report from Garmin Connect data, including readiness verdicts, training load (CTL/ATL/TSB), acute:chronic workload, activity analysis, and more.
Click on "Deploy 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., "@io.github.matisdsp/fartlek Can I go hard today?"
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.
Fartlek
A coach's morning report from your Garmin data, for any LLM via MCP.
Every other Garmin MCP server hands the LLM a filing cabinet of raw JSON: one night of sleep is ~52K tokens, one activity stream ~155K. The model can't read it, so it skims and improvises. Fartlek does the synthesis server-side: computed sports-science metrics (CTL/ATL/TSB, ACWR, monotony, calibrated training load), personal baselines with significance floors, safety alerts, delivered as compact, verdict-first reports the model can actually reason about.
The token contract: calling every tool in the catalog once, at default arguments, costs under 17K tokens, about a third of one raw Garmin sleep payload (the sum of the caps below is 16,970; tests/test_guardrails.py fails above 17,000). Without garmin_raw and garmin_reference the sum is 9,970. Hard caps are enforced per response by the renderer, with disclosed truncation, and tests/test_budget_gate.py counts golden renders with a real tokenizer.
The tools
Caps are in tokens, as set in the code (CAP constants in fartlek/mcp_server/tools/).
Tool | What it answers | Cap |
| "How am I today, can I train hard?" Fused GREEN/AMBER/RED verdict vs your own baselines | 600 |
| Browse the log, get activity IDs | 1,300 |
| One session in depth: reps, fade, comparison to your most similar past session ( | 1,000 / 2,000 / 4,000 |
| Reference card: zones, PRs, goal, data coverage | 600 |
| Shoe and bike mileage vs the retirement limits you set in Garmin Connect, and what you actually rotate | 500 |
| Tell it your goal race, phase and availability (local only) | 200 |
| Log RPE, wellness, illness or injury; the athlete outranks the sensors | 120 |
| Re-read the export, or deepen history | 150 |
| Is the server configured, and what is missing; starts with the export | 400 |
| Sleep, HRV, resting HR and load structure vs baselines, plus the overtraining audit | 1,100 |
| Multi-week load: CTL/ATL/TSB, ramp, ACWR, monotony, intensity drift | 1,100 |
| VO2max and efficiency trends, race projection against your goal, taper guidance | 1,000 |
| One week in session-level detail, with load vs recent weeks | 1,200 |
| Only the statistically significant changes of the last N days | 700 |
| How a number was computed, and whether to trust it | 2,000 per topic |
| Bounded, compacted escape hatch to named raw sources | 5,000 |
Related MCP server: claude-garmin
Quickstart
pipx install fartlek-mcp # or: uv tool install fartlek-mcpIn your Garmin account, open Data Management > Export Your Data and request the export. Garmin emails you a download link. It says this usually takes about 48 hours and can take up to 30 days.
Import the zip. Nothing connects to Garmin and no credentials are involved:
fartlek import ~/Downloads/<your-export>.zipPoint your MCP client at the server. Claude Code:
claude mcp add fartlek -- fartlek-mcpAny other MCP client: add a stdio server whose command is fartlek-mcp.
The report stops at the day of the export. Importing a newer export updates the store. Your own settings and log entries are kept.
What the export does not contain
Compared on one real account against the Connect API, over 530 activities and 356 days: activities, laps, overnight HRV and sleep scores are identical after converting units, and daily totals match on 99 % of days or more. A one-account check is not a guarantee for other devices. The export lacks:
Missing | Effect |
Per-minute sleep stages | Sleep regularity index unavailable |
Garmin's nightly sleep need | Sleep debt uses 8 h, or the need you set |
HRV status and weekly average | Not shown; Fartlek's own HRV band does not use them |
Grade-adjusted speed per lap | Efficiency and decoupling use plain speed |
Model names of unrenamed gear | Gear may appear under its brand only |
Raw detail per session |
|
CLI
Command | What it does |
| fill the local store from a Garmin account export ( |
| list local accounts |
| export the store (SQLite snapshot and one CSV per table) |
| wipe all local data (asks confirmation) |
FARTLEK_HOME sets the data directory (default ~/.fartlek). The Dockerfile builds the same server: mount
a data volume on /data.
Privacy and Garmin's terms
Stdio transport, local SQLite store: your health data stays on your machine, and importing an export contacts nobody. The code also contains a direct connection to Garmin Connect. It is off by default and unsupported: it reads endpoints Garmin does not publish for third parties, which Garmin's Terms of Use do not allow, and Garmin can suspend accounts for automated access.
License & trademark
Apache 2.0. Fartlek is an independent open-source project, not affiliated with, endorsed by, or sponsored by Garmin Ltd. "Garmin" is used only to describe compatibility with Garmin Connect data.
Available Tools
14 toolsgarmin_activitiesARead-only
Browse the log and get activity IDs. One row per session, each carrying the activity_id garmin_activity accepts. Filter by date range and sport; truncation is disclosed with narrowing advice.
Inputs: limit, sport, end_date, start_date. Returns: result
garmin_activityARead-only
ONE session in depth: execution vs structure, rep-by-rep fade, decoupling, comparison to the closest past session, planned-vs-executed. Select by activity_id, by date, or omit both for the latest — add sport for the latest of that sport. 'splits' adds the lap table; 'full' adds an HR/pace curve.
Inputs: date, sport, detail, activity_id. Returns: result
garmin_athleteARead-only
Reference card: zones, thresholds, PRs, goal and phase, baselines, injury notes, device data coverage. Call once when athlete context is unknown; it changes rarely. To change it, garmin_set_profile.
Inputs: no named parameters. Returns: result
garmin_briefARead-only
Call FIRST for anything about TODAY: readiness, whether to train, current state. Zero arguments. Returns a fused go/modify/rest verdict against personal baselines, active alerts, yesterday's session with its activity_id, and today's planned workout. One session → garmin_activity; browsing → garmin_activities.
Inputs: date. Returns: result
garmin_fitnessARead-only
Is training working: VO2max and efficiency trends, HR at a fixed pace, long-run durability, a race projection against the stored goal, and form projected to race day with taper guidance. Call for 'am I getting fitter', race planning, taper timing, goal feasibility. Set the goal with garmin_set_profile.
Inputs: weeks, anchor_date. Returns: result
garmin_loadARead-only
Multi-week dose: fitness/fatigue/form (CTL/ATL/TSB), ramp rate, ACWR, monotony/strain, and intensity drift vs this athlete's own norm. Call for 'am I training too much', ramp/taper dosing, periodization. Not single-day readiness (garmin_brief); overtraining physiology is garmin_recovery.
Inputs: weeks, anchor_date. Returns: result
garmin_logAIdempotent
Subjective data the watch cannot capture: session RPE (1-10), Hooper wellness (fatigue, soreness, stress, mood, sleep quality, each 1-7), and notes — especially illness or injury (set flag; resolve when healed). Feeds sRPE load and caps the readiness verdict. Ask for RPE after discussing a session if missing.
Inputs: rpe, date, flag, mood, +7 more. Returns: result
garmin_rawARead-only
Bounded escape hatch to one named Garmin source, compacted and hard-capped. Use ONLY when a synthesis tool cannot answer and the user explicitly asks for raw values. Never a starting point.
Inputs: source (required), date, series, max_points, +1 more. Returns: result
garmin_recoveryARead-only
Sleep, HRV, resting HR and load structure vs personal baselines, plus the multi-marker overtraining audit. Call for tiredness, sleep, 'am I overtraining or getting sick', or when another tool flags recovery. OWNS overtraining questions. Single-day go/no-go is garmin_brief.
Inputs: days, anchor_date. Returns: result
garmin_referenceARead-only
How a number was computed and whether to trust it: formula, inputs, whether each threshold is a population default or personally derived, and the caveats. No arguments for the index; metric='acwr' for one in depth.
Inputs: topic, metric. Returns: result
garmin_set_profileAIdempotent
Athlete context the watch cannot know: goal race (date; a distance, or a fixed-time event like 24h with a target distance), phase, weekly availability, intensity preference, LT1 override. Local only; only provided fields change. Injuries and illness go to garmin_log.
Inputs: phase, goal_time, phase_week, tid_target, +7 more. Returns: result
garmin_syncA
Force a refresh and report freshness, or start a resumable historical backfill (backfill_days > 0, deepens sleep/HRV history). Use only if data looks stale — every other tool auto-refreshes.
Inputs: backfill_days. Returns: result
garmin_weekARead-only
One week in session-level detail: load vs recent weeks, intensity distribution, a per-day session table with activity_ids, recovery summary, and plan compliance where a plan exists. Call for 'how was my week' or a specific week. Multi-week trajectory is garmin_load.
Inputs: anchor_date. Returns: result
garmin_whats_changedARead-only
Call for 'anything I should know?', 'what's new?', 'catch me up', or after days away. Scans every tracked metric and returns ONLY statistically significant changes, ranked safety-first; says 'nothing notable' when nothing tripped. Today's readiness is garmin_brief.
Inputs: since_days. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose with explicit cross-references (e.g., garmin_brief owns today's readiness, garmin_recovery owns overtraining, garmin_load owns multi-week training dose). No two tools appear to do the same thing; even similar tools like garmin_activities/garmin_activity are distinguished by singular vs plural and description.
All tools share the garmin_ prefix and lowercase snake_case, but the pattern mixes nouns (garmin_activity, garmin_week), verbs (garmin_sync), verb phrases (garmin_set_profile), and a question (garmin_whats_changed). Read vs write is somewhat predictable (nouns for queries, verbs for actions), but not uniform.
14 tools is within the ideal 3-15 range and each tool covers a distinct aspect of Garmin data analysis: from daily brief to weekly summary, fitness trends, recovery, load, and raw data. The size feels justified for the domain.
The server covers the full workflow of an athletic coaching assistant: profile management, subjective logging, daily readiness, activity browsing and deep-dive, fitness/recovery/load analysis, week summaries, change detection, and reference/raw data escape hatches. Minor gaps exist (e.g., no direct plan editing or log deletion), but they are outside the stated purpose.
Maintenance
Related MCP Connectors
Adaptive running coach MCP server: training data, plans, and recovery for AI assistants.
Your training data in Claude, ChatGPT and any MCP client. Shape syncs workouts, sleep, HRV and daily health from Garmin (official partner API), Apple Health, Wahoo, Polar and more. It works out fitness, fatigue, form and readiness, and sends structured workouts to your Garmin, Apple Watch or Wahoo. Hosted, signs in with OAuth, no passwords in config files.
Your own Garmin data (sleep, HRV, Body Battery, activities) in Claude, ChatGPT and any MCP app.
tri-train is a training platform for triathletes that syncs activities from Strava and Garmin and exposes them to Claude through a remote MCP server. Ask Claude how your last block went, why your run pace dropped, or whether you are fresh enough for Sunday's race, and it answers from your real data: activities with laps and grade-adjusted pace, weekly load and the performance management chart (CTL/ATL/TSB), sleep, HRV and resting heart rate, and your race calendar with predictions. Claude can also act: create and adjust planned workouts with structured intervals, push them to your Garmin watch, add races and write notes. Every change is journaled and can be undone. Read and write access are separate OAuth scopes, and the server enforces them on every call. Built and hosted in Switzerland by a triathlete; data stays on our own servers (Swiss revDSG / GDPR).
Related MCP Servers
- FlicenseBqualityDmaintenanceA Model Context Protocol server that integrates Garmin Connect data with LLMs to provide personalized running analysis and training plans. It enables users to monitor performance metrics, manage training loads, and receive data-driven workout suggestions based on health indicators like VO2 Max and recovery status.435-
- AlicenseNot gradedqualityDmaintenanceMCP server that connects Garmin Connect data to Claude, enabling training analysis, recovery checks, and personalized plans based on real metrics like HRV, training load, and activities.26MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for Garmin Connect integration. Access your activities, health data, training metrics, and more through Claude and other LLMs.2270MIT
- AlicenseBqualityBmaintenanceAn MCP server that gives LLMs access to Garmin Connect data, including training, recovery, sleep, stress, VO2 Max, and running summaries for personalized fitness advice.2456 PyPI1MIT