intervals.icu MCP Server
by kylemabry95
README.md
# intervals.icu Desktop + MCP Server
[](https://github.com/kylemabry95/intervals.icu_to_claude_mcp_connection)
[](https://www.python.org/downloads/)
[](LICENSE)
[](API_REFERENCE.md)
[](.)
> š **Your AI coaching assistant for intervals.icu training data**
A standalone desktop application + Model Context Protocol (MCP) server that gives you **complete access** to [intervals.icu](https://intervals.icu) training data through Claude AI. Manage every aspect of your training through natural conversation ā from logging wellness data to organizing workout libraries to analyzing fitness trends.
---
## ļæ½ļø Standalone Desktop Application
A self-contained, production-ready desktop application for macOS and Windows. **No manual Claude Desktop configuration needed.** Just install, authenticate, and start asking Claude about your training data.
### š„ Downloads (v1.0.0)
**ā
macOS** (Ready to download):
- š¦ [IntervalsICU-1.0.0.dmg](dist/macos/IntervalsICU-1.0.0.dmg) (33 MB) ā Ready for installation
- š [Build Details](dist/macos/BUILD_MANIFEST.md) ā Build information and requirements
#### š Seamless One-Click Installation
The DMG includes an automated **`install.sh`** script that handles everything automatically:
```bash
# 1. Mount the DMG (or double-click in Finder)
hdiutil attach IntervalsICU-1.0.0.dmg
# 2. Run the install script from the mounted volume
/Volumes/IntervalsICU/install.sh
# Or simply double-click install.sh in Finder
```
The script automatically:
- ā
Detects and validates the app bundle
- ā
Copies to `/Applications` folder
- ā
Removes Gatekeeper quarantine attribute (eliminates "can't scan for malware" warnings)
- ā
Verifies installation completeness
- ā
Provides helpful error messages if issues occur
**Installation options**:
```bash
# Standard installation to /Applications
./install.sh
# Custom destination folder
./install.sh --dest ~/Desktop/Apps
# Force replacement if app already exists
./install.sh --force
# Verbose output for troubleshooting
./install.sh --verbose
# Show help
./install.sh --help
```
#### āļø Manual Installation (Alternative)
If you prefer to install manually:
1. Mount the DMG file (double-click)
2. Drag `IntervalsICU.app` to your Applications folder
3. Resolve Gatekeeper warnings (see troubleshooting below)
**Troubleshooting ā "Can't be scanned for malware" Error**:
If you see a macOS warning that the app "can't be opened because it can't be scanned for malware":
**Option 1 ā Quick Fix (Recommended):**
```bash
# Remove the quarantine attribute (one-time command)
xattr -d com.apple.quarantine /Applications/IntervalsICU.app
```
**Option 2 ā Using the Fix Script (from DMG):**
```bash
# From the mounted DMG, run the provided fix script
/Volumes/IntervalsICU/fix-gatekeeper.sh /Applications/IntervalsICU.app
```
**Option 3 ā Manual Trust:**
1. Right-click `IntervalsICU.app` and select "Open"
2. Click "Open" in the security dialog (one-time prompt)
3. App will be added to trusted apps
**Windows** (Coming soon): NSIS installer in development
### ⨠Key Features
- š Secure credential storage via OS-native Keychain (macOS) / Credential Manager (Windows)
- š¬ Conversational interface with Claude for natural-language training queries
- āļø In-app settings management with API key updates and log viewing
- š Automatic update checking for new releases
- š Performance monitoring and latency tracking
- šÆ Context-aware help system with error guidance
- š 99.5% uptime SLO with process resilience
### Getting Started
```bash
# 1. Install dependencies
pip install -r requirements.txt
# 2. Configure credentials (interactive on first launch)
# Or use environment variables:
export INTERVALS_API_KEY="your_key_here"
export INTERVALS_ATHLETE_ID="i230309"
export ANTHROPIC_API_KEY="sk-ant-..."
# 3. Launch the desktop app
python -m desktop_app.main
```
### Build & Deploy
**macOS** ā ā
Build Complete
The macOS distribution includes a seamless one-click installation experience:
**Distribution Artifacts:**
- Distributable `.dmg` available: [IntervalsICU-1.0.0.dmg](dist/macos/IntervalsICU-1.0.0.dmg)
- Includes `install.sh` ā Automated installation script (handles Gatekeeper quarantine removal)
- Includes `fix-gatekeeper.sh` ā Manual Gatekeeper resolution tool
- Build branch: [`build/macos-dmg-v1.0.0`](https://github.com/kylemabry95/intervals.icu_to_claude_mcp_connection/tree/build/macos-dmg-v1.0.0)
**Build Toolchain:**
- PyInstaller 6.11.0+ ā Bundles Python app to `.app` format
- create-dmg 1.3.3 ā Creates professional DMG distribution
- Code signing with ad-hoc signatures + xattr Gatekeeper bypass
**To rebuild locally:**
```bash
chmod +x packaging/macos/build.sh
./packaging/macos/build.sh --version 1.0.0
# Add --sign --notarize for production builds (requires Developer ID)
```
**Build Output:**
- `dist/macos/IntervalsICU-1.0.0.dmg` (~32 MB, 64.7% compression)
- Contains: IntervalsICU.app, install.sh, fix-gatekeeper.sh, Applications symlink
**Installation Scripts:**
- [packaging/macos/install.sh](packaging/macos/install.sh) ā Main automated installer (520 lines, 16 functions)
- [packaging/macos/fix-gatekeeper.sh](packaging/macos/fix-gatekeeper.sh) ā Standalone Gatekeeper resolver
- [packaging/macos/README.md](packaging/macos/README.md) ā Build documentation and workflow
**Windows** ā In Development
- NSIS installer coming soon
- Build script: `packaging/windows/build.ps1`
### Testing
```bash
# Fast unit + integration tests
pytest tests/unit tests/integration -v
# Full test matrix
pytest tests/ -v -m "not e2e"
# All tests including e2e
pytest tests/ -v
```
---
## š” MCP Server for Claude Desktop
For users preferring Claude Desktop integration instead of the standalone app, the MCP server is also available:
```bash
# 1. Install and configure
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your intervals.icu and Anthropic credentials
# 2. Run the MCP server
python server.py
# 3. In Claude Desktop config, add to `mcpServers`:
# {
# "intervals-icu": {
# "command": "python",
# "args": ["/path/to/server.py"],
# "env": {
# "INTERVALS_API_KEY": "your_key",
# "INTERVALS_ATHLETE_ID": "i230309",
# "INTERVALS_API_BASE_URL": "https://intervals.icu/api/v2"
# }
# }
# }
```
---
## š Documentation
| File | Purpose |
| -------------------------------------------- | ---------------------------------------------------- |
| **README.md** _(this file)_ | Feature overview, installation, and usage examples |
| [QUICKSTART.md](QUICKSTART.md) | Fast setup guide with troubleshooting tips |
| [API_REFERENCE.md](API_REFERENCE.md) | Complete endpoint specifications and parameters |
| [CHANGELOG.md](CHANGELOG.md) | Version history and release notes |
| [EXTENSION_SUMMARY.md](EXTENSION_SUMMARY.md) | Technical architecture and implementation details |
| [PROJECT_SUMMARY.md](PROJECT_SUMMARY.md) | Project metrics, deliverables, and completion status |
---
## š¼ļø Pre-Download UI Preview
Feature 004 adds a desktop-first browser preview so users can try the core chat UX before downloading the DMG.
### Run locally
```bash
# from repository root
python -m http.server 8000
# then open http://localhost:8000/preview/
```
### What the preview includes
- Interactive chat demo with deterministic simulated responses
- Authentication walkthrough with API-key guidance links
- Settings/help feature tour
- Download CTAs for macOS and Windows
- Fallback banner when preview modules fail to initialize
### Validation tests
```bash
pytest tests/unit/test_preview_templates.py \
tests/unit/test_preview_no_live_llm.py \
tests/unit/test_preview_accessibility.py -v
pytest tests/integration/test_preview_*.py -v
pytest tests/e2e/test_preview_*.py -v
```
This preview intentionally uses sample data only and never accepts real credentials.
---
## š What's New in v1.0.0
**Standalone Desktop Application Release** ā ā
Now Available
A complete rewrite bundling the MCP server with a Claude-powered conversational UI for macOS and Windows:
**š¦ Release Status:**
- ā
macOS (.dmg) ā **Available** ā [Download v1.0.0](dist/macos/IntervalsICU-1.0.0.dmg)
- ā³ Windows (NSIS) ā In progress
- ā
Source code ā Tagged [v1.0.0](https://github.com/kylemabry95/intervals.icu_to_claude_mcp_connection/releases/tag/v1.0.0)
**Features:**
- ā
**Standalone Desktop App** ā No Claude Desktop configuration needed
- ā
**Secure Credential Storage** ā OS-native Keychain/Credential Manager integration
- ā
**Conversational AI Interface** ā Ask Claude natural-language questions about your training
- ā
**36 API Tools** ā Complete intervals.icu API coverage (~95%)
- ā
**In-App Settings** ā Update credentials, manage logging, check for updates
- ā
**99.5% SLO** ā Process resilience with uptime tracking
- ā
**SC-004 Compliance** ā Response quality evaluation (95% pass threshold)
- ā
**Comprehensive Testing** ā 40+ tests covering unit/integration/performance/evaluation
- ā
**Production Packaging** ā Code-signed releases for macOS; NSIS installers for Windows
- ā
**Help & Guidance** ā Context-aware tooltips, FAQ, error remediation
### v2.1.0 MCP Server (Foundation)
The underlying MCP server that powers the desktop app and can be used with Claude Desktop:
- ā
Full CRUD operations on all major entities
- ā
Workout Library management (9 tools)
- ā
Training Plans support (4 tools)
- ā
Coaching features (2 tools)
- ā
Bulk operations and CSV export
- ā
Complete documentation suite
### Comparison: Desktop App vs MCP-Only
| Feature | Desktop App (v1.0) | MCP Server (v2.1) |
| ----------------------- | ------------------ | ----------------- |
| **Total API Tools** | 36 | 36 |
| **Installation** | ā
One-click | ā ļø Manual config |
| **Claude Integration** | ā
Built-in | ā
Claude Desktop |
| **Credential Storage** | ā
Secure (OS) | ā ļø .env file |
| **Conversational UI** | ā
Yes | ā No |
| **Settings Management** | ā
In-app | ā Manual |
| **Update Checking** | ā
Automatic | ā Manual |
| **Help & Guidance** | ā
Yes | ā No |
| **Uptime Monitoring** | ā
99.5% SLO | ā No |
| **API Coverage** | ~95% | ~95% |
| **Supported Endpoints** | All 36 tools | All 36 tools |
---
## ⨠API Features
### š¤ Athlete Profile
- **`get_athlete_profile`** ā Retrieve FTP, weight, training zones, and account settings
### šŖ Wellness & Recovery
- **`get_wellness_data`** ā Daily wellness metrics for a date range
- **`get_wellness_single`** ā Wellness data for a specific date
- **`update_wellness`** ā Update a single wellness entry
- **`update_wellness_bulk`** ā Batch-update multiple wellness entries
Metrics covered: sleep quality and duration, HRV, resting heart rate, weight, body composition, subjective scores (fatigue, soreness, stress, motivation), readiness, CTL/ATL/TSB.
### š“ Training Activities
- **`get_activities`** ā Workouts for a date range with key metrics
- **`get_activities_csv`** ā Export all activities to CSV
- **`get_activity_details`** ā Granular data including power/HR streams and detected intervals
- **`update_activity`** ā Modify name, description, or type
- **`delete_activity`** ā Remove an activity
### š Fitness Analytics
- **`get_fitness_trends`** ā CTL (Fitness), ATL (Fatigue), TSB (Form), and ramp rate
- **`get_power_curve`** ā Best power efforts across different durations
### š
Calendar & Event Management
- **`get_calendars`** ā List all calendars
- **`get_events`** ā Planned races, workouts, and notes
- **`get_event`** ā Details for a specific event
- **`create_event`** ā Add races, workouts, or notes
- **`update_event`** ā Modify an existing event
- **`delete_event`** ā Remove a calendar event
- **`get_planned_workouts`** ā Filter for upcoming scheduled training sessions
### š Workout Library
- **`get_folders`** / **`create_folder`** / **`update_folder`** / **`delete_folder`**
- **`get_workouts`** / **`get_workout`** / **`create_workout`** / **`update_workout`** / **`delete_workout`**
### š Training Plans
- **`get_training_plans`** / **`create_training_plan`** / **`update_training_plan`** / **`delete_training_plan`**
### š„ Coaching
- **`get_coached_athletes`** ā Athletes you coach with current fitness metrics
- **`get_wellness_summary`** ā Wellness overview for coached athletes
---
## ā” Quick Stats
| Metric | Value |
| ------------------------ | ----------------------------------- |
| **Total API Tools** | 36 |
| **API Coverage** | ~95% of public intervals.icu APIs |
| **CRUD Support** | Full (Create, Read, Update, Delete) |
| **Code Lines** | 1,106 |
| **Documentation** | 7 comprehensive guides |
| **Supported Operations** | GET, POST, PUT, DELETE |
---
## š Installation
> š” For a faster path, see [QUICKSTART.md](QUICKSTART.md). It includes platform-specific notes and a comprehensive troubleshooting section.
### Prerequisites
- Python 3.10 or higher
- [Claude Desktop](https://claude.ai/download)
- An active [intervals.icu](https://intervals.icu) account with API access
### 1. Get Your API Credentials
1. Log in to [intervals.icu](https://intervals.icu)
2. Navigate to **Settings ā Developer Settings** (near the bottom)
3. Click **Generate API Key**
4. Note your athlete ID from the URL: `intervals.icu/athlete/{ATHLETE_ID}`
ā ļø The athlete ID must include the `i` prefix (e.g., `i230309`)
### 2. Install Python Dependencies
```bash
cd intervals-icu-mcp
pip install -r requirements.txt
```
Or install in development mode:
```bash
pip install -e .
```
### 3. Test the Server (Recommended)
```bash
export INTERVALS_API_KEY="your_api_key"
export INTERVALS_ATHLETE_ID="your_athlete_id" # e.g., i230309
export INTERVALS_API_BASE_URL="https://intervals.icu/api/v1"
python test_server.py
```
### 4. Configure Claude Desktop
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
```json
{
"mcpServers": {
"intervals-icu": {
"command": "/usr/local/bin/python3",
"args": ["/absolute/path/to/intervals-icu-mcp/server.py"],
"env": {
"INTERVALS_API_KEY": "your_api_key_here",
"INTERVALS_ATHLETE_ID": "your_athlete_id_here",
"INTERVALS_API_BASE_URL": "https://intervals.icu/api/v1"
}
}
}
}
```
> **Important:** Use the full path to Python (e.g., `/usr/local/bin/python3`, not just `python`). On macOS, run `which python3` to find the correct path.
### 5. Restart Claude Desktop
Close and reopen Claude Desktop to load the MCP server.
---
## š¬ Usage Examples
### Wellness & Recovery
- "What's my HRV trend over the past 2 weeks?"
- "Update my wellness for today: weight 70 kg, HRV 65 ms, sleep quality 4"
- "Am I getting enough recovery based on my recent wellness data?"
### Training Analysis
- "Summarize my training volume for the past 30 days"
- "What were my hardest workouts this week?"
- "Export all my activities to CSV"
### Fitness Trends
- "What's my current fitness (CTL) and form (TSB)?"
- "Am I building fitness too quickly? Check my ramp rate"
- "When was I at peak fitness in the last 90 days?"
### Calendar & Planning
- "What races do I have coming up?"
- "Create a workout event for tomorrow: 60 min Z2 ride"
- "Delete the workout planned for next Tuesday"
### Workout Library
- "List all my workout folders"
- "Add a new workout: 4Ć8 min @ 110% FTP with 4 min rest"
- "Create a folder called 'VO2max Sessions'"
### Coaching
- "List all the athletes I coach"
- "What's the fitness trend for athlete John Doe?"
---
## š§ Troubleshooting
### Server not appearing in Claude Desktop
1. Verify the config file path is correct for your OS
2. Validate JSON syntax: `python -m json.tool ~/Library/Application\ Support/Claude/claude_desktop_config.json`
3. Confirm the absolute path to `server.py` is correct
4. Check that all three environment variables are present
### 401 / 403 Authentication Errors
- Confirm you're using v2.0.1 of `server.py` (includes the authentication fix)
- Ensure `INTERVALS_API_BASE_URL` is set
- Verify the athlete ID includes the `i` prefix
- Regenerate your API key in intervals.icu settings if needed
### No Data Returned
- Use `YYYY-MM-DD` date format
- Try a broader date range
- Confirm you have data in intervals.icu for the requested period
For a full troubleshooting guide, see [QUICKSTART.md](QUICKSTART.md).
---
## š Privacy & Security
- API credentials are stored locally in the Claude Desktop config file
- All requests go directly from your machine to intervals.icu ā no third parties
- Claude processes responses locally on your machine
- Proper HTTP Basic Auth encoding (base64) for API key transmission
- All user-supplied IDs and dates are validated before use to prevent injection
- Client-side rate limiting (10 req/sec) protects against accidental API abuse
- HTTP requests enforce timeouts (30s request, 10s connect) and connection pool limits
- Error messages are sanitized ā internal paths and stack traces are never exposed to the client
- `.gitignore` prevents accidental commit of `.env` files and credential configs
**Best practices:**
- Never share your API key or config file
- Protect the config file with restrictive permissions: `chmod 600 claude_desktop_config.json`
- Regenerate your API key if you suspect compromise
---
## š¤ Contributing
~95% of the public intervals.icu API is already covered. Potential areas for future contribution include FIT/GPX/TCX file uploads, workout file downloads (`.zwo`, `.mrc`, `.erg`), real-time activity streams, advanced analytics, and webhook integration.
When contributing:
- Match existing code style and naming conventions
- Add docstrings to all new tools
- Update relevant documentation (README, QUICKSTART, API_REFERENCE)
- Add test cases to `test_server.py`
---
## š Version History
### v2.1.0 - Security Hardening (March 2025)
- ā
Fixed Basic Auth encoding and removed credential leakage in debug logs
- ā
Added input validation (dates, IDs), rate limiting, HTTP timeouts
- ā
Sanitized error responses; added `.gitignore` for secrets protection
### v2.0.0 - Major Release (March 2025)
- ā
Extended from 8 to 36 API tools (4.5x increase)
- ā
Added full CRUD operations on all major entities
- ā
Workout Library management (9 new tools)
- ā
Training Plans support (4 new tools)
- ā
Coaching features (2 new tools)
- ā
Bulk operations and CSV export
- ā
Comprehensive documentation (7 guides)
### v1.0.0 - Initial Release (March 2025)
- ā
Basic read-only access to 8 core APIs
See [CHANGELOG.md](CHANGELOG.md) for detailed version history.
---
## š License
MIT License ā free to use and modify for your own training analysis needs.
---
## š Credits
Built for the [Model Context Protocol](https://modelcontextprotocol.io/) to integrate intervals.icu with Claude Desktop.
- [intervals.icu](https://intervals.icu) ā comprehensive training analytics platform
- [Anthropic](https://www.anthropic.com) ā Claude and the MCP framework
- The intervals.icu community ā API feedback and feature requests
---
## š¬ Support
- š **Setup**: [QUICKSTART.md](QUICKSTART.md)
- š **API Reference**: [API_REFERENCE.md](API_REFERENCE.md)
- š **Changelog**: [CHANGELOG.md](CHANGELOG.md)
- š **Bug Reports**: [GitHub Issues](https://github.com/kylemabry95/intervals.icu_to_claude_mcp_connection/issues)
---
_Made with ā¤ļø for athletes training smarter, not just harder_
ā Star this repo if it's useful for your training!
**v2.1.0** | [Changelog](CHANGELOG.md) | [Quick Start](QUICKSTART.md) | [API Reference](API_REFERENCE.md)
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues