Skip to main content

MCP server to drive Gearotons M17 open-source servomotors from natural language (Claude / any MCP client) over RS-485.

Project description

servomotor-mcp

Drive open-source Gearotons M17 servomotors from natural language.

An MCP server that exposes the M17 — a NEMA-17 integrated, closed-loop, RS-485 servomotor — as a small set of safe, high-level tools. Connect it to Claude Desktop, Claude Code, or any MCP client and control real motors by just asking:

"Home everything, then draw a square with the X and Y axes."

It ships with a mock backend, so you can try the whole thing with no hardware.

The first servomotor with an official MCP server. Open hardware, open firmware, open software — and now an open, AI-native control interface.


Quickstart (no hardware, ~2 minutes)

# Run the server directly with uv (recommended):
uvx --from servomotor-mcp servomotor-mcp

# or install it:
pip install servomotor-mcp
servomotor-mcp

Then add it to Claude Desktop — copy the block from examples/claude_desktop_config.json into your claude_desktop_config.json, restart Claude Desktop, and ask: "What motors do you have connected?" See examples/demo_prompts.md for the full scripted demo.

Drive real motors

Plug an M17 (or a daisy-chain of them) into a USB↔RS-485 adapter and switch the backend:

pip install 'servomotor-mcp[serial]'   # pulls in the Gearotons servomotor library
GEAROTONS_MOTOR_BACKEND=serial \
GEAROTONS_SERIAL_PORT=/dev/ttyUSB0 \
servomotor-mcp

Tools

Tool What it does
list_motors Discover motors on the bus + positions (call first).
move_to Move a motor to an absolute angle (closed-loop).
move_relative Nudge a motor by a delta.
trapezoid_move Smooth accel/decel move (best for arms/plotters).
home Home one or all motors.
get_status Position / moving / voltage / errors.
stop Halt one or all motors.
reset Recover a motor from a latched fault (firmware system reset, ~2 s).
run_sequence Run a choreographed sequence ("draw a square").

Safety rails (in the server, not the model)

The LLM can hallucinate a tool call; these make that safe — they run on every request:

  • Alias allow-list — only configured motors can be driven.
  • Position limits — absolute/relative targets are clamped to a per-motor software range, so a bad command can't drive an axis into a hard stop.
  • Speed clamp — requested speeds are capped.

Clamps are reported back to the model (in safety_notes) rather than silently applied, so it can see what actually happened and adjust. Configure via env:

GEAROTONS_MOTOR_ALIASES="x,y,z"
GEAROTONS_LIMITS='{"x":{"min_deg":-180,"max_deg":180,"max_speed":300},"z":{"min_deg":0,"max_deg":90}}'

How it works

natural language → Claude → MCP tool calls → this server → RS-485 → M17 motors

The server is a thin, safety-checked wrapper over the Gearotons servomotor Python library (high-level, unit-aware commands — no DIR/STEP timing). The same intents run against the mock backend for development and CI.

Develop / test

pip install -e '.[dev]'
pytest                      # safety + mock-bus tests, no hardware needed
GEAROTONS_MOCK_SIM_SECONDS=0.4 servomotor-mcp   # lifelike timing for demos

Status

  • ✅ MCP server, full tool surface, safety rails, mock backend — done; 16 unit tests pass.
  • SerialBus real-hardware backend — verified against a physical M17 (fw 0.15.0.0): discovery, telemetry, closed-loop moves at 0.000° repeatability, and a live safety clamp (a 200° command on a ±90° motor stopped at 90°). See hardware_tests/.
  • 🔜 Live FastMCP-over-stdio run with Claude Desktop needs a Python ≥3.10 host (tool logic already hardware-verified); plus the physical demo build + video. See demo spec.

License

MIT. Hardware, firmware, and software for the M17 are open-source — see github.com/tomrodinger/servomotor.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

servomotor_mcp-0.1.1.tar.gz (89.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

servomotor_mcp-0.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file servomotor_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: servomotor_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 89.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for servomotor_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d3a9cfe238a57001d9dd67e59e70f109b3a82dc423e472230ed82edc0d042bf8
MD5 942b8320fde44d27661a91547f3e0bdd
BLAKE2b-256 7902a6af8ea7f5301e0d0840bd42949d1168b3295a116b7a819964963d14dbc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for servomotor_mcp-0.1.1.tar.gz:

Publisher: publish.yml on Gearotons/servomotor-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file servomotor_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: servomotor_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for servomotor_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d078fcf2541de98d729a4b02960656c9087a4695e6fabf1979074911d4b92a3
MD5 e72e7b00fe260b0237143d241f300848
BLAKE2b-256 ab96b1d01572113a87ad43a4e3c24857acab235eb2368802de44ce42bf8de35d

See more details on using hashes here.

Provenance

The following attestation bundles were made for servomotor_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Gearotons/servomotor-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page