niri-computer-use - let an MCP agent see and drive your niri desktop
niri-computer-use servestatusstopresumerecoverwatch
curl -fsSL https:// github.com/ ayagmar/ niri-computer-use/ releases/ latest/ download/ install.sh | sh
niri 26.04 on Linux only. Other ways to install · Safety
› In Files, put the two screenshots into a new folder called release-0.1, then bring me back here.
- 1.2
status3 ms - 1.2
desktop_state3 ms - 2.4
acquire_desktop2 ms - 3.6
focus {"window_id": 11, …}858 ms - 5.6
click {"x": 979, "y": 88, …}252 ms - 7.1
key {"keys": ["shift+Right", "ctrl+alt+n"], …}469 ms - 8.7
click {"x": 1061, "y": 88, "button": "right", …}957 ms - 10.9
click {"x": 1130, "y": 100, …}856 ms - 12.9
key {"keys": ["ctrl+a"], …}253 ms - 14.4
type_text {"text": "release-0.1", "submit": true, …}920 ms - 16.5
release_desktop {"restore_focus": true}3 ms
EXAMPLEClaude Code (Opus 5.5) puts two screenshots into a new folder in Files. Its eleven calls, with when each went out and its round trip, from the recording, which cuts thinking time.Watch the recording (19 s, MP4, 223 KB)
DESCRIPTION
An MCP server for Claude Code, Codex, Pi or any stdio client. The agent reads windows, workspaces and screenshots, and finds buttons by name. While it holds the lease, it clicks, types, drags and runs niri actions, and each action returns accepted, observed and changes.
SAFETY
- lease
- One agent at a time acts.
- stop key
- Cancels the action and takes the lease back.
- lock
- Nothing acts while the screen is locked.
- focus
- Typing checks focus, unless told not to.
- deny list
- No input while a denied app has focus.
- audit log
- Every call that reaches a tool, without typed text.
Not a sandbox: agents see your screen, and with the lease they can do anything you can. safety(7).
INSTALLATION
Pipe the install script into sh:
curl -fsSL https:// github.com/ ayagmar/ niri-computer-use/ releases/ latest/ download/ install.sh | sh
To read it first, open install.sh. Or build it, and use ~/.cargo/bin below:
cargo install --locked niri-computer-use
Bind the stop key in config.kdl:
Mod+Shift+Escape allow-inhibiting=false allow-when-locked=true {
spawn "/home/you/.local/bin/niri-computer-use" "stop";
}The script offers to register the server in each agent it supports that is on your PATH. The list, and the others: clients(7).
HISTORY
| 0.2.0 | 2026-11-26 | Added 1 · Changed 4 · Fixed 5 |
| 0.1.8 | 2026-11-04 | Added 3 · Changed 5 · Fixed 2 |
| 0.1.7 | 2026-10-30 | Added 2 · Changed 2 · Fixed 2 |
BUGS
With a niri release other than 26.04 it only looks. The pointer tools need a monitor at transform Normal.
SEE ALSO
niri(1), install(7), clients(7), safety(7), configuration(5), tools(7), cli(1), llms.txt, source