Skip to main content
Glama

armctl: Claude-controlled capstan joints

MCP server that lets Claude (in Claude Code) drive the Group 26K66 capstan joints through ODrive S1 controllers over USB. It is written for the single-drum test stand now and the 3-joint v8 arm (J1/J2/J3 + parallelogram elbow limit) later.

Author: Zin Lin Htet. MIT license.

You ──chat──> Claude Code ──tool call──> armctl-mcp (this repo, on your laptop) ──USB──> ODrive S1 ──> motor

Files

File

What it is

arm.toml

Your settings: joints, ODrive serials, limits, speeds, gains. Edit this, not the code.

src/armctl/server.py

MCP tools Claude can call

src/armctl/joint.py

Degrees ↔ motor turns, limits, move-and-wait, jam detection

src/armctl/drive.py

ODriveDrive (real hardware) and SimDrive (fake motor)

src/armctl/config.py

Reads arm.toml

src/armctl/check.py

armctl-check: finds the ODrive and prints its serial (no motion)

tests/

Simulator tests: full MCP session plus jam and stop handling

logs/moves.csv

Created automatically: every move with its error and peak current (use it for reports)

Related MCP server: UGS-MCP

Tools Claude gets

Tool

Action

joints

Lists the configured joints and their limits (no hardware access)

status(joint)

Reads on/off state, angle, current, Vbus and errors; nothing moves

zero_here(joint)

Sets the reference while the motor is off and the joint is held on its stop

enable(joint) / disable(joint)

Motor on (holds its position) / motor off

move(joint, deg)

Moves to an absolute angle and waits; returns the result, error and peak current

jog(joint, delta_deg)

Relative move, at most 30° per call

park(joint)

Moves to home_deg, then turns the motor off

stop()

Turns every motor off immediately and aborts any move in progress

clear_errors(joint)

Clears the ODrive error flags

history(last)

Recent moves plus mean and maximum error

Built-in safety:

  • No motion until the joint has been zeroed and enabled.

  • Moves outside the limits are refused.

  • The J3−J2 elbow coupling limit is enforced.

  • A jam (|Iq| above 3.5 A for 0.3 s) turns the motor off.

  • Every move has a timeout.

  • The reference is cleared if the USB link drops.

Setup (Windows, VS Code terminal)

Requires Python 3.11 or newer (py --version).

cd $HOME\Documents\capstan-arm-mcp
py -3.12 -m venv .venv
.\.venv\Scripts\pip install -e .

1. Test with no hardware:

.\.venv\Scripts\python tests\test_safety.py
.\.venv\Scripts\python tests\test_sim.py

Both should end with ALL PASSED.

2. Register with Claude Code. Add a simulator copy first so you can practise:

claude mcp add armctl-sim -- "$PWD\.venv\Scripts\armctl-mcp.exe" --config "$PWD\arm.toml" --sim
claude mcp add armctl     -- "$PWD\.venv\Scripts\armctl-mcp.exe" --config "$PWD\arm.toml"
claude mcp list

In Claude Code, /mcp shows both servers. Keep only one of them enabled at a time.

3. Check the ODrive. With 24 V on, USB plugged in and the Web GUI closed:

.\.venv\Scripts\armctl-check

It prints the serial, firmware, Vbus and errors. If no ODrive is found, install the WinUSB driver for it with Zadig, then try again. With more than one board, plug them in one at a time and copy each serial into arm.toml.

First run on the stand

Say to Claude Code:

  1. "Status of the stand."

  2. Motor off; hold the drum on the bottom stop. "It's on the bottom stop, zero it."

  3. "Enable and move to 20°."

  4. "Jog +1° five times, then show history."

  5. "Park."

Rules:

  • Someone keeps a hand on the 24 V switch whenever the motor can move.

  • Zero again after every ODrive power-up.

  • Only one program can use the ODrive's USB at a time, so close the Web GUI and odrivetool first.

Moving to the v8 arm

In arm.toml, uncomment J1/J2/J3 and the [[couplings]] block, fill in the serials, and measure the real stop_deg / limits. The stand block can then be removed. No code changes are needed.

Tuning notes

  • direction: if "move to 20°" drives the drum down, motor off now, flip the sign and re-zero.

  • speed_dps, accel_dps2: set in drum degrees. With 8:1 gearing, 45°/s is 1 motor turn/s.

  • Gains and the current limit are written to the ODrive on every connect. They are never saved to its flash.

Available Tools

12 tools
clear_errorsA

Clear ODrive error flags. Only after the cause is understood. Returns fresh status.

Inputs: joint (required).

disableA

Turn the motor off (goes limp; a loaded joint may drop).

Inputs: joint. Returns: result

enableA

Turn the motor on (closed loop). It holds the current angle; nothing moves yet.

Inputs: joint (required).

historyB

Recent move results plus accuracy summary (mean / max absolute error of arrived moves).

Inputs: last.

homeA

Find the reference automatically: creep slowly (current-limited) into the reference stop, zero there, then enable and move to home_deg. MOVES the joint: get the user's go-ahead first. Works from any starting position; stop() aborts it.

Inputs: joint (required).

jogB

Move a joint by a relative amount (max 30 deg per call) from where it is holding.

Inputs: joint (required), delta_deg (required).

jointsA

List the configured joints with their limits, home angle and reference stop. Does not touch hardware.

Inputs: no named parameters. Returns: result

moveB

Move a joint to an absolute angle in degrees and wait until it arrives. Returns result ('arrived' or the reason it stopped), final angle, error and peak current.

Inputs: deg (required), joint (required).

parkA

Move joint(s) to their home angle, then turn the motor off. Use at the end of a session. With 'all', joints are parked in reverse config order (wrist side first).

Inputs: joint. Returns: result

statusB

Read joint state without moving: on/off, angle (deg), current (A), bus voltage, ODrive errors.

Inputs: joint. Returns: result

stopA

Emergency software stop: every motor off now, aborting any move in progress.

Inputs: no named parameters. Returns: result

zero_hereA

Set the angle reference. ONLY after the user confirms the motor is off and they are holding the joint on its reference hard stop. Needed after every ODrive power-up.

Inputs: joint (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, and descriptions explicitly separate motion commands (move=absolute, jog=relative, home=auto-referencing, park=go home then disable). Minor overlap remains between zero_here and home (both establish the angle reference) and between park and a move-to-home_deg, which an agent could conflate without reading carefully.

    Naming Consistency4/5

    There is a coherent readable pattern: noun-style names for read-only queries (joints, status, history) and imperative verbs for actions (enable, disable, stop, move, jog, park, home). The only deviations are the two snake_case verb_noun names (zero_here, clear_errors) breaking an otherwise uniform single-token scheme.

    Tool Count5/5

    Twelve tools is well within the sweet spot and each one maps to a distinct operation an agent actually needs (query, reference, energize, move, safety stop, error recovery, telemetry). No tool feels like filler.

    Completeness4/5

    The surface covers the full safe-motion lifecycle: inspect config/state, establish reference, enable, move, stop, park, clear faults, and review accuracy history. Gaps are minor — joints is read-only (no way to add or reconfigure a joint), and there is no way to adjust current limits or other motion parameters from the tool set.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Bridges Claude Code to CNCjs to enable remote control and monitoring of GRBL-based CNC machines. It provides a comprehensive toolset for managing G-code jobs, machine movement, and safety operations through natural language.
      30
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for controlling CNC machines via Universal GCode Sender. Lets Claude (or any MCP-compatible AI assistant) connect to a CNC machine, inspect G-code, and issue motion commands — all through the UGS Pendant REST API.
      19
      6
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Let an AI agent drive up to 12 hobby servos on an open-hardware USB-C controller (Pololu Maestro compatible): moves, named poses, sequences, on-board scripts and rail current/voltage readout, with per-channel travel limits and overcurrent guardrails. Includes a --mock emulator, so it runs without the board.
      16
      1
      MIT