Skip to main content
The Rebind MCP server wraps the remote-control protocol as Model Context Protocol tools, so an AI agent can drive a keyboard and mouse: take a screenshot, reason about it, click, type, and run Luau. With a Rebind Link the output arrives as physical USB HID reports; in software mode it goes through the OS input APIs. It runs against the same remote.luau server as everything else in this section. The MCP server is just another client, built for agents instead of programs. run_lua is sent as the protocol’s lua.exec command, which both reference servers gate off by default. Set ALLOW_LUA_EXEC = true at the top of the script, or run_lua, focus_window, position_window, read_page, and the startup capability probe all come back disabled. Screenshot, zoom, click, type, key, scroll, and the enumeration tools are ungated and work either way.

Install

--selftest connects to the running Rebind relay and captures the screen, then exits. Run it first to confirm the server is reachable before wiring up an agent. It needs remote.luau running (see Run the server).

Configure every client

add-mcp writes the correct config for whichever clients you name (Claude Code, Cursor, Codex, OpenCode, VS Code, Windsurf, Zed, and more) in each one’s native format:
Drop -a <agent> for the clients you want, or pass --all. -g installs globally; omit it to write project-local config. Restart the client afterward so it picks up the new server.

Any MCP client

The server speaks MCP over stdio. Point any MCP-capable client (Claude Desktop, an IDE, your own agent) at it manually:
Set REBIND_TOKEN when the relay has an auth token (the Auth token field in remote.luau’s settings panel).

Security

The MCP server can capture screens and send keyboard and mouse input. Enabling run_lua permits arbitrary Luau under the Remote script’s SDK permissions and file sandbox. The other ALLOW_* command gates do not constrain code executed through run_lua. Treat an MCP client with Rebind access as a local operator.
  • Set a strong Auth token in remote.luau and pass it as REBIND_TOKEN. The WebSocket server binds every network interface, including on a LAN.
  • Keep ALLOW_EXEC, ALLOW_FILE, ALLOW_REGISTRY, and ALLOW_LUA_EXEC off unless the client needs them. Each expands what a connected client can do.
  • Use project-local MCP configuration for repositories you trust. A global configuration exposes the tools in every client workspace.
  • Stop the Remote script when agent control is not in use. Use the host firewall to block port 19561 from networks that do not need access.

OpenClaw

The @usinput/rebind-computer-use skill on ClawHub teaches an OpenClaw agent when and how to use these tools, with a built-in safety policy for irreversible actions.
Then start a new OpenClaw session: skills are snapshotted at session start, so one installed mid-session stays invisible until you restart.

Tools

The skill’s policy leans on run_lua for deterministic sequences and reserves screenshots for genuine visual reasoning. A screenshot-per-action loop costs tokens quadratically, since every image is re-sent on every later turn. Three more tools stay unregistered unless REBIND_ALLOW_DELEGATION=1 is set, because they call OpenRouter and spend credits: delegate_task (hand a bounded text task to a subagent), rebind_versus (N parallel critics attack a plan), and meditate (research a page until a model has enough to solve it). They need OPENROUTER_API_KEY. Pick the model with REBIND_MODEL, and REBIND_VISION_MODEL for meditate’s vision pass.

Telemetry

Set REBIND_AGENT_LOG=<path> to append one JSONL line per tool call ({ts, tool, ok, latency_ms, note}). No screenshot bytes, no user content. Off unless set. Useful for measuring which tools fail and how many actions a task takes.