Skip to main content
The Rebind MCP server turns the Remote Control protocol into Model Context Protocol tools, so an AI agent can take a screenshot, decide what to do, click, type, and run Luau on the computer running Rebind. It is a client of the Remote Control server, so it needs that package installed and running. It runs with Bun 1.1 or later. When nothing answers on REBIND_URL as the server starts, because Rebind is not running or Remote Control is not installed or not started, the server offers one tool, install_remote_control, and tells the agent to ask you first. The agent shows you the permissions the package asks for, and installs it with rebind install @rebind/remote-control --allow only after you agree. It does not start Remote Control: finish the steps under Run the server, add the token to REBIND_TOKEN, then restart the MCP server in your agent. When REBIND_URL points at another computer, the agent gives you these steps to follow there instead.

Connect

add-mcp writes the configuration for the clients you name, in each one’s own format:
List the clients you use with -a, or pass --all. -g writes global configuration; leave it out for configuration in the current project. Restart the client afterward. Any MCP client that runs stdio servers also takes this block directly:
When the agent runs on another computer, or inside WSL on Windows, turn off Local only, restart Remote Control, and set REBIND_URL to the Rebind computer’s address.

Check the connection

--selftest connects to Remote Control, takes one screen capture, prints the display it captured, and exits. When it fails, it says whether Rebind was unreachable or the capture was refused.

What the agent can do

Some tools need Allow custom Luau or Allow observation turned on in Remote Control’s Options. The server runs the tools that touch the computer one at a time, since there is one cursor and one keyboard. When an agent asks for several at once, they run in order. At startup the server tells the agent this computer’s operating system and shortcut modifier, and to read rebind_docs first. Part 1 of those docs adds, with custom Luau on and a macOS or Linux Rebind computer, the shell tools and applications the server finds.

Delegation tools

With REBIND_ALLOW_DELEGATION=1, three more tools appear. They call models through OpenRouter, which spends credits on your OPENROUTER_API_KEY:
  • delegate_task hands a self-contained text task to one model call. It has no access to the computer.
  • rebind_versus runs several critics in parallel against a plan.
  • meditate reads a web page, and the pages and files it links to, until a model judges it has what it needs, then returns a dossier. With a macOS Rebind computer it also drives the browser and reads the page from a screenshot; elsewhere it fetches pages over HTTP only. It refuses local and private network addresses.

Settings

Custom Luau

run_lua, focus_window, position_window, and the meditate delegation tool use the protocol’s lua.exec command, which Remote Control keeps off until you turn on Allow custom Luau in its Options. While it is off, those tools return disabled, and the server skips its startup survey of the computer and does not offer read_page. The other tools work either way. The server reads the setting when it starts, so restart the agent after changing it.

Docs first

Before any other tool answers, the agent has to call rebind_docs for each part: how to work on this computer, the full CLI reference, and the full Luau SDK. Until every part has been served, the other tools answer with an error that names the parts still to read. Only observe_wait is exempt. Reading the parts costs about 30,000 tokens at the start of a session, and the server asks again after it restarts. It checks that each part was served, not that the agent still remembers it.

Observation

The observe_* tools let the agent watch you do a task before it writes a script for it. A recording holds every key you press, passwords included, and screenshots of your screen. On Rebind 3.23.0 and later it also holds what Rebind itself sends, so the agent can record its own actions, and the names of the controls in the front window; observe lists what else. The agent reads a recording as text first: observe_read returns the words and colors in a recorded screenshot without sending it a picture. It is saved in Rebind’s observations folder until you delete its folder there. The protocol covers the details. They need Allow observation on in Remote Control’s Options, which is off by default. While it is on, the agent can also read every recording in the folder, including ones you made in the app or with rebind observe. The server’s instructions tell the agent to ask once per session before it starts a recording, saying what it records and for how long. After you agree, it says each time a recording starts, and stops if you change your mind. A recording ends when its time is up, at its stop key, when you select Stop observation in Rebind’s tray menu, when the agent stops it, or when the agent disconnects. The server’s instructions have the agent wait for the end, so it learns within a few seconds that the recording ended and you do not need to tell it you are done. Do not type secrets while one runs. When Remote Control refuses, the tools say why: Allow observation is off, or the Remote Control package is older than 0.5.0.

Security

The MCP server can capture the screen and send keyboard and mouse input. With custom Luau on, run_lua can do anything the Remote Control script can, whatever the other Options say. Treat an agent with Rebind access as someone sitting at the computer. The warnings under Options apply.
  • Set a strong Auth token in Remote Control and pass it as REBIND_TOKEN. Without one, any program on this computer, including a web page open in your browser, can connect and control your keyboard, mouse, and screen.
  • Turn on only the Allow options the agent needs.
  • Prefer configuration in a trusted project over global configuration, which exposes the tools in every workspace.
  • Stop Remote Control when no agent needs it.

Save what worked

Ask the agent to save a working sequence as a Rebind script, which then runs without an agent. It keeps the script as a folder and runs it with rebind run. It builds a package only when you ask for one or say you are ready to share the script. A script run this way stops when its run ends; installing a package is how it stays loaded. See the CLI reference.

Write a script by watching

When you want a script that reacts to the screen or repeats something you do on screen, the agent records first and works the method out from the recording afterwards. A fixed key sequence or a remap needs no recording. Either you do the task once, or the agent drives the app itself. It starts a recording only after you have agreed in your own words. Then it writes the script, records your try and reads it, and repeats until you are happy with the script. Recording needs Allow observation. If you leave it off, the agent works from your description and says which steps it could not check. While it controls an app, the agent shows a status overlay that says so, and removes it when it hands back to you. This needs Allow custom Luau.