open_hands
# open_hands
[](https://github.com/SychPL/open_hands/actions/workflows/ci.yml)
[](https://github.com/SychPL/open_hands/releases/latest)
[](#licence)
[](https://glama.ai/mcp/servers/SychPL/open_hands)
An MCP server that gives an AI agent a real USB HID mouse and keyboard, built from an ESP32-S3 board. Windows sees an ordinary input device, not injected input. The host (Rust) keeps tasks exclusive, checks where the cursor really landed, and stops an action when you take over.

**Try it:** flash the firmware from your browser at **[sychpl.github.io/open_hands](https://sychpl.github.io/open_hands/)**, then run `.\oh.exe install` from the [latest release](https://github.com/SychPL/open_hands/releases/latest).
**Read more:** how it works in [ARCHITECTURE.md](ARCHITECTURE.md), the full specification in [SPEC.md](SPEC.md), the plans in [ROADMAP.md](ROADMAP.md). Want to help? Start with the [good first issues](https://github.com/SychPL/open_hands/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and [CONTRIBUTING.md](CONTRIBUTING.md).
Windows 10/11 x64 (tested on Windows 11), with the board plugged into the same PC the agent runs on. On Linux the host builds and lists its tools, but refuses every call for now; the X11 host is in progress ([ROADMAP](ROADMAP.md) M13).
## Hardware
ESP32-S3-DevKitC-1 (or another S3 board with native USB, e.g. ESP32-S3-Zero). Connect the native **USB** port to the computer, not `UART`.
- **Emergency stop:** a short press of `BOOT` stops the action, releases everything and disarms the device. To arm it again, hold `BOOT` for 2 s. The agent cannot do this for you.
- The hardware cut-off is pulling the USB cable.
- Status LED (firmware 0.4.0+): green = armed with a host connected, yellow = armed, no host, red = disarmed, red blinking = fault (a release failed; hold `BOOT` 2 s), blue flash = an action, purple flash = the watchdog or max hold released everything, blinking white = a firmware update waits for you (press `BOOT` twice quickly to install it, once to cancel). The release firmware drives the LED pins of ESP32-S3-DevKitC-1 v1.0 and v1.1 and ESP32-S3-Zero; for another board set `OPEN_HANDS_LED_GPIOS` in Kconfig.
## Installation
1. **Firmware.** In the browser at [sychpl.github.io/open_hands](https://sychpl.github.io/open_hands/) (Chrome or Edge), or from the release bundle with `esptool` using the line in `firmware\flash.txt`. When open_hands already runs on the board, enter download mode: hold `BOOT`, press `RESET`, release `BOOT`, and use the port that appears (303A:1001). From source: `firmware\build.ps1 [-Port COMx -Flash]`.
**Updates** (firmware 0.4.0 and newer): `oh update-firmware` sends the firmware of its own release to the board over the same USB cable (about 7 s; leave `BOOT` alone meanwhile). When the LED blinks white, press `BOOT` twice quickly, like a double click, to install it (once cancels; if it reports the presses as too slow, it says how far apart they were). The board restarts into it, the host checks it and commits it; if the new firmware does not work, pressing `RESET` returns to the previous one. Boards with older firmware need one more flash in download mode or from the browser.
2. **Host and MCP clients.** `oh install` copies the program to `%LOCALAPPDATA%\open_hands\bin\` and registers it as the `open_hands` server in the clients it finds: Claude Code (user scope, through `claude mcp`), Claude Desktop, Cursor and Codex CLI. `--dry-run` shows what would change; restart the clients afterwards. `oh uninstall` removes only the entries that point at that file. `oh ports` shows the board's port and `oh status` the device state.
3. **By hand**, if you prefer not to use the installer. Claude Code: `claude mcp add -s user open_hands -- "%LOCALAPPDATA%\open_hands\bin\oh.exe" mcp`. Claude Desktop (`claude_desktop_config.json`):
```json
{ "mcpServers": { "open_hands": { "command": "C:\\Users\\<you>\\AppData\\Local\\open_hands\\bin\\oh.exe", "args": ["mcp"] } } }
```
Several MCP hosts at once work: the first process becomes the leader and holds the COM port, the others connect to it over a named pipe. When the leader exits, another process takes over the device.
## Tools
| Tool | What it does |
|---|---|
| `esp_status` | device, calibration, lease, monitors, cursor, configuration |
| `esp_control` | `begin` / `end` / `status` of the lease; every input tool needs a `control_id` |
| `esp_move`, `esp_click`, `esp_drag`, `esp_scroll` | movement with cursor verification; a click or drag does not happen when the cursor misses |
| `esp_button` | hold / release a button (released after 30 s) |
| `esp_keys` | a shortcut or a sequence of shortcuts (`ctrl+s`, `["ctrl+a", "delete"]`) |
| `esp_type` | text through the keyboard layout of the foreground window, checked before typing |
| `esp_paste` | text through the clipboard: any Unicode (emoji, CJK), long text in a fraction of a second; only with `paste_enabled = true` |
| `esp_media` | mute, volume up, volume down, play/pause, next, previous, stop |
| `esp_screenshot` | a screenshot of a monitor or a region; its `screenshot_id` lets you click image pixels (`coords: "screenshot"`) |
| `esp_input_status` | cursor, foreground window, keys held, Caps Lock, layout |
| `esp_calibrate` | force a measurement of the mouse-to-screen mapping |
| `esp_release_all` | release everything at once; always allowed |
The host refuses actions on the lock screen and in a UAC prompt (`secure_desktop`), over an administrator window (`elevated_foreground`) and while you hold a key (`user_input_active`). Moving your mouse or keyboard during an action stops it (`user_interrupt`).
## Configuration
`%APPDATA%\open_hands\config.toml` (all keys optional, defaults shown):
```toml
port = "auto" # or "COM7"
watchdog_ms = 1500
lease_idle_s = 300
allow_secure_desktop = false # do NOT turn on without a reason, see below
allow_elevated_foreground = false
redact_text = true # the audit log keeps only the length and SHA-256 of text
type_per_key_ms = 12 # 30+ for RDP, virtual machines and Electron apps
tolerance_px = 1
screenshot_max_width = 1568
paste_enabled = false # esp_paste: overwrites your clipboard, see below
```
`esp_paste` puts the text on the clipboard and presses Ctrl+V. The text stays on the clipboard (the previous content does not come back), but it does not go into clipboard history (Win+V) or cloud sync. Before Ctrl+V the host checks that the clipboard still holds its text; when another program has replaced it, nothing is pasted (`clipboard_changed`).
Every key can be overridden with an `OPEN_HANDS_<KEY>` variable (e.g. `OPEN_HANDS_PORT=COM7`). A bad file is ignored as a whole (the defaults apply) and `esp_status` shows `config_error`.
Data in `%LOCALAPPDATA%\open_hands\`: `calibration.json`, `audit.jsonl` (+ `.1`, `.2`; after 10 MB), `leader.lock`, `leader.json`.
## CLI
```
oh mcp MCP server (stdio)
oh ports COM ports, the board marked
oh status state (through the leader or as a temporary leader)
oh release [--force] release everything; --force also ends another client's lease
oh calibrate measure the mapping (moves the cursor)
oh selftest [--long|--boot] firmware test; only when no MCP server holds the board
oh update-firmware [path] update the board over USB (firmware 0.4.0+); BOOT twice to confirm
oh install [--dry-run] install to %LOCALAPPDATA%\open_hands\bin and register in MCP clients
oh uninstall [--dry-run] remove the open_hands entries from the clients (the file stays)
```
## Risks you need to know about
- A plugged-in open_hands gives every program of your account input that Windows treats as physical, also on the secure desktop. A program with access to the COM port can therefore click "Yes" in a UAC prompt in consent mode. The `secure_desktop` guard only protects against an agent that uses open_hands. On an administrator account, set UAC to "prompt for credentials" or unplug the device when you are not using it.
- A HID keyboard plugged into someone else's computer is BadUSB by definition.
- A receipt confirms where the cursor was and what the device sent, not the effect on screen. The agent should check the screen (`esp_screenshot`).
- open_hands gives the agent whatever the desktop gives you, apart from what its guards refuse. Permissions of other tools do not limit it: an agent with open_hands can see and click another program's approval prompt (a toast, a confirmation dialog). Until such windows are guarded ([ROADMAP](ROADMAP.md) M10), do not give open_hands to an agent that reads untrusted content while another tool waits for your approval.
## Limitations
- `esp_type` types only characters of the current keyboard layout. No IME (CJK) and no characters composed with dead keys (e.g. `ê`). The character of a dead key alone (`~` on Polish programmer's) works. `esp_paste` pastes the rest.
- Absolute positioning only: a point outside the range of absolute reports gives `out_of_bounds`.
## Development
- `pwsh tools/ci.ps1` runs what CI runs on Windows (clippy, host tests, C++ protocol tests). The dispatcher tests run on the firmware simulator, without the board, but read the real desktop: do not hold a mouse button while they run.
- Hardware tests (they click and type only into their own window, `tools/hil_target.py`; do not touch the mouse meanwhile): `python tools/hil_m3.py [--long]`, `python tools/hil_m4.py`, `python tools/hil_m5.py` (presses "mute" an even number of times; saves and restores the clipboard), `python tools/leader_e2e.py`, `python tools/mcp_e2e.py`, `oh selftest`.
- Needing a person: `python tools/hil_guards.py`, `python tools/hil_uac_probe.py`, `oh selftest --boot`.
- Release: `firmware\build.ps1`, then `tools\release.ps1` → `dist\`.
## Licence
Dual-licensed under [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE), at your option. Security reports: [SECURITY.md](SECURITY.md).
open_hands is an independent project. It is meant to join open_tools, a shared gateway for local MCP servers with one installer and one tray icon ([ROADMAP](ROADMAP.md)). It is not affiliated with or endorsed by Espressif, Microsoft or Anthropic. The USB VID/PID (303A:4E54) is from Espressif's range for prototypes; a release for other people's devices needs its own PID.
TDQS
Scored across 15 tools
Most tools have clearly distinct actions (move vs click vs drag vs scroll, type vs paste vs keys) and descriptions explicitly differentiate them. The main overlap is esp_status vs esp_input_status, both lease-free state readers, and esp_release_all vs esp_button(up), though each description carves out its scope.
All 15 tools share the esp_ snake_case prefix, which is highly predictable. The only blemish is mixing verbs (esp_move, esp_click, esp_type) with nouns (esp_media, esp_button, esp_keys, esp_status), readable but not a single uniform pattern.
15 tools is at the top of the ideal range but each maps to a real hardware input primitive: pointer actions, keyboard entry, media keys, lease management, safety release, and state inspection. Nothing feels redundant or filler.
Covers the full input lifecycle: calibration, lease acquire, move/click/drag/scroll/button-hold, keys/type/paste, media, screenshots, and emergency release plus status. Minor gaps only, e.g. no explicit double-click, focus-window tool, or wait/delay primitive, but these are workable via click combinations and repeated calls.