EV3 MCP Server
The EV3 MCP Server provides remote control and monitoring of a LEGO Mindstorms EV3 brick via Wi-Fi SSH, designed for AI/LLM integration. Key capabilities:
Drive: Move forward/backward with
move_forward/move_backward, turn left/right (turn_left/turn_right) using differential drive; tunable speed and duration.Stop: Immediate motor halt via
stop, with safety bypass overriding command locks.Sound: Play a beep on the EV3 speaker.
Device listing:
list_connected_devicesshows all attached motors/sensors with port, driver, and mode.Robot status:
robot_statusreports dry-run flag, SSH connection, motor port config, busy status, and last error.AI integration: Serves as backend for MCP-compatible AI clients (e.g., CLI chat, Cursor, Claude Desktop) enabling natural language control.
Configuration: Customizable motor ports, default/max speeds/durations, Python interpreter on the brick, and SSH authentication.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@EV3 MCP Server Move forward for 2 seconds and beep."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
EV3 MCP Server
Host-side FastMCP stdio server that any MCP client can use to drive a LEGO Mindstorms EV3 over Wi-Fi SSH. MCP stays on your Mac; only thin ev3dev2 code runs on the brick (MicroPython by default).
This repo also includes a CLI chat client that uses Hugging Face Inference Providers (OpenAI-compatible) by default, spawns the local EV3 MCP server, and lets you type natural language like move forward.
Architecture
CLI chat (ev3-chat / main.py) or Cursor / Claude Desktop
│ stdio MCP tools
▼
ev3_mcp on Mac ──persistent SSH──► EV3 brick (ev3dev2 motors)Related MCP server: mcp-ssh-tool
Requirements
Python 3.10+
uv (recommended)
EV3 running ev3dev with
ev3dev2(MicroPython preferred;python3-ev3dev2also works)SSH reachability from the host (password auth by default)
For the chat CLI: a Hugging Face token with Inference Providers permission (or any OpenAI-compatible endpoint)
Setup
cd /path/to/ev3dev_MCP
uv sync
cp .env.example .env # edit only when leaving dry-run / set LLM vars for chatDry-run is on by default (EV3_DRY_RUN=1): no SSH is opened at startup or on tool calls; tools log the would-be remote Python and return fake success shaped like real results. Flip to EV3_DRY_RUN=0 only after EV3_HOST is reachable and EV3_PASSWORD works.
When dry-run is off, the MCP server connects over SSH immediately on startup (eager connect) and logs success or failure. Tool calls still reconnect if the session drops.
Auth
Method | Env | Notes |
Password (primary) |
| Default path — set this in |
SSH key (optional fallback) |
| Used only when |
Never commit a real .env.
Motors / safety
Variable | Default | Purpose |
|
| Tank drive ports |
|
| Brick interpreter ( |
|
| Default and clamp for |
|
| Default and clamp for |
Drive tools use timed on_for_seconds runs (not infinite spin). Concurrent drive calls are rejected as busy; stop bypasses the lock and clears it.
Run the MCP server
# stdio MCP server (what clients spawn)
uv run python -m ev3_mcp.server
# or after uv sync / pip install -e .
python -m ev3_mcp.serverRun the CLI chat client
The client spawns ev3_mcp.server over stdio, calls a chat model via Hugging Face’s OpenAI-compatible router, and runs a prompt-toolkit chat loop.
# 1. Put HF_TOKEN in .env (https://huggingface.co/settings/tokens)
# 2. Pick a tool-capable OPENAI_MODEL, then:
uv run main.py
# or
uv run ev3-chat
# or
uv run python -m ev3_chatOptional extra MCP server scripts (same pattern as the reference cli_project):
uv run main.py /path/to/other_mcp_server.pyChat client env
Variable | Default | Purpose |
| (required) | Hugging Face token (Inference Providers). Also accepts |
|
| HF router; set to |
|
| Tool-capable model id ( |
|
| Spawn EV3 server with |
Tool calling: the EV3 tools only work if the model/provider supports OpenAI-style tools. Prefer instruct models known for function calling; you can append :fastest, :cheapest, or a provider like :groq / :together.
Smoke-test MCP only (no LLM required) — lists the 7 EV3 tools:
uv run mcp_client.py
# or
uv run python -c "from ev3_chat.mcp_client import main; import asyncio; asyncio.run(main())"Tools
Tool | Behavior |
| Both motors forward for |
| Same, reverse |
| Differential turn |
| Immediate stop — bypasses command lock |
| Speaker beep |
| Live motors/sensors on the brick (address, driver, mode) |
| Dry-run flag, SSH state, ports, busy, last error |
Client wiring
Cursor / Claude Desktop
Copy from mcp.json.example. Point command/args at this repo and set env (keep dry-run until the brick is ready):
{
"mcpServers": {
"ev3": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/ev3dev_MCP", "python", "-m", "ev3_mcp.server"],
"env": {
"EV3_DRY_RUN": "1",
"EV3_HOST": "192.168.1.100",
"EV3_USER": "robot",
"EV3_PASSWORD": "maker"
}
}
}
}Claude Desktop uses the same stdio shape in claude_desktop_config.json.
Constraint
The MCP process must run on a machine that can SSH to the EV3 (typically your Mac on the same Wi-Fi). Cloud-only agents that cannot spawn a local stdio server cannot drive the brick in v1.
Layout
Path | Role |
| FastMCP stdio server |
| CLI chat client ( |
| Thin entry → |
| Thin smoke-test entry (list tools, no LLM) |
Out of scope (v2)
Sensors, camera, on-brick MCP, persistent brick daemon, drive-command queuing, SSE/HTTP remote MCP.
Available Tools
8 toolsbeepA
Play a short confirmation beep on the EV3 speaker.
Inputs: no named parameters. Returns: object
list_connected_devicesA
List motors and sensors currently connected to the EV3 (port address, driver name; sensors also include mode).
Inputs: no named parameters. Returns: object
move_backwardA
Drive the EV3 tank motors backward for a timed duration at a given speed percent.
Inputs: speed_pct, duration_s. Returns: object
move_forwardA
Drive the EV3 tank motors forward for a timed duration at a given speed percent.
Inputs: speed_pct, duration_s. Returns: object
robot_statusA
Report dry-run flag, SSH connection state, motor ports, busy flag, and last error.
Inputs: no named parameters. Returns: object
stopA
Immediately stop both drive motors. Bypasses the command lock (safety fast path).
Inputs: no named parameters. Returns: object
turn_leftA
Differential turn left (left motor reverse, right forward) for a timed duration.
Inputs: speed_pct, duration_s. Returns: object
turn_rightA
Differential turn right (left motor forward, right reverse) for a timed duration.
Inputs: speed_pct, duration_s. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: movement commands (forward/backward/turn/stop) are mutually exclusive, and beep, list_connected_devices, and robot_status cover separate concerns. No overlapping functionality.
All tool names use lowercase snake_case and follow a consistent verb-first pattern (move_forward, turn_left, list_connected_devices). Minor variance like 'robot_status' is still in the same style, so the set feels predictable.
With 8 tools, the server is well-scoped for EV3 remote control and status monitoring. Each tool addresses a necessary operation without redundancy or bloat.
The core movement and status operations are covered, including safety stop and device enumeration. A minor gap is the lack of direct sensor reading (e.g., reading a sensor value), but the current surface handles common remote-control workflows.
Maintenance
Related MCP Connectors
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Minecraft bots via natural language commands by bridging a Python MCP server with a Node.js Mineflayer bridge. It supports a wide range of in-game actions including complex pathfinding, resource gathering, crafting, and combat.10MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) SSH client server that provides autonomous SSH operations for GitHub Copilot and VS Code. Enable natural language SSH automation without manual prompts or GUI interactions.202MIT
- AlicenseNot gradedqualityBmaintenanceA local MCP server that enables LLMs to execute shell commands on remote hosts over SSH with multiple authentication methods.35 npm3MIT
- FlicenseNot gradedqualityDmaintenanceEnables controlling a semi-autonomous Minecraft bot via MCP, supporting tasks like movement, combat, farming, and chatting.-