Skip to main content
Glama
roborock-mcp

roborock-mcp

README.md
# roborock-mcp-server

MCP server for Roborock robot vacuums. It speaks stdio, signs in with Roborock's email code (there is no public OAuth), and controls V1 vacuums through [python-roborock](https://github.com/Python-roborock/python-roborock) (Apache-2.0).

The high-level server is the official `mcp` Python SDK. That SDK renamed `FastMCP` to `MCPServer` in 2.x; this project uses `MCPServer`.

The distribution name is `roborock-mcp-server`. An unrelated package already publishes `roborock-mcp` on PyPI, so install this server from GitHub. The Python package directory stays `src/roborock_mcp`.

## Install

```bash
uvx --from git+https://github.com/siddhantsomani/roborock-mcp-server roborock-mcp-server
```

or:

```bash
pip install git+https://github.com/siddhantsomani/roborock-mcp-server
```

Both expose the `roborock-mcp-server` command. Installing from that git URL keeps `uvx` and `pip` off the unrelated `roborock-mcp` package.

From a checkout:

```bash
uvx --from . roborock-mcp-server
```

## Connect to Grok Bot or Cursor

This repo is a plugin. `.cursor-plugin/plugin.json` points at [`.mcp.json`](.mcp.json), which launches the server with `uvx --from git+https://github.com/siddhantsomani/roborock-mcp-server roborock-mcp-server`. [`mcp.json`](mcp.json) is the same config for hosts that look for that filename.

To add the server by hand:

```json
{
  "mcpServers": {
    "roborock": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/siddhantsomani/roborock-mcp-server",
        "roborock-mcp-server"
      ]
    }
  }
}
```

From a checkout, point `uvx` at the local project and turn on mock mode while you try it:

```json
{
  "mcpServers": {
    "roborock": {
      "command": "uvx",
      "args": ["--from", ".", "roborock-mcp-server"],
      "env": { "ROBOROCK_MOCK": "1" }
    }
  }
}
```

## Sign in

Roborock sends a 6-digit code to the account email.

1. `roborock_request_login_code` with that email.
2. `roborock_complete_login` with the email and the code.
3. `roborock_auth_status` to see whether a session is saved. `roborock_logout` deletes it.

The session is written to `~/.roborock-mcp/session.json`, or to `ROBOROCK_SESSION_PATH`, with file mode `0600`. The directory is mode `0700`. Tool results and logs do not include the session token or `local_key`.

When the account has one vacuum, omit `device_id`. When it has several, the tool lists them and asks for `device_id`.

## Tools

| Tool | What it does |
| --- | --- |
| `roborock_request_login_code` | Email a 6-digit code |
| `roborock_complete_login` | Save the session locally |
| `roborock_auth_status` | Report whether you are signed in |
| `roborock_logout` | Delete the session file |
| `list_devices` | Name, device id, model, online, protocol |
| `get_status` | Battery, state, error, fan, mop mode, current area and time |
| `get_rooms` | Room names and segment ids |
| `start_clean` | Full clean. Optional `fan_power` and `mop_mode` |
| `clean_rooms` | Rooms by name or segment id. `repeat` is 1–3 |
| `pause_clean` / `resume_clean` / `stop_clean` | Pause, resume, or stop |
| `return_to_dock` | Send the vacuum home |
| `find_me` | Play the locator sound |
| `empty_dustbin` / `wash_mop` | Dock actions. Unsupported models return an error |
| `get_consumables` | Filter, main brush, side brush, sensors |
| `get_clean_summary` | Totals and recent cleans |
| `set_fan_power` | quiet, balanced, turbo, max, or a numeric code |
| `set_mop_mode` | Water intensity (off/low/medium/high) or mop route (standard/deep/deep_plus/fast) |

States you will see: `charging`, `cleaning`, `paused`, `returning`, `docked`, `idle`, `error`. Only V1 protocol vacuums can be controlled. Other protocols are listed, and a control call explains that they are unsupported.

## Mock mode

Set `ROBOROCK_MOCK=1`. The server uses an in-memory Roborock Qrevo S named `Roborock Qrevo S` (`qrevo-s-001`, `roborock.vacuum.a104`) with rooms Kitchen (16), Living Room (17), Bedroom (18), and Hallway (19). Battery, consumables, and clean history move as you start, pause, resume, stop, dock, and clean rooms. No network calls are made.

Auth still uses the two login tools. The mock code is **`424242`**. Any well-formed email is accepted.

`ROBOROCK_MOCK_DEVICES=2` adds a Roborock S4 Max (`s4-max-002`) with no mop and no auto-empty dock, so multi-vacuum selection and unsupported dock features can be exercised.

## Marketplace reviewers

1. Launch with `ROBOROCK_MOCK=1` (and leave the network unused).
2. Call `roborock_request_login_code` with any email, for example `reviewer@example.com`.
3. Call `roborock_complete_login` with that email and code `424242`.
4. Call `list_devices`. You should see the simulated Qrevo S online, protocol `v1`.
5. Call `get_status`, `get_rooms`, `start_clean`, `pause_clean`, `resume_clean`, `clean_rooms` (try `Kitchen`), and `return_to_dock`.
6. Restart with `ROBOROCK_MOCK_DEVICES=2`. A call without `device_id` lists both vacuums. `empty_dustbin` on `s4-max-002` returns a not-supported error. The same call on `qrevo-s-001` runs while it is docked.

Local stdio from this repo:

```bash
ROBOROCK_MOCK=1 roborock-mcp-server
```

or `uvx --from . roborock-mcp-server` with `ROBOROCK_MOCK=1` in the MCP server `env`.

## Development

Requires Python 3.11+.

```bash
pip install -e ".[dev]"
ruff check .
ruff format --check .
pytest
```

CI runs those three checks on Python 3.11 and 3.12.

TDQS

A3.7/5.0

Scored across 20 tools

Disambiguation5/5

Each tool targets a distinct resource+action: auth lifecycle (request code, complete, status, logout), device info (list, status, rooms), cleaning control (start, clean_rooms, pause, resume, stop, dock, find), maintenance (empty, wash), and settings. The only mild overlap is start_clean vs clean_rooms and stop_clean vs return_to_dock, but these are clearly differentiated by description.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (get_status, set_fan_power, list_devices) with sensible list_ vs get_ usage for collections vs singletons. The main deviation is that the four auth tools carry a roborock_ prefix while all others are unprefixed.

Tool Count4/5

20 tools is on the heavier end but well-scoped for the domain: auth (4), device info (3), cleaning control (6), maintenance (3), settings (2), history (2). Each tool maps to a meaningful robot-vacuum operation with no obvious filler.

Completeness4/5

The surface covers the full operational lifecycle—login, device listing, status, room mapping, clean control, dock/mop/bin maintenance, consumables, and history. Minor gaps exist around scheduling/timers and map editing, but core workflows are fully covered.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues