roarm-mcp
An MCP server that lets LLM agents drive a Waveshare RoArm-M3 desk arm, with a safety layer the agent cannot bypass.
Every frame comes from the same Arm, safety layer and simulator the MCP server uses
(uv run --extra render python scripts/record_demo.py docs/media/demo.gif). Refused targets turn red, and the
out-of-reach refusal carries a suggested safe pose that the next call follows. The arm in the GIF is drawn with
meshes split from Waveshare's official RoArm-M3 STEP file (--meshes); those meshes are not in this repository,
and without them the simulator draws a box-and-cylinder shell.
- Simulation first. The arm runs in MuJoCo. No hardware is needed to try it.
- Safety below the agent. Every motion is planned into joint waypoints, and every waypoint is checked (joint limits, self-collision, arm-table collision, clearance of every link and of the tool tip) before anything moves. A monitor then checks what actually ran and halts the arm if it leaves the envelope.
- Refusals a model can use. A refused command returns a reason code, a message and, when one exists, the farthest checked-safe pose toward the target, so the model can correct itself instead of retrying blindly.
Status: 0.1, simulation only. Real-hardware transports (USB serial and Wi-Fi) are the next milestone.
--realis refused in this release.
Quick start
Requires Python 3.11+ and uv. No clone needed:
uvx roarm-mcp --help
Claude Code
claude mcp add roarm -- uvx roarm-mcp
Claude Desktop and other MCP clients
{
"mcpServers": {
"roarm": {
"command": "uvx",
"args": ["roarm-mcp"]
}
}
}
Options
| Flag | Effect |
|---|---|
--trace FILE |
Append every tool call, its arguments and its verdict to a JSONL file |
--http |
Serve streamable HTTP on --host/--port (default 127.0.0.1:8000) instead of stdio |
--allow-remote |
Required for a non-loopback --host. The HTTP endpoint has no authentication |
--fast |
Run the simulation faster than real time |
--log-level |
DEBUG to ERROR. Logs go to stderr only, so stdio stays clean |
Then ask, for example: "Check the limits, then move the gripper to 40 mm above the table at x=220, y=80."
Tools
Coordinates are millimetres in the table frame: x forward, y left, z = height of the tool centre point above the table. Angles are degrees.
| Tool | What it does |
|---|---|
get_state |
Tool pose, joint angles, gripper opening, lowest clearance above the table, whether a motion is running |
get_limits |
The active safety envelope. Fixed at startup; no tool can change it |
move_to(x_mm, y_mm, z_mm, pitch_deg=90, roll_deg=0, speed=0.5) |
Move the tool centre point. pitch_deg 90 = pointing straight down |
move_joints(joints_deg, speed=0.5) |
Move the five arm joints |
gripper(opening, speed=0.5) |
0 = closed, 1 = fully open |
rest(speed=0.5) |
Return to the rest pose |
stop() |
Halt the running motion at the next waypoint. Software stop only |
Resources: roarm://limits and roarm://trace/latest (the last 50 tool calls with their verdicts).
A refused call returns isError: true with structured content like:
{
"ok": false,
"refusal": {
"code": "TABLE_CLEARANCE",
"message": "target z is 0 mm; the tool must stay at least 18 mm above the table",
"details": {"z_mm": 0.0},
"suggestion": {"x_mm": 220.3, "y_mm": 79.9, "z_mm": 18.0, "pitch_deg": 89.9, "roll_deg": 0.0,
"note": "farthest checked-safe pose on the straight line toward the target (55% of the way)"}
}
}
Refusal codes: OUT_OF_REACH, TOO_CLOSE, TOO_HIGH, TABLE_CLEARANCE, TABLE_COLLISION, SELF_COLLISION,
JOINT_LIMIT, UNREACHABLE (no joint solution within tolerance), BAD_TARGET, BAD_JOINTS, BAD_GRIPPER,
BUSY, STOPPED, ENVELOPE_BREACH, INTERNAL_ERROR (a fault inside the server; logged and traced, and the arm
is free for the next call).
Safety model
agent ──► MCP tool ──► plan (IK, joint-space waypoints)
│
▼
check every waypoint ── refuse with reason + safe suggestion
│
▼
transport.follow ──► monitor what actually ran ── halt on breach
Details and the default numbers are in docs/safety.md. In short:
- The envelope is a frozen value object, built once at startup. The MCP surface has no tool that can widen it.
- Inverse kinematics never returns a non-converged answer as a plan; a miss beyond 1 mm or about 1° is a refusal.
- The checked waypoints are the exact waypoints the transport follows.
stop()is a software stop. On real hardware, the physical power switch is the only real emergency stop.
Development
git clone https://github.com/SamKo88927/roarm-mcp && cd roarm-mcp
uv sync
uv run ruff check . && uv run ruff format --check .
uv run pyright # strict
uv run pytest -q --cov=roarm_mcp
The tests include property-based tests (Hypothesis) that send random targets and joint sets, including far outside the workspace, and check the clearance measured on the stepped simulation rather than only on the plan. A guard test fails the suite if too few of those random commands actually moved the arm.
Limitations
- Simulation only in 0.1. The real-arm transports, camera tools and pick/place skills are not in this release.
- The simulated arm is built from boxes and cylinders on the arm's kinematic tree: a visual shell in the arm's
colours, and hidden capsules and boxes for collision. No vendor meshes or CAD files are shipped; the demo
script can draw the arm with your own copy (
scripts/record_demo.py --meshes). - The minimum clearance is checked against the table plane only. Objects on the table are not modelled yet.
- The simulation holds joints against gravity like stiff position servos. Real servos sag and lag more; the real-arm milestone adds measured margins.
Roadmap
- Real arm over USB serial and Wi-Fi, with every motion checked in MuJoCo first.
- Camera tools:
lookreturns a frame to a multimodal model,locatemaps a chosen pixel to table coordinates. - Pick and place skills.
- A reproducible benchmark that compares how well different models operate the arm.
Contributions are welcome; see CONTRIBUTING.md. Report security issues as described in SECURITY.md.
License
Apache-2.0. This project is not affiliated with Waveshare.
Metadata
Release files for roarm-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| roarm_mcp-0.1.1.tar.gz | 6.6 MB | With provenance | Details for roarm_mcp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roarm_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for roarm_mcp-0.1.1-py3-none-any.whl |
Total release size: 6.7 MB
Release files / roarm_mcp-0.1.1.tar.gz
| Download URL | roarm_mcp-0.1.1.tar.gz |
|---|---|
| Size | 6.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32f7c27c0ee4717b50c3761702beacc92e4bcf9bc1957cf2224d3998aabd4672
|
|
BLAKE2b-256 checksum How to use checksums |
0cb5afae97bbf261fd5f11ab890db032f9022580c4bbe61dfc5ff92b43c95e2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / roarm_mcp-0.1.1-py3-none-any.whl
| Download URL | roarm_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7dbe7c7e1a2703ce882d606507b61d4b350d6f64311f0bb1614172a9da8af2ba
|
|
BLAKE2b-256 checksum How to use checksums |
46dbd7b868626c8d6b121a15da226a69cacc07559e7f296e49e8294c48b7eaf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for roarm-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for roarm_mcp-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.