Skip to main content
Glama

aiTrainer

Personal workout coach as a Python MCP server for OpenClaw. Chat over Telegram, log exercises in natural language, and let the agent read structured progress from SQLite.

Features

  • Log exercises, sets, reps, weights, optional RPE, and notes

  • Automatic workout session grouping (same day + within idle timeout)

  • Exercise aliases (bench, bench press, etc.)

  • Progress signals: estimated 1RM, personal bests, volume trend, sessions since last increase

  • MCP stdio transport for OpenClaw

Related MCP server: super-hevy-mcp

Requirements

  • Python 3.11+

  • Linux target machine (also works on macOS for development)

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Run locally

aicoach-mcp

Or:

python -m aicoach.server

Configuration

Environment variables:

Variable

Default

Description

AICOACH_DB_PATH

~/.local/share/aicoach/aicoach.db

SQLite database path

AICOACH_DEFAULT_UNIT

kg

Default weight unit

AICOACH_IDLE_TIMEOUT_SECONDS

10800 (3h)

Auto-close idle workout sessions

OpenClaw setup

Add aiCoach to your OpenClaw MCP config. On a standard install this lives in ~/.openclaw/openclaw.json.

Option A: CLI helper

openclaw mcp set aicoach '{
  "command": "/path/to/aicoach/.venv/bin/aicoach-mcp",
  "env": {
    "AICOACH_DB_PATH": "/home/you/.local/share/aicoach/aicoach.db"
  }
}'

Option B: direct JSON config

{
  "mcpServers": {
    "aicoach": {
      "command": "/path/to/aicoach/.venv/bin/aicoach-mcp",
      "args": [],
      "env": {
        "AICOACH_DB_PATH": "/home/you/.local/share/aicoach/aicoach.db"
      }
    }
  }
}

Notes:

  • A command field means OpenClaw launches the server over stdio automatically.

  • Use the absolute path to your virtualenv binary on the Linux host.

  • Restart or reload OpenClaw after changing MCP config.

Agent prompt

Copy prompts/coach_instructions.md into your OpenClaw agent instructions so the model knows when to call aiCoach tools.

MCP tools

Tool

Purpose

log_workout

Log one exercise and attach it to the current session

get_current_workout

Show the open session and exercises logged so far

get_session

Fetch one session with set ids for editing

get_exercise_history

Recent sessions for one exercise

get_recent_workouts

Recent sessions across exercises

get_progress

Coaching signals for one exercise

list_exercises

Known exercises and aliases

update_session

Change a session date or note

update_workout_set

Update one set by id

delete_session

Delete an entire workout session

delete_exercise_from_session

Delete one exercise from a session

merge_sessions

Merge source sessions into one target session

Example tool input

{
  "exercise": "squat",
  "sets": [
    {"reps": 5, "weight": 100},
    {"reps": 5, "weight": 100},
    {"reps": 5, "weight": 100}
  ],
  "note": "moved well"
}

Tests

pytest

MCP stdio smoke test:

python scripts/mcp_smoke_test.py

OpenClaw example config

See examples/openclaw-mcp-snippet.json for a copy-paste MCP server entry.

Project layout

aicoach/
  config.py      # settings and env vars
  db.py          # sqlite schema
  repository.py  # storage and session logic
  progress.py    # coaching signals
  server.py      # MCP server
prompts/
  coach_instructions.md
tests/

Available Tools

6 tools
get_current_workoutA

Return the open workout session and all exercises logged so far today.

Inputs: no named parameters. Returns: result

get_exercise_historyB

Return recent workout sessions for a single exercise.

Inputs: exercise (required), limit. Returns: result

get_progressB

Return coaching signals such as estimated 1RM, volume trend, and PRs.

Inputs: exercise (required). Returns: result

get_recent_workoutsC

Return recent workout sessions across all exercises.

Inputs: days, limit. Returns: result

list_exercisesA

List known exercises and aliases to help normalize exercise names.

Inputs: no named parameters. Returns: result

log_workoutA

Log sets for one exercise and attach them to the current open workout session.

Inputs: sets (required), exercise (required), note, performed_on. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct aspect: current workout, exercise history, progress, recent workouts, exercise list, and logging. No overlap in purpose.

    Naming Consistency5/5

    Every tool follows a consistent verb_noun pattern (get_, list_, log_), with no mixing of styles or vague verbs.

    Tool Count5/5

    With 6 tools, the server is well-scoped for a workout tracking assistant—not too few, not too many.

    Completeness4/5

    Covers core needs: listing exercises, logging, viewing current workout, history, and progress. Minor gap: no explicit create/close session, though log_workout may implicitly open one.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A personal fitness tracking server that enables logging and querying workouts, nutrition, and body metrics through a local SQLite database. Integrates with OpenNutrition MCP for food logging and supports exercise history tracking for workout progression.
      17
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the Hevy workout tracker that enables users to query training history, log workouts, and manage routines via natural language.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Self-hosted fitness tracking MCP server that gives AI assistants access to your nutrition, training, weight, sleep, and accomplishment data via 77 tools and 5 resources. Enables natural-language logging and querying of personal health metrics through Claude or ChatGPT.
      12 npm
      1
      BSD 2-Clause "Simplified"