hevy-analytics is a shared Hevy analytics core with two adapters:
hevy-mcpfor LLM and MCP-compatible clientshevy-clifor cronjobs, automation, and dashboard ingestion
It exposes focused tools for exercise search, progression analysis, workout summaries, volume distribution, fatigue signals, accessory suggestions, training logging, and routine inspection.
hevy_analytics.serviceand related modules contain the analytics core.hevy_analytics.mcp_serverrenders the existing markdown contract for MCP clients.hevy_analytics.cliexposes the same capabilities for automation withjsonormarkdownoutput.
search_exercise(name)exercise_progression(name, weeks=12)recent_workouts(days=7, limit=30)weekly_volume(weeks=4)fatigue_check()suggest_accessories()training_log(days=30)top_exercises(days=30, limit=5)get_routines()
MCP tools return markdown with a stable section contract:
## Summary## Data Window## Details## Notes
- Python 3.11+
- Hevy API key
python3 -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
export HEVY_API_KEY="your-key"hevy-mcpCompatibility wrapper:
python3 run_hevy_mcp.pyhevy-cli recent-workouts --days 14 --output json --pretty
hevy-cli weekly-volume --weeks 6 --output markdown
hevy-cli training-log --days 30 --out data/training-log.json{
"mcpServers": {
"hevy": {
"command": "python3",
"args": ["/absolute/path/to/run_hevy_mcp.py"],
"env": {
"HEVY_API_KEY": "your-key"
}
}
}
}- Default output is
jsonfor automation and cronjobs. --output markdownpreserves the human-readable MCP-style rendering.--out PATHwrites snapshots directly to a file for downstream ingestion.--fail-on-no-dataexits non-zero when a command returnsstatus=no_data.- Exit codes:
0for success,1for errors,3forno_datawhen--fail-on-no-datais set.
0 6 * * * cd /absolute/path/to/hevy-mcp && /absolute/path/to/.venv/bin/hevy-cli recent-workouts --days 2 --out data/recent-workouts.json --pretty
15 6 * * * cd /absolute/path/to/hevy-mcp && /absolute/path/to/.venv/bin/hevy-cli weekly-volume --weeks 4 --out data/weekly-volume.json --pretty- Read-only integration (GET-oriented API usage).
- Input guards:
days:1..365weeks:1..52limit:≥ 1name: minimum 2 characters
- Fuzzy matching uses
difflib(no external fuzzy dependency).
- Python package changed from
hevy_mcptohevy_analytics. - Distribution name changed from
hevy-mcptohevy-analytics. hevy-mcpremains the MCP executable for compatibility.- New automation entrypoint:
hevy-cli. run_hevy_mcp.pyremains as a thin compatibility wrapper.
Run checks in this order:
python3 -m ruff check .
python3 -m mypy src tests
python3 -m pytestGitHub Actions runs these checks on push and pull_request.
If you find a security issue, follow /SECURITY.md.
Do not open public issues for secrets or vulnerabilities.
MIT. See /LICENSE.