ergctl
Discovers and controls Bluetooth SIG FTMS fitness ergometers over BLE, reading live telemetry and sending control-point commands for workout execution.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Ergctl
Product Hub: raymonddeoliveira.com/software#ergctl · Releases & Checksums: GitHub Releases · Verified MCP: Glama · Official MCP Registry: io.github.raydeoliveira/ergctl · Pro Storefront ($29): Polar.sh · Free Core:
brew tap raydeoliveira/tap && brew install ergctl
Zero-dependency macOS CLI, interactive terminal dashboard (tui), structured workout engine, and live --json / MCP AI-coaching controller for Bluetooth SIG FTMS v1.0 (0x1826) and Concept2 PM5 (CE06xxxx BLE GATT + VID 0x17A4 USB HID CSAFE) fitness ergometers.
Replaces $20–$44/mo closed trainer and indoor rowing subscriptions with one native ~1.9 MB Apple Silicon binary — 100% open protocols, zero proprietary SDKs, zero reverse-engineering risk, binary .fit export (CRC-16), and a live bidirectional AI-coaching loop.
Measured Footprint
Measured on Apple Silicon (arm64-apple-macos14.0, Swift 6.4.2):
Metric | Measured Value |
Stripped binary ( |
|
Compressed release tarball ( |
|
Claude Desktop bundle ( |
|
External runtime dependencies |
|
|
|
Automated verification |
|
Related MCP server: Fieldkit
What It Does / Free Core vs. Pro
Capability | Included In |
| Free Core |
| Free Core |
| Free Core |
| Free Core |
Unidirectional | Free Core |
| Free Core |
Read-only & | Free Core |
Live | Pro ($29 one-time) |
Bidirectional AI-coaching | Pro ($29 one-time) |
Interactive raw-mode terminal | Pro ($29 one-time) |
Explicit Non-Goals & Honest Verification Disclosure:
macOS Apple Silicon (
arm64, macOS 14+) release binaries. Zero proprietary vendor SDKs, kernel extensions, or DriverKit bridges.Open specs only: Bluetooth SIG FTMS (
0x1826Data0x2ACD/2ACE/2ACF/2AD1/2AD2, Feature0x2ACC, Control Point0x2AD9, Status0x2ADA, Companion0x180D/180F/180A) and Concept2 PM5 open specifications (CE060010/0020/0030/0080+ USB HID0x17A4CSAFE). Concept2 PM5 flywheel ergs exposeelectronic_resistance: falseandprogrammable_target_display: true.Headless macOS Bluetooth TCC note: Unbundled terminal scans require macOS Bluetooth permission (
Privacy & Security > Bluetooth) orNSBluetoothAlwaysUsageDescription; denied TCC exits deterministically (exit 4,PERMISSION_DENIED) instead of aborting (--transport usband--simdo not require Bluetooth TCC).Hardware testing scope: All FTMS & PM5 wire codecs, BLE GATT characteristic routing (
0021/0022/0031–003D/0080), USB HID CSAFE framing, ANT+.fitbinary CRC-16 encoding,lstat-guarded0600snapshots, loopback Polar licensing, real PTYtermiosraw-modetuirecovery, MCP2024-11-05stdio transport,57XCTests, and208E2E tests ran on Apple Silicon macOS. Physical BLE trainers and physical Concept2 PM5 monitors have not yet been attached to the build host — runprobeand--dry-runfirst on live equipment.
Install & Uninstall
Homebrew (Recommended)
brew tap raydeoliveira/tap
brew install raydeoliveira/tap/ergctl
ergctl --versionRelease Tarball & SHA-256 Verification
tar -xzf ergctl-0.1.0-macos-arm64.tar.gz
shasum -a 256 -c SHA256SUMS.txt
install -m 755 ergctl-0.1.0-macos-arm64/ergctl /usr/local/bin/ergctl
ergctl --versionClaude Desktop (One-Click .mcpb) & MCP Clients (Claude Code / Codex / Cursor)
Download ergctl-0.1.0-macos-arm64.mcpb from GitHub Releases and open it in Claude Desktop, or point any MCP client at Homebrew ergctl:
{
"mcpServers": {
"ergctl": {
"command": "ergctl",
"args": ["mcp"],
"env": {
"ERGCTL_LICENSE_KEY": "<optional-polar-pro-key>"
}
}
}
}Install the companion AI agent skill (SKILL.md):
npx skills add raydeoliveira/ergctlBuild From Source (Swift 6, macOS 14+)
# Commercial build (Free Core + Polar.sh Pro activation):
swift build -c release
swift test
# Open-Source Edition build (MIT seam, all features unlocked offline):
ERGCTL_EDITION=oss swift build -c release
ERGCTL_EDITION=oss swift testUninstall
rm -f /usr/local/bin/ergctl
rm -rf ~/.config/ergctlQuick Start
1. Discover Machines & Inspect Capabilities (probe)
ergctl probe --sim --jsonReal excerpt from Apple Silicon simulator output (10 simulated devices across FTMS + PM5 BLE/USB):
{"id":"sim-ftms-bike-1","machine_type":"indoor_bike","name":"Sim Kickr FTMS Bike","protocols":["ftms"],"transport":"sim"}2. Validate & Run Workouts (json, yaml, .erg, .mrc)
ergctl workout validate examples/workout_sweet_spot.json --json
ergctl workout run examples/workout_rower.yaml --sim --device sim-pm5-ble-v2-row-1 --out row.ndjson --yes --json3. Live Bidirectional AI-Coaching Loop & MCP Server
# Dry-run safety preview (Free, 0 hardware writes):
ergctl control --sim --device sim-ftms-bike-1 --watts 210 --dry-run --yes --json
# Live bidirectional AI coaching loop with 4s safety watchdog:
python3 examples/ai_coach_loop.py --bin "$(command -v ergctl)" --ticks 8 --watts 210
# Interactive terminal dashboard (real TTY required, Free/Pro):
ergctl tui --sim
# Export session to binary ANT+ .fit (validates 14B header + trailing CRC-16):
ergctl export row.ndjson --format fit --out workout.fit --json
# Stop hardware & roll back snapshots cleanly:
ergctl restore --sim --yes --jsonSafety, Watchdog & Exit Codes
Every mutating control path enforces: capability validation -> lstat-verified 0600 baseline snapshots -> --dry-run zero-write inspection -> SafetyLimits clamps (--max-power, --max-speed) -> ERGCTL_WATCHDOG_MS AI heartbeat auto-revert -> clean SIGINT/SIGTERM hardware stop (exit 130).
Code | Meaning |
| Success ( |
| Runtime error, decode/encode error, or watchdog/interrupt rollback |
| Invalid CLI syntax, out-of-range target, unsupported capability, or non-TTY |
| No matching FTMS/PM5 hardware connected |
| macOS Bluetooth TCC / USB HID permission denied or symlink output path rejected |
| Pro license missing/invalid/expired (omitted in |
| Interrupted by |
License & Support
Commercial binary distribution is licensed under LICENSE (Free Core +
$29one-time Perpetual Pro license via Polar.sh, up to 3 personal Macs, 14-day offline cache grace, zero telemetry).Security policy: SECURITY.md · Changelog: CHANGELOG.md · AI Agent Guide: SKILL.md · MCP Manifest: server.json.
Tool 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
Convert, validate, and inspect workout files (FIT, TCX, ZWO, Garmin Connect) for AI agents.
Read-only Linux server and Docker monitoring for AI assistants: CPU, memory, disk, network.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Garmin watch data for AI assistants: activities, sleep, HRV, recovery. Never writes to Garmin.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables an AI agent to run local tools on the user's own machine via stdio, including command execution, workspace file read/write, and system status checks.52MIT
- AlicenseBqualityBmaintenanceEnables a small local AI model to discover, describe, run, undo, and verify deterministic tools over JSON-RPC on stdio, with previews and approval gates for changes.10AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables an AI agent to drive a remote Linux machine over the LAN through a single TCP connection, exposing tools for shell commands, jobs, interactive PTYs, file read/write/search/transfer, process and service management, networking, packages, and power control, with optional multi-host switching. Operates without SSH or any Linux-side installation beyond one stdlib-only Python daemon, using a state-free binary protocol.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to perform sandboxed file-system operations, read-only SQLite querying and schema inspection, environment diagnostics, and cryptographic hashing over Stdio or HTTP using JSON-RPC.2MIT