Skip to content

Support for Multiple Athletes (Coach Mode) #88

@splanes

Description

@splanes

Feature Request: Support for Multiple Athletes (Coach Mode)

Description

Currently, the MCP server configuration requires a single athlete_id. However, the Intervals.icu API key also works for coaches who manage multiple athletes.

Feature Request

Add support for handling multiple athletes when using a coach's API key. This could be implemented as:

  1. Optional athlete_id: When not specified, the server could:

    • List all athletes accessible by the coach
    • Accept athlete_id as a parameter in tool calls
  2. Dynamic athlete selection: Allow tools to receive athlete_id as an optional argument, defaulting to a configured athlete if specified

Use Case

Coaches managing multiple athletes would benefit from a single MCP server instance that can access data across all their athletes, rather than requiring separate configurations per athlete.

Examples

Current Configuration (Single Athlete)

{
  "mcpServers": {
    "intervals-icu": {
      "command": "python",
      "args": ["-m", "intervals_mcp_server.server"],
      "env": {
        "API_KEY": "xxx",
        "ATHLETE_ID": "12345"
      }
    }
  }
}

Proposed Configuration (Coach Mode)

{
  "mcpServers": {
    "intervals-icu": {
      "command": "python",
      "args": ["-m", "intervals_mcp_server.server"],
      "env": {
        "API_KEY": "xxx"
        // ATHLETE_ID omitted - enables coach mode
      }
    }
  }
}

Integration with Qwen Code

Adding the MCP Server to Qwen Code

Option 1: HTTP Transport

# Start the server first
python -m intervals_mcp_server.server

# Add to Qwen Code
qwen mcp add --transport http intervals-icu http://localhost:3000/mcp

Option 2: Stdio Transport (recommended for local development)

qwen mcp add --transport stdio intervals-icu \
  --command python \
  --args "-m,intervals_mcp_server.server" \
  --env API_KEY=your_api_key \
  --env ATHLETE_ID=12345

Option 3: Using editable install with environment file

pip install -e .
qwen mcp add --transport stdio intervals-icu \
  --command python \
  --args "-m,intervals_mcp_server.server" \
  --env-file .env

Example .env File

# Coach mode (multiple athletes)
API_KEY=your_coach_api_key

# Or single athlete mode
API_KEY=your_api_key
ATHLETE_ID=12345

Example Tool Calls (Coach Mode)

Once coach mode is implemented, tools could be called like:

@intervals-icu get_activity_data athlete_id=12345 activity_id=abc123
@intervals-icu get_activity_data athlete_id=67890 activity_id=def456
@intervals-icu list_athletes  # Returns all athletes for the coach

Benefits

  • Single MCP server instance for coaches
  • More flexible athlete management
  • Better alignment with Intervals.icu coach functionality
  • Reduced configuration overhead

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions