gnome-computer-use-mcp
README.md
# gnome-computer-use-mcp
An [MCP](https://modelcontextprotocol.io) server that lets an AI agent (Claude Code, or any MCP
client) **see and control your GNOME desktop**: screenshots, mouse, keyboard, scrolling and
text input, including Japanese and other non-ASCII text.
It talks to GNOME's compositor (Mutter) directly over its remote-desktop D-Bus API, the same
one GNOME Remote Desktop uses, so it needs:
- **no root**, no `/dev/uinput`, no `ydotoold`
- **no GNOME Shell extension**
- **no portal permission dialog**
- the same code path for **Wayland and X11** GNOME sessions
While a session is active, GNOME shows its screen-sharing indicator in the top bar, so you can
always see when the desktop is being driven.
> **Warning:** this gives the agent full control of your desktop session, with the
> same power as you at the keyboard. There is no per-app allow-list. Use it only with agents and
> prompts you trust, and watch what it does. Prompt injection from web pages or documents
> shown on screen is a real risk.
## Requirements
- GNOME on Wayland or X11. Tested on GNOME Shell 50.1 / Ubuntu 26.04.
- Python 3.10+ with PyGObject and GStreamer from your distribution:
```sh
# Debian / Ubuntu
sudo apt install python3-gi gir1.2-gstreamer-1.0 gstreamer1.0-pipewire \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good
```
## Install
```sh
pipx install --system-site-packages git+https://github.com/abyo-software/gnome-computer-use-mcp
# or use a checkout directly
git clone https://github.com/abyo-software/gnome-computer-use-mcp
```
`--system-site-packages` is needed so the server can import the distribution's PyGObject.
### Claude Code
```sh
claude mcp add --scope user gnome-computer-use -- gnome-computer-use-mcp
# from a checkout instead:
claude mcp add --scope user gnome-computer-use \
-e PYTHONPATH=/path/to/gnome-computer-use-mcp -- /usr/bin/python3 -m gnome_computer_use
```
Other MCP clients: run `gnome-computer-use-mcp` as a stdio server.
## Tools
All coordinates are in **screenshot pixels**. The server scales them to the real screen.
| tool | what it does |
|---|---|
| `screenshot` | PNG/JPEG of the primary monitor, downscaled to fit 1280x800 by default |
| `click` | move + click (`button`, `count` 1–3, held `modifiers`) |
| `mouse_move` | move the pointer |
| `drag` | press, move, release |
| `scroll` | wheel notches up/down/left/right, optionally at a point |
| `type` | type text (see below) |
| `key` | key combos such as `ctrl+l`, `alt+Tab`, `Return`, `super` |
| `wait` | sleep up to 30 s |
### Text input and input methods
`type` with `method: "auto"` (the default) sends short ASCII text as keystrokes. It **pastes
through the clipboard** when the text is long, contains non-ASCII characters, or an IBus
input method such as Mozc is active. Keystrokes would go through the IME and come out as kana.
Pasting replaces the clipboard. `restore_clipboard: true` puts the previous text back
afterwards. That restore is best effort, because Mutter has no atomic compare-and-swap. In
terminals, pass `paste_keys: "ctrl+shift+v"`.
## Configuration
| env var | default | meaning |
|---|---|---|
| `GCU_MAX_WIDTH` | 1280 | max screenshot width |
| `GCU_MAX_HEIGHT` | 800 | max screenshot height |
## Limitations
- **GNOME only.** It uses Mutter's *private* D-Bus API (`org.gnome.Mutter.RemoteDesktop` /
`ScreenCast`), which has no stability guarantee across GNOME releases. KDE, wlroots and
others are not supported (yet). A portal-based backend would cover them, at the cost of a
permission dialog.
- **Primary monitor only.** Multi-monitor selection is not implemented.
- HiDPI / fractional scaling uses the negotiated PipeWire frame size. It is covered by design
and review but has only been tested on a 1× display.
- No accessibility-tree access: the agent works from pixels.
- Tool calls run one at a time on the stdio thread. `notifications/cancelled` and `ping` are
only processed between calls, so a long `type` or `wait` cannot be cancelled mid-way.
- If gnome-shell restarts, or the monitor layout changes, the session is rebuilt on the next
failing call or screenshot rather than immediately.
- Any process running as your user can already call this D-Bus API. This server adds no new
privilege, but it does hand that power to an AI agent.
## Development
```sh
python3 -m unittest discover -s tests -t . # unit tests (no desktop needed)
GCU_LIVE=1 python3 -m unittest tests.test_live_gnome # live: screenshots + pointer move only
python3 scripts/drive_demo.py 'key:{"keys":"ctrl+a"}' # manual demo, drives the real desktop
```
## License
Apache-2.0 © abyo software LLC
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues