garmin-grafana-mcp-server
Reads directly from the InfluxDB instance managed by garmin-grafana and exposes its fitness data to MCP clients, with tools for activities and lap/session details, daily stats, sleep and recovery, resting HR, HRV, VO2 max, race predictions, body composition, time-in-HR-zone, plus Garmin training status and training readiness metrics. Schema names and InfluxDB v1/v2 connection settings are configurable.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
garmin-grafana-mcp-server
An optional, self-hosted Model Context Protocol (MCP) server that exposes your Garmin training data to AI assistants. It is designed as a companion add-on to the arpanghosh8453/garmin-grafana project and reads directly from the InfluxDB instance that garmin-grafana already manages.
This server is a pure data access layer. It returns raw numbers from InfluxDB. All interpretation, analysis, and planning is delegated to the AI model consuming the tools β this server makes no assumptions about your fitness goals.
Table of Contents
Related MCP server: garmin-mcp
How it fits into the ecosystem
Garmin Device
β
βΌ
garmin-grafana β you already have this running
ββ Garmin API sync
ββ InfluxDB (stores your data)
ββ Grafana (dashboards)
garmin-grafana-mcp-server β this repo adds this
ββ Reads from the same InfluxDB
ββ Exposes MCP tools to AI clients (Claude, Copilot, etc.)πͺ See it in action: The AI Coach
Because this MCP server provides structured, context-aware data to LLMs like Claude, it acts as a world-class personal coach.
Here is an actual, unedited response from Claude (via Copilot) summarizing a ride by cross-referencing six different MCP tools simultaneously (Activity Details, Training Status, Sleep/Recovery, Training Zones, and Stress):
Prompt: "I just came back from my long Z2 ride. Please assess it in detail against our training plan!"
1. SCORECARD vs PLAN
Metric | Target | Actual | Grade |
Duration | 120β150 min | 137.5 min | β Perfect |
Time in Z1+Z2 | β | 99.4% (130.1 min) | β Excellent |
Max HR | β€130 (ceiling) | 135 bpm | β οΈ Brief breach |
HR drift | <5% | -4.5% | β Excellent |
Avg cadence | 85β95 rpm | 74 rpm | β Low |
2. LAP-BY-LAP ANALYSIS
Laps 3β6 were textbook Z2: HR locked at 121β122 bpm. This is exactly the metabolic zone we wanted.
No cardiac drift: HR drift = -4.5%. This means your aerobic system handled the load comfortably.
Cadence averaged 74 rpm β below target (85β95). Next time, focus on spinning a lighter gear to reduce muscular fatigue.
3. TRAINING STATUS & LOAD
Status remains Productive (code 7).
ACWR 1.4 is on the higher end of the sweet spot. Be cautious not to spike it further; the next session should be easy.
Aerobic TE 2.4 with zero anaerobic β exactly the prescribed stimulus.
4. POLARIZATION SHIFT β THE BIG WIN
Metric | Before today | After today |
Low intensity (Z1+Z2) | 49.4% | 56.7% |
This single ride shifted your 30-day polarization by +7.3% toward low intensity. Two more clean Z2 rides like this and you'll cross the 65% threshold.
5. RECOMMENDATIONS
Next session:
If HRV/recovery is good: another 90β120 min strict Z2. Same HR targets.
Cadence drill: consciously target 85+ rpm in the main block. Use a lighter gear and focus on pedal circles.
Prerequisites
Requirement | Notes |
Must already be running and populated | |
Docker & Docker Compose | For the recommended deployment path |
Python 3.11+ | For local development only |
Quick Start (Docker Compose)
If you just want to run the pre-built image alongside your existing garmin-grafana stack, create a docker-compose.yml with the snippet below. No need to clone this repository.
services:
garmin-grafana-mcp-server:
image: ghcr.io/ghighi3f/garmin-grafana-mcp-server:latest
container_name: garmin-grafana-mcp-server
restart: unless-stopped
ports:
- "8765:8765"
environment:
# ββ Required βββββββββββββββββββββββββββββββββββββββββββββ
# Connection to the InfluxDB instance managed by garmin-grafana.
INFLUXDB_HOST: influxdb # container name on the shared Docker network
INFLUXDB_PORT: 8086
INFLUXDB_DATABASE: GarminStats # database name from your garmin-grafana .env
INFLUXDB_USERNAME: admin # InfluxDB v1 credentials
INFLUXDB_PASSWORD: adminpassword # β change to your actual password
# ββ InfluxDB v2 only (uncomment if you run v2) ββββββββββ
# INFLUXDB_VERSION: 2
# INFLUXDB_TOKEN: "your-influxdb-token"
# INFLUXDB_ORG: "your-org"
# ββ Optional: override schema names βββββββββββββββββββββ
# Only needed if your garmin-grafana uses non-default measurement
# or field names. The defaults match the standard garmin-grafana schema.
#
# Measurement names:
# MEASUREMENT_ACTIVITIES: ActivitySummary
# MEASUREMENT_DAILY_STATS: DailyStats
# MEASUREMENT_SLEEP_SUMMARY: SleepSummary
# MEASUREMENT_ACTIVITY_SESSION: ActivitySession
# MEASUREMENT_ACTIVITY_LAP: ActivityLap
# MEASUREMENT_RESTING_HR: DailyStats
# MEASUREMENT_HRV: HRV_Intraday
# MEASUREMENT_VO2_MAX: VO2_Max
# MEASUREMENT_RACE_PREDICTIONS: RacePredictions
# MEASUREMENT_BODY_COMPOSITION: BodyComposition
#
# Field names:
# FIELD_RESTING_HR: restingHeartRate
# FIELD_HRV: hrvValue
# FIELD_VO2_MAX_RUNNING: VO2_max_value
# FIELD_VO2_MAX_CYCLING: VO2_max_value_cycling
# FIELD_RACE_5K: time5K
# FIELD_RACE_10K: time10K
# FIELD_RACE_HALF: timeHalfMarathon
# FIELD_RACE_MARATHON: timeMarathon
# FIELD_WEIGHT: weight
# FIELD_HR_ZONE_1: hrTimeInZone_1
# FIELD_HR_ZONE_2: hrTimeInZone_2
# FIELD_HR_ZONE_3: hrTimeInZone_3
# FIELD_HR_ZONE_4: hrTimeInZone_4
# FIELD_HR_ZONE_5: hrTimeInZone_5
#
# Training Status & Readiness (garmin-grafana v0.4.0+):
# MEASUREMENT_TRAINING_STATUS: TrainingStatus
# MEASUREMENT_TRAINING_READINESS: TrainingReadiness
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8765/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
default:
external: true
name: garmin-grafana_default # β must match your garmin-grafana networkThen start it:
docker compose up -d
curl http://localhost:8765/healthTip: The only variables most users need to change are
INFLUXDB_PASSWORDand possiblyINFLUXDB_DATABASE. All schema variables have sensible defaults that match the standard garmin-grafana InfluxDB schema out of the box.
Deployment (Docker β recommended)
This is the recommended way to run the server alongside your existing garmin-grafana stack.
1. Clone this repository
git clone https://github.com/ghighi3f/garmin-grafana-mcp-server.git
cd garmin-grafana-mcp-server2. Configure environment variables
cp .env.example .envEdit .env to match your garmin-grafana setup. The most important values:
Variable | Default | Description |
|
| Container name of the InfluxDB service inside the garmin-grafana network. Override in |
|
| InfluxDB port (usually unchanged) |
|
| Database name set in your garmin-grafana config |
|
| InfluxDB username from your garmin-grafana |
| (see .env.example) | InfluxDB password from your garmin-grafana |
|
|
|
|
| Port the MCP server listens on |
|
| IANA timezone β must match |
Note:
INFLUXDB_HOSTis overridden toinfluxdbdirectly indocker-compose.ymlso the container resolves the InfluxDB service by its Docker network name. You do not need to set it in.envfor the Docker deployment.
3. Identify your garmin-grafana Docker network
The docker-compose.yml in this repo connects to the same Docker network that garmin-grafana creates. By default that network is named garmin-grafana_default.
Verify the network name:
docker network ls | grep garminIf the name differs from garmin-grafana_default, edit the networks section at the bottom of docker-compose.yml:
networks:
default:
external: true
name: your-actual-network-name # β change this4. Start the server
docker compose up -dVerify it is running:
curl http://localhost:8765/healthExpected response:
{
"influxdb": "connected",
"last_activity_timestamp": "2026-03-17T07:30:00+00:00",
"measurements_found": ["ActivitySummary", "DailyStats", "SleepSummary", "..."],
"mcp_endpoint": "http://localhost:8765/mcp",
"sse_endpoint": "http://localhost:8765/sse"
}Local Development
If you want to run the MCP server directly on your host machine (outside Docker) during development, the server process needs to reach InfluxDB on port 8086. Since InfluxDB is inside a Docker network, you must expose its port to the host.
Step 1: Expose InfluxDB port in your garmin-grafana docker-compose.yml
Open the garmin-grafana docker-compose.yml and add a ports mapping to the influxdb service:
# In your garmin-grafana docker-compose.yml:
services:
influxdb:
image: influxdb:1.8
ports:
- "8086:8086" # β add this line
# ... rest of your configThen restart the garmin-grafana stack:
docker compose down && docker compose up -dStep 2: Set up the Python environment
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtFor InfluxDB v2, also install:
pip install influxdb-clientStep 3: Configure for local access
cp .env.example .envEdit .env and set:
INFLUXDB_HOST=localhost # reach InfluxDB via the exposed host port
INFLUXDB_PORT=8086Step 4: Run the server
python server.pyYou should see:
============================================================
Garmin MCP Server
============================================================
InfluxDB : localhost:8086/GarminStats
Measurements: ['ActivitySummary', 'DailyStats', ...]
Transports : HTTP + SSE (always active)
/mcp (Streamable HTTP) : http://localhost:8765/mcp
/sse (SSE, deprecated) : http://localhost:8765/sse
/health : http://localhost:8765/health
============================================================Connecting to an MCP Client
All HTTP transports are always active simultaneously β no MCP_TRANSPORT configuration needed for HTTP deployments. Point your client at the right URL and go.
Perplexity Mac / Legacy SSE clients
Note: SSE transport is deprecated in the MCP specification. Kept for backward compatibility β prefer Streamable HTTP for new integrations.
{
"mcpServers": {
"garmin": {
"type": "sse",
"url": "http://<your-host>:8765/sse"
}
}
}ChatGPT / VS Code / Modern clients (Streamable HTTP)
{
"mcpServers": {
"garmin": {
"type": "http",
"url": "http://<your-host>:8765/mcp"
}
}
}Replace <your-host> with the IP or hostname of the machine running the server (e.g. 192.168.1.100, pi5.local, or localhost).
Claude Desktop / Cursor / Windsurf / Claude Code (Local stdio)
With Docker (server reads InfluxDB via the shared garmin-grafana network):
{
"mcpServers": {
"garmin": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--network", "garmin-grafana_default",
"--env-file", "/path/to/.env",
"ghcr.io/ghighi3f/garmin-grafana-mcp-server:latest",
"python", "server.py"
],
"env": { "MCP_TRANSPORT": "stdio" }
}
}
}Without Docker (local Python, INFLUXDB_HOST=localhost in .env):
{
"mcpServers": {
"garmin": {
"command": "python",
"args": ["/path/to/garmin-grafana-mcp-server/server.py"],
"env": {
"MCP_TRANSPORT": "stdio",
"INFLUXDB_HOST": "localhost",
"INFLUXDB_PORT": "8086",
"INFLUXDB_DATABASE": "GarminStats",
"INFLUXDB_USERNAME": "admin",
"INFLUXDB_PASSWORD": "your-password"
}
}
}
}Or from the command line:
MCP_TRANSPORT=stdio python server.pyTip: The startup banner is written to stderr in stdio mode so it never interferes with the MCP protocol on stdout.
No configuration needed
All HTTP transports (SSE + Streamable HTTP) are always active on the same port. MCP_TRANSPORT only needs to be set for stdio (subprocess) clients.
MCP Tools
get_last_activity
Returns the single most recent Garmin activity with all available fields. No input parameters.
get_recent_activities
Returns activities from the last N days with a summary.
Parameter | Type | Default | Range / Values |
| int |
| 1β90 |
| str |
| Any Garmin sport type (e.g. |
| int |
| 1β100 |
get_weekly_load_summary
Groups activities into ISO calendar weeks with resting HR and HRV.
Parameter | Type | Default | Range |
| int |
| 1β16 |
get_daily_recovery
Merges SleepSummary + DailyStats per date for a holistic recovery view.
Parameter | Type | Default | Range |
| int |
| 1β14 |
get_activity_details
Detailed breakdown of a single activity: HR zones, training effect, per-lap splits, and analysis hints (fastest/slowest lap, HR drift). For activities with a power meter, also returns max_power, avg_power_pedaling_only, and standing_duration_seconds per lap.
Parameter | Type | Description |
| str | Activity ID from |
get_fitness_trend
Long-term fitness trajectory: VO2max, race predictions, weight, resting HR β sampled weekly.
Parameter | Type | Default | Range |
| int |
| 4β52 |
get_training_zones
HR zone distribution and polarization analysis (low/moderate/high intensity breakdown).
Parameter | Type | Default | Range / Values |
| int |
| 7β180 |
| str |
| Any Garmin sport type (e.g. |
explore_schema
Discover available InfluxDB measurements, fields, and tags at runtime. Useful for verifying field names before querying or debugging measurement mismatches.
Parameter | Type | Optional | Description |
| str | Yes | Inspect a specific measurement (e.g. |
Returns (no measurement specified):
{"measurements": ["ActivitySummary", "DailyStats", "SleepSummary", "..."]}Returns (measurement specified):
{
"measurement": "ActivitySummary",
"fields": [
{"field": "distance", "type": "float"},
{"field": "elapsedDuration", "type": "integer"},
"..."
],
"tags": ["userId", "deviceId", "..."]
}get_stress_body_battery
Daily stress breakdown and body battery trend over 7β30 days. Surfaces systemic fatigue patterns that get_daily_recovery buries inside a per-day blob.
Parameter | Type | Default | Range |
| int |
| 7β30 |
Returns:
Per-day: stress minutes (high/medium/low/rest) + body battery (at wake, high, low, drained, charged)
Summary: period averages + trend direction (
"improving"/"declining"/"stable"for body battery;"improving"/"worsening"/"stable"for stress)
get_personal_records
All-time personal records grouped by sport type. For each record, returns the value, unit, and the activity_id, date, and activity_name of the record-setting activity.
Parameter | Type | Default | Range / Values |
| str |
| Any Garmin sport type (e.g. |
Records tracked per sport:
Record | Unit | Notes |
| km | |
| minutes | Uses moving time (excludes pauses) |
| km/h | |
| min/km | Pace sports only (running, swimming, walking, hiking) |
| km/h | Speed sports only (cycling, rowing, etc.) |
| bpm | |
| bpm | |
| kcal | |
| watts | Duration-weighted average from lap data |
| watts | Peak instantaneous watt from ActivityGPS (server-side MAX aggregate) |
get_training_status
Fetches the latest Training Status and Training Readiness entries from InfluxDB. No input parameters required.
Returns:
training_statusβ most recent entry from theTrainingStatusmeasurement:
Field | Type | Description |
| int | Garmin training status enum value |
| str | Raw FIT SDK phrase code (e.g. |
| str|null | Human-readable coaching text decoded from the FIT SDK |
| int | 7-day acute training load |
| int | 28-day chronic training load (CTL) |
| float | Acute / chronic workload ratio (ACWR) |
| int | ACWR expressed as a percentage |
| int | Garmin fitness trend indicator |
| float | Upper bound of the optimal chronic load range |
| float | Lower bound of the optimal chronic load range |
| str | ISO timestamp of the record |
training_readinessβ most recent entry from theTrainingReadinessmeasurement (requires garmin-grafana v0.4.0+ and a compatible device). Returnsnullwith atraining_readiness_noteif the measurement is not present.
Field | Type | Description |
| int | Readiness score 0β100 |
| str | Readiness label (e.g. |
| int | Sleep component score |
| float | HRV component ratio |
| int | Recommended recovery time in hours |
| float | Stress history component |
| float | Activity history component |
Graceful degradation: if either measurement is missing (e.g.
TrainingReadinessis only available with certain garmin-grafana versions and Garmin devices), the corresponding field isnulland adata_noteortraining_readiness_notekey explains why. The server never crashes.
get_sleep_physiology
Returns nightly autonomic physiology from SleepIntraday epoch data, merged with enriched SleepSummary.
Parameter | Type | Default | Range |
| int |
| 1β14 |
Returns per night:
intradayβ HR, HRV, respiration, SpO2 (min/max/mean), stress (mean), body battery (first/last/min/max), restlessness (mean), epoch countsummaryβ sleep score, stage durations, avg overnight HRV, respiration range, SpO2 range
Summary: avg minimum HR, avg mean HRV, avg mean respiration, avg min SpO2, avg body battery charged. Trends: min_hr_trend, hrv_trend, respiration_trend.
get_activity_load_history
Returns per-activity training load and training effect scores β shows which sessions drive acute load.
Parameter | Type | Default | Range / Values |
| int |
| 1β90 |
| str |
| Any Garmin sport type or |
| int |
| 1β100 |
Returns per activity: activity ID, sport, distance, duration, training_load (Garmin EPOC), aerobic_training_effect (0β5), anaerobic_training_effect (0β5), avg/max HR.
Summary: total_load, avg_load_per_session, load_by_sport, highest_load_activity, avg_aerobic_te, avg_anaerobic_te.
get_daily_energy_balance
Returns daily time-use breakdown, caloric data, movement, and stress attribution β reveals what happens between workouts and sleep.
Parameter | Type | Default | Range |
| int |
| 1β14 |
Returns per day:
time_useβ sedentary, active, highly active, sleeping (hours)energyβ BMR kcal, active kcalmovementβ steps, distance, floors ascended/descended + metersrecovery_contextβ body battery during sleep, body battery at wake, resting HRstress_attributionβ activity stress min/pct, total stress, uncategorized stress
Summary: period averages + sedentary_trend, bb_during_sleep_trend.
get_fitness_age
Returns weekly-sampled fitness age trajectory β a single metric for long-term base-building progress.
Parameter | Type | Default | Range |
| int |
| 4β52 |
Returns per week: fitness_age, chronological_age, achievable_fitness_age, fitness_age_gap (fitness β chronological, negative = younger), improvement_potential (fitness β achievable).
Trends: fitness_age_change, fitness_age_gap_change, improvement_potential_change (delta oldest β newest).
get_peak_power
Returns rolling-window peak power efforts for a single activity, computed from per-second ActivityGPS.Power data. Requires a power meter.
Parameter | Type | Description |
| str | Activity ID from |
Returns:
Field | Description |
| Best average watts over 1s / 5s / 10s / 30s / 60s / 5min / 20min windows |
| Mean watts including coasting (0 W) β matches Garmin display |
| Mean watts when Power > 0 (excludes coasting) |
| Percentage of samples at 0 W |
| Total mechanical work in kilojoules (from |
| Number of 1-second GPS samples |
The 20-minute peak is the standard input for FTP estimation (multiply by 0.95).
get_power_zones
Returns time-in-zone distribution using the Coggan 7-zone model, computed from per-second ActivityGPS.Power data. Coasting (0 W) is excluded from zone percentages and reported separately.
Parameter | Type | Default | Description |
| str | β | Activity ID |
| float |
| Functional Threshold Power in watts |
Zone boundaries:
Zone | Label | Range |
Zone 1 | Active Recovery | < 55% FTP |
Zone 2 | Endurance | 55β75% FTP |
Zone 3 | Tempo | 75β90% FTP |
Zone 4 | Threshold | 90β105% FTP |
Zone 5 | VO2 Max | 105β120% FTP |
Zone 6 | Anaerobic | 120β150% FTP |
Zone 7 | Neuromuscular | > 150% FTP |
Returns per zone: minutes, pct_of_power_time, min_watts, max_watts. Also returns coasting_minutes, total_power_minutes, and ftp_used.
get_power_history
Returns per-session power summary for activities in the last N days that have power data. Uses bulk queries only β no per-activity round-trips.
Parameter | Type | Default | Range / Values |
| int |
| 1β90 |
| str |
| Any Garmin sport type or |
Returns per activity: activity ID, timestamp, sport, distance, duration, avg_power, total_work_kj, training load, aerobic TE, anaerobic TE.
Summary: avg_power_trend ("improving"/"declining"/"stable"), best_avg_power_session, total_work_kj, period_avg_power.
get_cycling_dynamics
Returns advanced pedaling efficiency metrics for a single activity. Requires the garmin-grafana CyclingDynamics patch and a compatible pedal-based power meter (Garmin Rally, Vector, or similar). Returns a graceful data_note when data is unavailable β safe to call for any activity.
Parameter | Type | Description |
| str | Activity ID from |
Returns:
powerβnormalized_power(W),training_stress_score,intensity_factor,left_right_balance({left_pct, right_pct})left_pedal/right_pedalβtorque_effectiveness(%),pedal_smoothness(%),platform_center_offset_mm,power_phase {start_deg, end_deg},power_phase_peak {start_deg, end_deg}data_noteβ present instead of the above when no CyclingDynamics data is found
get_lactate_threshold_trend
Returns weekly-sampled lactate threshold heart rate (LTHR) and its trend. LTHR is the highest average HR you can sustain for ~60 minutes and is the key anchor for defining training zones (Z2 ceiling, Z4 floor). A rising LTHR indicates cardiovascular adaptation.
Parameter | Type | Default | Range |
| int |
| 4β52 |
Returns:
currentβ most recent LTHR reading:hr_threshold_running(bpm) andweek_labelweeksβ list (newest first) of{ week_label, hr_threshold_running }entriestrendβ"improving"|"declining"|"stable"change_bpmβ change over the period (positive = LTHR risen = improving)data_noteβ present instead of the above when noLactateThresholddata is found (e.g. older firmware)
Graceful degradation: if the
LactateThresholdmeasurement is absent from your InfluxDB (requires Garmin device firmware that estimates LTHR automatically), the tool returns adata_noteexplaining why rather than an error.
Example prompts
"What was my last ride? How did my HR compare to the previous 3?"
"Break down everything I did in the last 2 weeks by sport."
"Given my last 4 weeks of training, suggest a 7-day plan β
my goal is a sprint triathlon in 6 weeks, I can train Mon/Wed/Thu/Sat/Sun."
"Was my training load balanced across swim/bike/run last month?"
"How has my VO2max trended over the past 3 months?"
"Compare my sleep and recovery over the last 7 days."
"What's my HR zone distribution for the past month?
Am I spending too much time in zone 3?"
"Show my stress and body battery trend for the last 2 weeks.
Am I recovering well between hard sessions?"
"What are my all-time personal records for cycling and running?"
"What is my current training status? Am I overloading or undertraining?"
"What were my peak 5-minute and 20-minute power numbers on today's ride?"
"Show me my Coggan power zone distribution for the last ride. How much time in Z2 vs Z4+?"
"Has my average power been improving or declining over the last month of rides?"
"What is my lactate threshold HR and has it improved over the last 3 months?"Configuration reference
All settings are in .env. Copy .env.example to get started.
Measurement names
Override these if your garmin-grafana schema uses different measurement names:
Variable | Default |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Field names
Variable | Default | Used in |
|
| Weekly load |
|
| Weekly load |
|
| Fitness trend |
|
| Fitness trend |
|
| Fitness trend |
|
| Fitness trend |
|
| Fitness trend |
|
| Fitness trend |
|
| Fitness trend |
|
| Training zones, activity details |
|
| Training status (int enum) |
|
| Training status label (string) |
|
| 7-day acute training load |
|
| 28-day chronic training load |
|
| Acute/chronic ratio |
|
| ACWR as percentage |
|
| Fitness trend indicator |
|
| Readiness score 0β100 |
|
| Readiness label string |
|
| Sleep HR epochs |
|
| Sleep HRV epochs |
|
| Sleep respiration epochs |
|
| Sleep SpO2 epochs |
|
| Sleep stress epochs |
|
| Sleep body battery epochs |
|
| Sleep restlessness epochs |
|
| Per-activity EPOC load |
|
| Aerobic training effect (0β5) |
|
| Anaerobic training effect (0β5) |
|
| Daily sedentary time |
|
| Daily active time |
|
| Daily vigorous movement time |
|
| Daily sleeping time |
|
| Basal metabolic rate calories |
|
| Body battery charged during sleep |
|
| Activity-caused stress seconds |
|
| Activity stress % of total |
|
| Current fitness age |
|
| Actual age |
|
| Optimal achievable fitness age |
|
| Lactate threshold HR (running) |
Server
Variable | Default | Description |
|
| Bind address |
|
| Bind port |
|
| Set to |
| (empty) | DNS-rebinding allow-list (e.g. |
Timezone
Variable | Default | Description |
|
| IANA timezone for daily-aggregate queries. Must match |
garmin-grafana stores daily measurements (DailyStats, SleepSummary, etc.) with timestamps anchored to local midnight. For a UTC+3 user, local midnight is 21:00:00Z β without timezone correction the MCP server assigns these records to the previous UTC date, shifting every daily metric one day into the past.
Set QUERY_TIMEZONE to the same value as USER_TIMEZONE in your garmin-grafana .env:
# garmin-grafana .env
USER_TIMEZONE=Europe/Athens
# garmin-grafana-mcp-server .env
QUERY_TIMEZONE=Europe/AthensThis injects InfluxQL's tz() clause into daily and weekly aggregate queries and converts timestamps to local dates in the normalizer layer. Activity queries (which use actual event timestamps) are not affected.
UTC users: No action needed β the default
UTCpreserves existing behaviour.
Project structure
garmin-grafana-mcp-server/
βββ server.py β Starlette app + MCP tool registration + startup banner
βββ influx.py β InfluxDB client, all queries, normalizer functions
βββ utils.py β Shared helpers (pick, safe_float, iso_week_label, etc.)
βββ tools/
β βββ __init__.py
β βββ activity.py β get_last_activity, get_recent_activities
β βββ load.py β get_weekly_load_summary
β βββ recovery.py β get_daily_recovery
β βββ detail.py β get_activity_details
β βββ fitness.py β get_fitness_trend, get_training_zones
β βββ records.py β get_personal_records
β βββ stress.py β get_stress_body_battery
β βββ schema.py β explore_schema
β βββ training_status.py β get_training_status
β βββ sleep_physiology.py β get_sleep_physiology
β βββ activity_load.py β get_activity_load_history
β βββ energy_balance.py β get_daily_energy_balance
β βββ fitness_age.py β get_fitness_age
β βββ lactate.py β get_lactate_threshold_trend
β βββ cycling_dynamics.py β get_cycling_dynamics
β βββ power.py β get_peak_power, get_power_zones, get_power_history
βββ Dockerfile
βββ docker-compose.yml β Docker deployment (external garmin-grafana network)
βββ .env.example β Configuration template
βββ requirements.txt β Python dependencies
βββ CHANGELOG.md
βββ README.mdSchema compatibility
This server is designed to be resilient to garmin-grafana schema variations across versions. All measurement names and the key field names used in queries are configurable via environment variables (see the configuration tables above). If a field is missing from a given activity record, it is silently set to null β no errors are raised.
If you see empty results after setup, verify your measurement names against InfluxDB:
# InfluxDB v1 β run from inside the influxdb container or via an exposed port
influx -database GarminStats -execute 'SHOW MEASUREMENTS'Then update the corresponding MEASUREMENT_* variables in your .env.
Troubleshooting
Symptom | Likely cause | Fix |
| Network misconfiguration | Verify |
| garmin-grafana not running |
|
Empty | Measurement name mismatch | Run |
|
|
|
stdio mode not working | Missing | Run |
| Old deployment cached in container | Rebuild and redeploy: |
Tools not appearing in client | Client connected before server started | Restart the MCP client |
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Garmin watch data for AI assistants: activities, sleep, HRV, recovery. Never writes to Garmin.
Explore Garmin activity and health data with your AI assistant.
Your Garmin, Oura, WHOOP, Hevy and 35 more fitness apps, queryable from your own AI.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to access and query Garmin Connect health and fitness data, including sleep, HRV, training load, and activities, with an optional coaching plugin for personalized training plans.4-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query live Garmin Connect health and fitness data, including daily metrics, activities, sleep analysis, and trends via natural language.MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to retrieve and analyze Garmin Connect health data, including daily summaries, sleep, HRV, workouts, and raw FIT files, while also supporting SQL queries on the underlying database.10-
- AlicenseAqualityBmaintenanceEnables AI assistants to query a user's own Garmin Connect training, health, and recovery history through Garmin's official Personal API, backed by a local cache and built-in analysis tools.2191 npm2Apache 2.0