Stillhand
by xiaokele1997
README.md
# Stillhand
A general-purpose desktop automation MCP server for clients that support MCP stdio.
[简体中文](README.zh-CN.md) · [API and concurrency](docs/API.md) · [Contributing](CONTRIBUTING.md)
Stillhand combines Cua Driver with fresh semantic targets, background mouse actions, background-preferred keyboard input, explicit outcome checks and per-request cancellation. `perform` keeps **observe → resolve → act → read back** together so independent workflows can share a desktop without invalidating each other's handles mid-step.
## Concurrency contract
| Workload | Execution |
| --- | --- |
| Distinct physical devices | Independent queues; executor calls can overlap |
| Different windows on one desktop | Concurrent requests; complete `perform` steps run sequentially |
| Shared window, modal dialog or multi-step app transaction | One workflow must own it; per-step scheduling is not application transaction isolation |
| Separate Stillhand processes controlling the same desktop | Not coordinated; run one controller per physical desktop |
This is an action server, not a persistent job scheduler. It does not create agents, pair devices, manage remote credentials or replay uncertain actions.
## Run from source
Requires Node.js 22+ and a separately installed, authorized [Cua Driver](https://cua.ai/docs/cua-driver/quickstart). The Windows scrolling adapter also uses the system .NET Framework 4 compiler; its first call compiles the included C# source into a temporary directory. No third-party runtime package is downloaded by Stillhand.
Extract the source archive and run in this directory:
```sh
npm test
npm run check
npm run smoke
node server.mjs
```
`smoke` only checks MCP startup and driver readiness; it does not send application input. `server.mjs` is an MCP stdio process, not an interactive shell. stdout contains only JSON-RPC. The npm package is prepared locally; it has not been published to a registry.
## Connect an MCP client
Keep the project in any directory you choose. Add the service to your client's MCP configuration and substitute the actual script path:
```json
{"mcpServers":{"stillhand":{"command":"node","args":["/absolute/path/to/stillhand/server.mjs"]}}}
```
Configuration locations and outer formats vary by client; follow the client's MCP configuration mechanism. The client starts the stdio service and discovers its tools. Application access remains subject to driver and host approvals. Operations that require forwarded approval requests need MCP elicitation support; unavailable approval forwarding must stop the operation rather than auto-approve it.
The optional `skills/stillhand/SKILL.md` describes tool use and operating boundaries. Load it through your client's skill mechanism if supported.
Windows defaults to the per-user Cua Driver install path; macOS/Linux use `cua-driver` on PATH. Override with `STILLHAND_DRIVER_PATH`. `STILLHAND_DEVICES_FILE` selects an operator-owned [device configuration](examples/devices.json). Devices are static stdio executors, not paired remote machines; each must represent a different physical desktop. The native Windows scroll helper is used only for the default local device, never for custom transports.
## Tools
| Tool | Purpose |
| --- | --- |
| `devices` | Check configured devices and driver readiness |
| `windows` | List application windows on the selected device |
| `observe` | Read controls and state from an exact window |
| `click` | Invoke a selected control in the background |
| `fill` | Replace and verify a selected field value |
| `scroll` | Scroll a selected surface in the background |
| `perform` | Observe, locate, act and read back in one queued step |
| `keyboard` | Send window-directed keys, shortcuts or text |
Use `devices → windows → observe` to discover exact targets. For concurrent tasks, send independent `perform` requests with an exact window and `{role, label}` selector taken from observed UI. A selector must resolve uniquely immediately before input. Indexed actions are also available; another observation on the device invalidates their handles.
`verified` confirms a specific postcondition. `effect_observed` only records a change. `executed_unverified`, `postcondition_unknown` and `postcondition_unsatisfied` are not task completion. After a timeout or cancellation following input, inspect state rather than replaying the action.
Explorer's UIItemsView needs its own HWND-targeted wheel route: its ordinary ScrollPattern can activate the window. The wheel route accepts `by: "line"`, measured in system wheel notches rather than exact rows. It refuses `page`. Other applications and controls need their own acceptance; background mouse actions never fall back to foreground input.
`keyboard` supports keys, shortcuts and explicit text semantics. `replace`/`append` targets one settable field without keyboard focus. `insert` sends at most 4096 characters to the window's current input field, without a selector; select the intended field with a separate keyboard operation first when needed. Focus-based keyboard delivery can interrupt human typing. See the [API contract](docs/API.md).
## Development and release
Source ZIP: `python tools/package.py` (Python 3 standard library only). npm archive: `npm pack`. Both stay local until a maintainer publishes them. CI runs protocol/scheduling tests on Windows, macOS and Linux; these checks do not imply native GUI acceptance on those systems.
MIT license for this project. [Third-party notices](THIRD_PARTY_NOTICES.md) explain the external driver boundary. This project is independent of OpenAI and Cua; it contains no private Sky SDK, reverse-engineered vendor code or driver binary.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues