Gearotons M17 Servomotor

io.github.Gearotons由 GitHub 账号 Gearotons 发布v0.3.3更新于 Oct 24, 2026

Drive Gearotons M17 open-source servomotors from plain English over RS-485; mock mode, no hardware.

概览

AI 生成的概览

本地 MCP 服务器,让助手用自然语言发现、连接并驱动 Gearotons M17 RS-485 伺服电机,并提供无需硬件的模拟模式。

可以做什么
发现串口并连接电机总线,自动识别总线上的电机,也可断开连接或重新扫描(detect_devices 会重启电机)。列出已识别电机及其实时位置、电压、温度和状态,并读取单个电机快照、将错误解码为易懂说明。以角度为单位做绝对或相对移动,停止单个或全部电机,运行编排好的步骤序列(可含原始命令步骤)。将每条固件命令暴露为独立工具,如 enable_mosfets、homing、zero_position、set_pid_constants、set_device_alias、vibrate、system_reset,可按别名、唯一 ID 或 all 寻址电机。
适用场景
当你有一组接在 RS-485 总线上的 Gearotons M17 伺服电机,想通过 Claude Desktop、Claude Code 或其他 MCP 客户端以对话方式驱动它们时适用。也可在没有硬件时用模拟后端体验完整命令集。
运行要求
以 Python 包(servomotor-mcp,可通过 pip 或 uvx)在本地以 stdio 运行。驱动真实电机需安装 serial 附加组件(会引入 Gearotons servomotor 库)以及 USB 转 RS-485 适配器;未安装该库时服务器运行模拟器。可选环境变量 GEAROTONS_MOTOR_BACKEND、GEAROTONS_SERIAL_PORT、GEAROTONS_DEFAULT_SPEED_DPS。仅支持桌面端。
安装前请注意
工具调用会直接转发到硬件,软件层不做限幅,因此移动、回零、置零、修改 PID、修改别名和 system_reset 都会作用于真实电机,只有固件的过流、过压、过温保护生效。detect_devices 会重启总线上的电机。期望真实动作时请确认后端不是 mock;有多个适配器时请确认端口正确。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Gearotons M17 Servomotor,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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 — to Claude Desktop, Claude Code, or any MCP client. Control real motors by just asking:

"Find my motors and rotate the one on the bench two full turns, slowly."

Nothing is hardcoded: the server discovers your serial ports, auto-detects the motors on the bus (the firmware's "Detect devices" command), and exposes the entire firmware command set — every command in the servomotor library's catalog becomes an MCP tool automatically (48 commands as of library 0.10.0), plus a few high-level tools for everyday moves. It ships with a mock backend, so you can try the whole thing with no hardware.

[Claude Code driving a real Gearotons M17 over MCP: find the motor, turn it two rotations, back, read the encoder]

▶ 50-second video: the real motor and this session side by side — recorded 2026-09-09 on a bench M17; every line above is from the session log.

Step-by-step tutorial (boxed motor to "talk to it" in about twenty minutes): Talk to a servomotor from Claude Code on Hackster.

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)

bash
# Run the server directly with uv (recommended). This runs the SIMULATOR —# for real motors see "Drive real motors" below:uvx --from servomotor-mcp servomotor-mcp
# or install it:pip install servomotor-mcpservomotor-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 serial ports do you see? Connect and find my motors." See examples/demo_prompts.md for a scripted demo.

Drive real motors

Plug an M17 (or a daisy-chain of them) into a USB↔RS-485 adapter and install the [serial] extra — that's it, no configuration:

bash
pip install 'servomotor-mcp[serial]'   # pulls in the Gearotons servomotor libraryservomotor-mcp

With the servomotor library installed the server uses the real serial backend automatically. Without it, the server runs its simulator and says so: list_serial_ports and connect return a notice field, and a warning goes to stderr. With uv, use uvx --from 'servomotor-mcp[serial]' servomotor-mcp. In a session, the model then:

  1. list_serial_ports — enumerates the machine's ports (macOS /dev/cu.*, Windows COM*, Linux /dev/ttyUSB*), flagging USB serial adapters;
  2. connect — opens the port you (or it) picked, at 230400 baud;
  3. auto-detects every motor on that bus (unique ID + alias) — no address maps to write;
  4. drives them. Tell it in plain English which adapter to use if you have several.

Tools

High-level (discovery + everyday motion):

ToolWhat it does
list_serial_portsEnumerate serial ports with USB metadata (call first).
connect / disconnectOpen a port and auto-detect the motors on that bus.
detect_devicesRe-scan the bus (reboots the motors on it).
list_motorsDetected motors with live position/voltage/temperature/status.
move_to / move_relativeAbsolute / relative moves in degrees; waits for completion.
stopEmergency-stop one or all motors.
get_motor_statusOne motor's snapshot, fatal errors decoded to plain English.
run_sequenceChoreographed steps ("draw a square"), incl. raw command steps.

Plus one tool per firmware command, generated from the library's command catalog: enable_mosfets, go_to_position, move_with_velocity, move_with_acceleration, multimove, homing, zero_position, get_position, get_temperature, set_device_alias, set_pid_constants, system_reset, vibrate, ping, … — anything the motor can do, the model can do. Motors are addressed by their alias number, their 16-hex-digit unique ID, or "all" (broadcast). Values are in friendly units (degrees, seconds, degrees/s, volts, °C); the server converts to firmware units.

How it works

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

The server is a thin layer over the Gearotons servomotor Python library. The library is data-driven — motor_commands.json defines every firmware command — and the server turns that same catalog into MCP tools, so new library commands appear automatically. Tool calls are forwarded straight to the hardware — no software clamping; full multi-turn travel, any speed. The motor's own firmware protections (over-current / over-voltage / over-temperature) still apply. The same tools run against the mock backend (GEAROTONS_MOTOR_BACKEND=mock) for development and CI.

Environment variables (all optional):

  • GEAROTONS_MOTOR_BACKEND — auto (default: serial when the servomotor library is installed, else mock), serial, or mock.
  • GEAROTONS_SERIAL_PORT — default port for connect when the model doesn't pass one.
  • GEAROTONS_DEFAULT_SPEED_DPS — default speed for move_to/move_relative (180).

Develop / test

bash
pip install -e '.[dev]'GEAROTONS_MOTOR_BACKEND=mock pytest     # catalog + mock-bus + server-tool tests

hardware_tests/ contains scripts that exercise the real serial path end to end (port sweep, full command suite, stdio MCP session) against a bench motor.

Status

  • ✅ Full firmware command surface (48 commands), serial-port discovery, bus auto-detection — verified on a physical M17 (fw 0.15.3.0) over a real stdio MCP session and via uvx, on all four test adapters (motor found only where it truly is).
  • ✅ Mock backend + 39 unit tests, no hardware needed.
  • ✅ Cross-platform port handling (macOS / Windows / Linux) via pyserial enumeration.

License

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

来源:README.md,提交 190aff5

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.3.3最新Sep 22, 2026
  2. v0.3.1Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分