SuperAPIAI Directory

garmin-local-mcp

github.com · AI coding

Local-first Garmin data warehouse: incremental SQLite sync with trends, lag-aware correlations, personal baselines, anomaly detection and FIT-file import.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Local-first Garmin data warehouse with an analysis-grade MCP server. Sync once, analyze forever, and it keeps working even during API outages.

Purpose

This tool is designed to solve the problems caused by most Garmin MCP servers acting merely as thin real-time wrappers around an unofficial API: every query generates a large number of real-time API calls returning raw JSON (a single raw sleep response is about 230 KB), making multi-month questions (such as "How does my sleep correlate with training load?") expensive to query. This tool stores data in a local warehouse, performs analysis locally, and returns compact columnar tables, avoiding consumption of the model context.

Key capabilities

· Incremental sync to a local data warehouse: immutable raw JSON snapshots plus a SQLite database, stored in a user-owned directory. · Compact responses: trends, correlations, baselines, and anomaly detection are all computed locally, with typical responses under 2 KB (even the richest circadian one is under 3 KB). · Offline resilience: API outages only pause new syncs; all queries over already-synced history continue to work, and FIT imports can fill gaps. · Curated tools: 13 composable tools. · Sleep timing and chronotype analysis: estimate chronotype (MCTQ MSFsc), sleep need, and circadian-aligned wake windows based on watch sleep timing, and test whether that inference correlates with actual Garmin scores. · Login-free FIT import: independently decode Garmin's undocumented wellness FIT messages (sleep score, HRV, skin temperature, sleep stages, naps), with no credential requirements, and it remains usable when Garmin authentication is down. · Lagged correlation analysis: compute Pearson and Spearman correlations between any two metrics, and scan lags from -7 to +7 days, answering questions such as "Does training load raise next-day resting heart rate?"

How to use

Requires Python 3.12+. It can be installed via pip (pip install garmin-local-mcp), or run directly with uvx.

  1. First login (MFA supported, tokens persisted locally, no password needed for subsequent runs).
  2. Backfill history: sync is resumable, safe to interrupt, and rate-limited against Garmin servers. About 1800 requests for one year of history; long backfills can run overnight, and if rate-limited or interrupted, simply rerun the same command to resume.
  3. Register the MCP server with the client (supports Claude Desktop, Cursor, etc.; the server uses stdio, and any MCP client can be used).
  4. Ask questions: for example, "How does my sleep score correlate with next-day resting heart rate?" "What were my abnormal HRV dates this quarter?" "Show a comparison of weekly training load and sleep over the past 3 months."

FIT import steps: Log in to Garmin Connect, go to the bottom of the account information page under "Export Wellness Data," select a date to export a daily zip package, unzip it, and run garmin-local-mcp import-fit "path" to repeatedly fill in missing dates.

Use cases

· Users who want to retain and analyze their personal Garmin data long term and do not want to be affected by API instability. · Scenarios that require trend and correlation analysis across multiple months and are sensitive to model context consumption. · Users who, during Garmin API outages, still want to continue importing data through manually exported FIT files. · Users without a Garmin account can also experience the tool's features through synthetic data (demo command); the synthetic data is not random and contains analyzable latent patterns.

Limitations

· Requires Python 3.12+ or uv. · Login and initial backfill are CLI steps; the MCP server itself never prompts for credentials. · Only sync and import_fit write to the data directory. · The "evidence" level in circadian rhythm analysis reflects the consistency of the pattern across unseen nights, not statistical significance, and requires at least 180 days of history. · Garmin watches may report temporary resting heart rate that differs greatly from the final value; this tool will flag it and retain the field for API backfill. · Performance scores (endurance, climbing, readiness, race predictions) update at Garmin's own pace and are not included in gap detection. · The circadian rhythm-compatible wake window is inferred, not MCTQ output; not displaying wake time changes physiology. · Shift workers (with daytime main sleep) receive only rhythm and chronotype, with no wake window. · This project is not affiliated with or endorsed by Garmin.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools