livetrack-mcp
livetrack-mcp
Autonomer MCP-Server, der Garmin LiveTrack abruft, Zeitreihen in SQLite speichert und alle 10 Minuten via claude-runner eine Claude-Analyse auslöst.
Architektur
Garmin LiveTrack URL
│
│ (poll every 60 s)
▼
livetrack-mcp (port 38100)
├── poller.py — fetch trackpoints from Garmin API
├── store.py — SQLite time-series persistence (/data/livetrack.db)
├── tracker.py — asyncio scheduling + race-end detection
└── analyzer.py — build prompt, call claude-runner
│
│ POST /run (fire-and-forget)
▼
claude-runner (port 38095)
│
│ claude -p <analysis prompt>
▼
Claude (sonnet)
├── analyze timeseries
├── curl POST /control if thresholds need adjustment
└── mcp__telegram__send_message → coaching pushHauptdesign: livetrack-mcp ist vollständig autonom — während des Rennens muss keine Claude-Sitzung aktiv bleiben. Claude wird alle 10 Minuten als zustandslose Analysefunktion aufgerufen. Sollte claude-runner vorübergehend nicht verfügbar sein, wird der nächste Analysezyklus automatisch wiederholt.
Related MCP server: Garmin-Strava-mcp
MCP-Tools
Tool | Beschreibung |
| Startet das Abrufen einer LiveTrack-Freigabe-URL |
| Stoppt das Abrufen (wird auch bei Rennende automatisch gestoppt) |
| Aktiver Status, verstrichene Zeit, Stagnationszeit, Abruffehler |
| Aktuelle Daten aus SQLite |
| Aktualisiert HR/Leistungsschwellen während des Rennens |
| Manuelle Analyse auf Abruf, umgeht den Zeitplan |
Benutzerdefinierte HTTP-Endpunkte
Endpunkt | Methode | Beschreibung |
| POST | Aktualisiert Schwellenwerte während des Rennens (aufgerufen von Claude via curl im Bash-Tool) |
| GET | Gesundheitsprüfung — Tracking-Status + Speicherstatistiken |
/control Verwendung (aus dem Analyse-Prompt von Claude)
curl -sf -X POST http://localhost:38100/control \
-H 'Content-Type: application/json' \
-d '{"power_max": 150}'Zulässige Felder: hr_max, hr_min, power_max, power_min, cadence_min, run_hr_max, run_hr_min, run_cadence_min
race_config Felder
Feld | Typ | Standard | Beschreibung |
| int | — | Radsport-HF-Obergrenze (bpm) |
| int | — | Radsport-HF-Untergrenze |
| int | — | ERG-Leistungsobergrenze (Watt) |
| int | — | ERG-Leistungsuntergrenze |
| int | — | Minimale Trittfrequenz (U/min) |
| int | — | Lauf-HF-Obergrenze |
| int | — | Lauf-HF-Untergrenze |
| int | — | Minimale Laufschrittfrequenz (spm) |
| int | 60 | Häufigkeit des LiveTrack-Abrufs |
| int | 600 | Häufigkeit der Claude-Analyse |
| int | 10 | Datenfenster, das an Claude übergeben wird (Minuten) |
Beispiel race_config für einen kompletten Triathlon
{
"race_name": "CT2026",
"race_type": "triathlon",
"hr_max": 144,
"hr_min": 115,
"power_max": 165,
"cadence_min": 82,
"run_hr_max": 152,
"run_hr_min": 125,
"run_cadence_min": 165,
"poll_interval_secs": 60,
"analyze_interval_secs": 600,
"analyze_window_min": 10
}Erkennung des Rennendes
Der Server stoppt automatisch, wenn:
Keine neuen Trackpoints für ≥ 15 Minuten vorhanden sind (
STALE_STOP_MIN)UND die gesamte verstrichene Zeit ≥ 30 Minuten beträgt (
MIN_ELAPSED_MIN)
Dies berücksichtigt die 24-Stunden-URL-Verzögerung von Garmin: Die URL bleibt nach dem Rennen gültig, aber neue Trackpoints kommen nicht mehr an, wenn der Athlet das Ziel erreicht hat. Das 30-Minuten-Minimum verhindert falsche Stopps zu Beginn, wenn GPS-Daten spärlich sind.
Konfiguration (Umgebungsvariablen)
Variable | Standard | Beschreibung |
|
| Server-Port |
|
| Bind-Adresse |
|
| MCP-Endpunktpfad |
|
| SQLite-Datenbankpfad |
|
| claude-runner Basis-URL |
|
| Arbeitsbereich für claude-runner-Aufgaben |
|
| Protokollierungsebene |
| — | OpenTelemetry-Collector-URL (optional) |
Bereitstellung
cd ~/ai-platform/mcps
# Build and start
docker compose up -d --build livetrack-mcp
# Logs
docker compose logs -f livetrack-mcp
# Restart
docker compose restart livetrack-mcp
# Health check
curl http://localhost:38100/healthTypische Sitzung (via Claude im Trainings-Arbeitsbereich)
# Start tracking
use_mcp_tool livetrack-mcp start_tracking \
url="https://livetrack.garmin.com/session/.../token/..." \
race_config={"hr_max": 144, "power_max": 165, "run_hr_max": 152}
# Check status
use_mcp_tool livetrack-mcp get_tracking_status
# Manual analysis trigger
use_mcp_tool livetrack-mcp trigger_analysis
# Stop (or let it auto-stop)
use_mcp_tool livetrack-mcp stop_trackingProjektstruktur
livetrack_mcp/
├── Dockerfile
├── pyproject.toml
├── README.md
└── src/livetrack_mcp/
├── __init__.py
├── __main__.py
├── otel.py # OpenTelemetry setup
├── poller.py # Garmin LiveTrack URL parsing + HTTP fetch
├── store.py # SQLite time-series (sqlite3 + asyncio.to_thread)
├── tracker.py # Scheduling (asyncio.create_task) + race-end detection
├── analyzer.py # Prompt builder + claude-runner caller
└── server.py # FastMCP tools + /control + /healthTool 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
Adaptive running coach MCP server: training data, plans, and recovery for AI assistants.
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).
Your own Garmin data (sleep, HRV, Body Battery, activities) in Claude, ChatGPT and any MCP app.
Garmin data in Claude: 135 tools — activities, sleep, HRV, training, workouts. Free, open source.
Related MCP Servers
- 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
- FlicenseNot gradedqualityDmaintenanceMCP server that gives Claude access to real-time Garmin Connect and Strava data for analyzing training and suggesting sessions.-
- AlicenseAqualityDmaintenanceLocal MCP server that connects Claude Desktop with Garmin and Apple Health data to read training and recovery, estimate heart rate and pace zones, analyze performance, and create structured workouts.22MIT
- AlicenseAqualityCmaintenanceAn MCP server that transforms Garmin data into compact, verdict-first coaching reports for LLMs, computing metrics like CTL/ATL/TSB and ACWR to answer training readiness questions.1419 PyPIApache 2.0