The agent-desktop Linux build lets an AI agent work a real Ubuntu desktop the way a screen reader does. It reads GNOME apps through the accessibility tree, returns JSON with a ref for every button and text field, and clicks or types on those refs when you ask. There is no model inside agent-desktop, so the thinking comes from the agent you plug in, and here that’s Claude Code talking to it over MCP.
The project’s quick start uses macOS Finder, so this guide stays on Ubuntu. You’ll install the CLI, read agent-desktop status, drive GNOME Text Editor, Files and Settings by ref, add the MCP server to Claude Code, and meet the Wayland refusals on Ubuntu 26.04. The lab ran on two Google Cloud VMs: Ubuntu 24.04 on the Xorg session, and Ubuntu 26.04, which no longer ships one. I went through the install, the MCP setup and the agent runs on both in November 2026 with agent-desktop 1.2.0, and they hold.
See how agent-desktop works on a Linux desktop
agent-desktop is a Rust CLI from Vercel Labs that turns the desktop into something an agent can read and act on without screenshots. On Linux it talks to AT-SPI, the same accessibility bus Orca uses, so it only sees apps whose toolkit registered there. GTK3 and GTK4 apps register on their own, which is why the GNOME apps used below need no setup at all. Qt apps need QT_ACCESSIBILITY=1, and Chromium needs --force-renderer-accessibility, according to the Linux platform page. If the task never leaves a web page, the sibling agent-browser CLI drives Chrome directly, as our agent-browser install and Playwright MCP benchmark guide shows, and that guide points to our separate Lightpanda install and benchmark guide for that engine.
The loop you’ll repeat all through this guide has three moves, and the agent repeats them too:
- You take a snapshot of an app and get refs such as
@s24jv0nm3hsg1w:e2, each tied to that one snapshot. - You act on a ref with
click,type,toggleor one of the other ref commands. - You read the UI again to confirm the change, because a ref from an old snapshot is rejected once the UI moves on.
By default the actions are semantic: agent-desktop calls the element’s own AT-SPI action instead of moving the pointer, so it works without stealing your mouse. Pointer input and window activation are opt-in with --headed. Key presses are the exception: press always injects a real key event, through XTEST on X11 or Mutter RemoteDesktop on Wayland, and that physical side is exactly where the two sessions disagree.
Check what your Ubuntu desktop needs
agent-desktop supports Ubuntu 24.04 or later on x86_64 and aarch64, and it has to run inside the signed-in user’s graphical session. That second part is the one that trips people up, because an SSH shell on the same machine looks healthy but cannot see a single window. Before installing, tick these off:
- You’re on Ubuntu 24.04 or 26.04 with GNOME, logged in to a desktop session (a local seat, a VM console or a remote desktop all count).
- You have
at-spi2-coreinstalled, which every Ubuntu desktop install already includes. - You have Node.js 18 or newer for the npm install; Ubuntu 24.04’s own
nodejspackage is new enough. - You’ve installed
wl-clipboardif you’re on Wayland and want clipboard commands. - You’re not on Ubuntu 22.04, whose AT-SPI bridge aborts on
Action.GetActionsaccording to the project’s install notes.
Ubuntu 22.04 wasn’t part of this lab, so that last item comes from the upstream docs, not from a crash you’ll see below. If you’re still on 22.04, upgrading to the current LTS is the supported path. macOS 13 or later and Windows 10 1809 or later are supported too, through the AX API and UI Automation, but neither was tested here. If you’re shopping for a Mac to run agents around the clock, the Mac mini picks for AI agents cover the hardware side.
Install the two helper packages the examples use: jq to pull refs out of the JSON, and wl-clipboard for the Wayland clipboard. Node.js and npm come from the Ubuntu archive here, which is fine for a global CLI:
sudo apt update
sudo apt install -y nodejs npm jq wl-clipboard at-spi2-core
The 24.04 VM pulled Node.js 18.19 and the 26.04 VM pulled Node.js 22, and both ran the npm install below without complaint. That matters on 24.04 because the npm package asks for Node 18 or later, so the archive version clears the bar with no extra repository. If you already manage Node with another tool, any 18+ release does the same job. An agent that only needs a browser can skip the desktop session altogether: our Chrome DevTools MCP headless setup on Linux runs Chrome with no X server.
Install agent-desktop on Ubuntu
Prebuilt native binaries for Linux, macOS and Windows on x64 and ARM64 come inside the npm package, so nothing compiles on your machine. Install it globally so the agent-desktop command lands on your PATH:
sudo npm install -g agent-desktop
For a reproducible setup, pin the release you tested instead and check the releases page before you bump it:
sudo npm install -g [email protected] #https://github.com/vercel-labs/agent-desktop/releases
Confirm the binary answers. Every command prints one JSON envelope, and version is the quickest way to see one:
agent-desktop version
You should see "os":"linux" and your architecture, with the version you installed.
{"version":"2.6","ok":true,"command":"version","data":{"os":"linux","target":"x86_64","version":"1.2.0"}}
The npm install drops the native binary into the package’s bin directory together with agent-desktop-linux-clipboard-owner, the helper that X11 needs for clipboard-set. The project also publishes a Homebrew formula and GitHub release archives, which I didn’t test; with an archive, keep that helper in the same directory as the CLI, because agent-desktop looks for it beside itself.
Run agent-desktop status inside the session
Open a terminal on the desktop itself (GNOME Terminal, not an SSH window) and check what kind of session you’re in. On the 24.04 VM, the Xorg session reports x11:
echo $XDG_SESSION_TYPE
Now ask agent-desktop whether the accessibility bus answers. On Linux there’s no permission dialog, so this one command is the whole permissions check:
agent-desktop status
A healthy session shows accessibility as granted and a non-empty supported_surfaces list.
{"version":"2.6","ok":true,"command":"status","data":{"permissions":{"accessibility":{"state":"granted"},"automation":{"state":"not_required"},"screen_recording":{"state":"not_required"}},"platform":"linux","ref_count":null,"session_id":null,"snapshot_id":null,"state_root":"/home/lorna/.agent-desktop","supported_surfaces":["window","sheet","alert","menu","system-tray"],"tracing":false,"version":"1.2.0"}}
The same check fits in one window once you filter it through jq, which leaves only the two fields that matter:
agent-desktop status | jq '.data | {accessibility: .permissions.accessibility.state, supported_surfaces}'
This is how it looked on the 24.04 VM, next to the install and version checks:

Don’t trust status alone when you’re connected over SSH, though. On the lab VM, an SSH shell for the same user still found the user’s D-Bus session bus, so status said granted and listed every surface. The display was the missing piece, and only list-apps exposed it:
{"version":"2.6","ok":false,"command":"list-apps","error":{"code":"PLATFORM_NOT_SUPPORTED","message":"No display server is configured in this session","suggestion":"Run inside a desktop session with DISPLAY or WAYLAND_DISPLAY set","details":{"detail":"","display_unavailable":"not_configured","retryable":false},"disposition":{"delivery":"not_delivered","retry":"safe"}}}
The empty supported_surfaces case the docs warn about shows up when you run it as root with sudo agent-desktop status, because root has no session bus at all. You can see both failures in this capture. So never run agent-desktop with sudo, and treat list-apps as your real health check, because it’s the first command that needs a display.

If you do need to work over SSH (a headless VM, or a second machine running the agent), import the desktop session’s variables from the systemd user manager first. GNOME publishes them there when it starts, and this one line was how every SSH command in the lab reached the desktop:
export $(systemctl --user show-environment | grep -E '^(DISPLAY|XAUTHORITY|WAYLAND_DISPLAY|XDG_SESSION_TYPE|XDG_CURRENT_DESKTOP)=' | xargs)
Keep XDG_CURRENT_DESKTOP in that list, because GNOME Settings checks it before it opens a window. My first agent run left it out, so Settings exited with status 1 until the agent worked out the cause on its own. You’ll see that detour in the Claude Code section.
Snapshot an app and act on its refs
Start with something harmless. launch takes a desktop ID, a command or a desktop entry name, and returns the window it opened, so you know straight away that the app registered on the bus:
agent-desktop launch org.gnome.TextEditor
The window block carries the title, size and an opaque window ID. Keep that ID handy, because you’ll pass it to --window-id when several windows share one app.
{"version":"2.6","ok":true,"command":"launch","data":{"app":"gnome-text-editor","pid":14865,"process_instance":"3ab92b96:36530","window":{"accessible":true,"app_name":"gnome-text-editor","bounds":{"height":520.0,"width":700.0,"x":292.0,"y":34.0},"id":"w-1.17-org-gnome-TextEditor-a11y-89ab6829_5ea4_473f_b001_d01e907d1c2d","is_focused":true,"minimized":false,"pid":14865,"process_instance":"3ab92b96:36530","title":"New Document (Draft) - Text Editor","visible":true}}}
Now snapshot it. -i keeps only interactive elements, and --compact collapses single-child wrappers. GTK still nests its widgets about fifteen levels deep in unnamed group nodes, so the pretty-printed JSON runs 271 lines for ten refs. Save it to a file and let jq flatten it into one line per ref:
agent-desktop snapshot --app gnome-text-editor -i --compact > snap.json
jq -r '[.. | objects | select(.ref_id)] | .[] | "\(.ref_id) \(.role) \(.name // "")"' snap.json
Each line is a ref you can act on. The part before the colon is the snapshot ID, which is why a bare @e2 is rejected with INVALID_ARGS:
@s24jv0nm3hsg1w:e1 scrollarea
@s24jv0nm3hsg1w:e2 textfield
@s24jv0nm3hsg1w:e3 menubutton Open
@s24jv0nm3hsg1w:e4 switch Open
@s24jv0nm3hsg1w:e5 button New tab
@s24jv0nm3hsg1w:e6 menubutton View
@s24jv0nm3hsg1w:e7 switch View
@s24jv0nm3hsg1w:e8 menubutton Main menu
@s24jv0nm3hsg1w:e9 switch Main menu
@s24jv0nm3hsg1w:e10 button Close
Type into the text field (e2), then read it back. Your refs will carry a different snapshot ID, so copy them from your own output:
agent-desktop type @s24jv0nm3hsg1w:e2 'Notes from agent-desktop on Ubuntu 24.04'
agent-desktop get @s24jv0nm3hsg1w:e2 --property text
Look for "delivery":"delivered_verified" and the EditableText.InsertText step, which mean the text went in through the accessibility API and agent-desktop read the new value back. The get call returns the same string:
{"version":"2.6","ok":true,"command":"type","data":{"action":"type","details":{"application_commit":"not_verified","auto_wait":{"lease_contention_count":0,"lease_hold_ms":279,"read_only_preflight_attempts":1,"read_only_resolve_attempts":1},"verification_scope":"element_value"},"disposition":{"delivery":"delivered_verified","retry":"unsafe"},"post_state":{"enabled":true,"offscreen":false,"role":"textfield","states":["focused","haspopup"],"value":"Notes from agent-desktop on Ubuntu 24.04"},"steps":[{"label":"EditableText.InsertText","mechanism":"semantic_api","outcome":"succeeded","verified":true}]}}
{"version":"2.6","ok":true,"command":"get","data":{"property":"text","ref":"@s24jv0nm3hsg1w:e2","value":"Notes from agent-desktop on Ubuntu 24.04"}}
The whole loop, from snapshot to verified read, fits in one terminal:

Clicking teaches you the most useful habit in this whole guide. When you click e8, the menubutton named “Main menu”, agent-desktop refuses with POLICY_DENIED and “direct semantic delivery is unavailable and physical fallback is denied”. The menubutton only advertises Expand and Collapse; its child, the switch with the same name, is the element that carries Click. So check available_actions in the snapshot before you pick a ref:
agent-desktop click @s24jv0nm3hsg1w:e9
agent-desktop wait --menu --app gnome-text-editor
The click goes through Action.DoAction, and the surfaces list in its reply already shows a new menu surface with 11 items. The wait call confirmed it 222 ms later. A snapshot of that menu with --surface menu listed 17 refs, from the style toggles down to “About Text Editor”, and the screen looked like this at that point:

Close it with a key press. On X11 this goes through XTEST, and the reply names that mechanism so you can tell a real key event from a semantic action:
agent-desktop press escape --app gnome-text-editor
Your step label should read XTEST.press_key with "mechanism":"physical_synthetic".
{"version":"2.6","ok":true,"command":"press","data":{"action":"press","disposition":{"delivery":"delivered_unverified","retry":"unsafe"},"steps":[{"label":"XTEST.press_key","mechanism":"physical_synthetic","outcome":"succeeded","verified":false}]}}
Files is where the semantic route runs out, and it’s worth seeing why. On a fresh 24.04 desktop, a snapshot of Nautilus on the home folder returned 46 refs. Each folder shows up as a pair of cell refs that only offer SetFocus, so you can’t click a folder open, and the sidebar is a listbox whose entries advertise Select rather than Click. The header buttons are the exception, so start a search with the “Search Current Folder” switch. I’d saved a file called agent-notes.txt under ~/Documents first, so the search has something to find:
agent-desktop launch org.gnome.Nautilus
agent-desktop snapshot --app nautilus -i --compact > files.json
agent-desktop click @srbyx0vg1dfud:e27
The click goes through as Action.DoAction and a search field appears. That field is the catch: a plain type on it came back POLICY_DENIED, and set-value returned ACTION_NOT_SUPPORTED with the suggestion “This field has no semantic text-write action. Use ‘–headed type’ for physical keyboard input”. On the Xorg session that’s allowed, so take a fresh snapshot, pull the textfield ref out of it (it was e27 in mine), type with --headed, and then look for the result:
agent-desktop snapshot --app nautilus -i --compact --max-depth 30 > search.json
jq -r '[.. | objects | select(.role=="textfield")][0].ref_id' search.json
agent-desktop type @s3042jelbnpvkj:e27 'agent-notes' --headed
agent-desktop find --app nautilus --role cell --text agent-notes
The type step reports XTEST.type_text as delivered_unverified, because agent-desktop can’t read that field back. The find call is the real check, and it found the file in a window now titled “Search for “agent-notes””:
{"version":"2.6","ok":true,"command":"type","data":{"action":"type","details":{"application_commit":"not_verified","auto_wait":{"lease_contention_count":0,"lease_hold_ms":1074,"read_only_preflight_attempts":1,"read_only_resolve_attempts":1},"verification_reason":"insufficient_evidence","verification_scope":"unavailable"},"disposition":{"delivery":"delivered_unverified","retry":"unsafe"},"post_state":{"enabled":true,"offscreen":false,"role":"textfield"},"steps":[{"label":"XTEST.type_text","mechanism":"physical_synthetic","outcome":"succeeded","verified":false}]}}
{"version":"2.6","ok":true,"command":"find","data":{"matches":[{"interactive":true,"name":"agent-notes.txt","path":["window:Search for “agent-notes”","group","group","group","group","group","group","group","group","group:Search for “agent-notes”","group","group","group","group","group","group","group","group","group","scrollarea","table"],"ref_id":"@sbihw9ueihc2s:e1","role":"cell","states":["selected"],"value":null},{"interactive":true,"name":"agent-notes.txt","path":["window:Search for “agent-notes”","group","group","group","group","group","group","group","group","group:Search for “agent-notes”","group","group","group","group","group","group","group","group","group","scrollarea","table","cell:agent-notes.txt"],"ref_id":"@sbihw9ueihc2s:e2","role":"cell","states":[],"value":null}],"snapshot_id":"sbihw9ueihc2s","total_matches":2,"truncated":false}}
Files showed the same result on screen, with the search text in the header and the file selected:

Keep that --headed fallback in mind for Wayland: it’s a physical keyboard path, so on 26.04 it depends on Mutter RemoteDesktop rather than XTEST. That pattern (rows you select, fields you can’t write to semantically) is exactly where the agent struggled in GNOME Settings, as the next sections show.
Connect agent-desktop to Claude Code over MCP
Since 1.2.0, agent-desktop mcp serves every command as an MCP tool over stdio, so Claude Code can call desktop_snapshot and desktop_click directly instead of shelling out. If Claude Code is not on the desktop machine yet, install it there (the Claude Code cheat sheet covers sign-in and the flags used below). Anthropic’s setup docs recommend their native installer and warn against sudo npm install -g, and the npm package wants Node.js 22 or later. Ubuntu 26.04’s archive Node.js is 22, so on that VM the npm route worked as a normal user with a home-directory prefix:
npm config set prefix ~/.npm-global
npm install -g @anthropic-ai/claude-code
export PATH="$HOME/.npm-global/bin:$PATH"
claude --version
Add that export line to ~/.bashrc so new terminals find claude. On Ubuntu 24.04, whose archive Node.js is 18, use the native installer from the setup docs instead of npm. My 24.04 VM actually got Claude Code through npm on that Node 18, which the docs allow with an engine warning, but the native installer is the cleaner route. I didn’t run it in this lab; this is the command the docs give, and it puts claude in ~/.local/bin:
curl -fsSL https://claude.ai/install.sh | bash
Either way, claude --version should print a version before you go on.
Register the server from a terminal inside the desktop session, so the server inherits the session’s display and bus when Claude Code starts it.
claude mcp add agent-desktop -- agent-desktop mcp
claude mcp list
The health check starts the server and should end on Connected. Without a scope flag the entry goes into your local config for the current project directory, here /home/lorna, so start Claude Code from that same directory later or the server won’t load:
Added stdio MCP server agent-desktop with command: agent-desktop mcp to local config
File modified: /home/lorna/.claude.json [project: /home/lorna]
Checking MCP server health…
agent-desktop: agent-desktop mcp - ✔ Connected
claude mcp get agent-desktop shows the same entry as a stdio server with the command agent-desktop and the argument mcp. The whole sequence on the 26.04 VM, from the user-prefix install to a connected server:

I listed the server’s tools with a raw MCP tools/list call: it reports itself as agent-desktop 1.2.0 and exposes 67 tools, one per command plus the session, trace and skills helpers. Claude Code loads them on demand through tool search, so they don’t all sit in the context window. For Codex CLI or another MCP client, the README’s generic config block ("command": "agent-desktop", "args": ["mcp"]) is the starting point; only Claude Code was run in this lab, so treat other clients as untested. The Codex CLI cheat sheet shows where Codex keeps its MCP servers.
Run Claude Code on another machine
Both agent runs below came from Claude Code on my workstation, not on the VMs, which is handy when the desktop is a test box you don’t want an API session on. Claude Code started the MCP server over SSH, and the wrapper imports the session environment before handing stdio to agent-desktop mcp. Save it as ~/bin/agent-desktop-remote on the machine that runs Claude Code (mkdir -p ~/bin first), with your desktop’s address and user. SSH has to log in without any prompt, using a key and an already accepted host key, because a password prompt would hang the MCP handshake:
#!/bin/bash
exec ssh [email protected] 'export $(systemctl --user show-environment | grep -E "^(DISPLAY|XAUTHORITY|WAYLAND_DISPLAY|XDG_SESSION_TYPE|XDG_CURRENT_DESKTOP)=" | xargs); cd ~; exec agent-desktop mcp'
Make it executable, then point a Claude Code MCP config file at it. The lab’s copy only differed in the SSH key and host-key file options, which you can leave to your ~/.ssh/config.
chmod +x ~/bin/agent-desktop-remote
echo '{"mcpServers":{"agent-desktop":{"command":"'"$HOME"'/bin/agent-desktop-remote","args":[]}}}' > ~/agent-desktop-mcp.json
Add --mcp-config ~/agent-desktop-mcp.json --strict-mcp-config to the claude command in the next section, and the same 67 tools show up as if the server ran locally. The strict flag makes Claude Code ignore your other configured MCP servers, so the run only sees the desktop tools. That keeps the tool list small and makes the logs easy to read afterwards. If you’d rather run agent-desktop with Claude Code on the desktop box itself, our guide to installing Claude Desktop and Claude Code on Linux sets up the CLI there.
Let Claude Code drive GNOME Settings
For the real test, Claude Code got a five-part job on the 24.04 desktop. It had to read the platform guide, open Settings on the Appearance page, switch the style to Dark and confirm it with a fresh snapshot. Then it had to type a line into Text Editor and read it back. Allowing the server’s tools up front keeps -p mode from stopping at permission prompts. Run it from the directory where you added the server. My lab runs came from the remote setup, so they also carried --mcp-config ~/agent-desktop-mcp.json --strict-mcp-config, plus --output-format stream-json --verbose to log every tool call:
cd ~
claude -p "You are driving a real Ubuntu 24.04 GNOME desktop through the agent-desktop MCP tools. Before acting, read the platform guide with the skills tool. Task: 1) Open the GNOME Settings app and go to its Appearance page. 2) Switch the style from Default/Light to Dark. 3) Take a fresh snapshot and confirm the Dark option is now selected. 4) Open Text Editor and type exactly this line: 'Style switched to Dark by Claude Code via agent-desktop'. 5) Read the text back to verify it. Use refs from fresh snapshots, never guess refs. When finished, report in under 120 words what you did and how you verified each step." --allowedTools "mcp__agent-desktop" --max-turns 60
It took 2 minutes 16 seconds and 47 tool calls, and it didn’t go in a straight line. Settings exited with status 1 three times, because my wrapper at the time didn’t pass XDG_CURRENT_DESKTOP; Claude noticed that Text Editor launched fine, guessed the cause, and relaunched Settings with XDG_CURRENT_DESKTOP=ubuntu:GNOME in the launch environment. Then clicking the Appearance row came back POLICY_DENIED (the row only offers SetFocus) and select on the sidebar list returned ACTION_NOT_SUPPORTED, so it fell back to pressing Up and Return. This is the agent mid-task, on the Appearance page with Default still selected:

From there it found the Dark switch with desktop_find, clicked it, and confirmed with a new read that Dark was checked and Default wasn’t. The Text Editor half had one surprise: the app restored my earlier unsaved draft, and when Claude opened a second window to avoid touching it, GNOME moved the draft into the new window. Claude spotted the swap by reading both windows’ text fields, opened a fresh document in the empty one, typed the line and read it back. Its own summary of the run:
All five steps worked: the style is now Dark and the line is typed and read back.
1. **Settings → Appearance:** Settings wouldn't open until I set `XDG_CURRENT_DESKTOP=ubuntu:GNOME`. Clicking the Appearance entry was refused, so I pressed Up and Return. The page's "Style" label appeared.
2. **Dark:** before the change, "Default" was checked. I clicked the "Dark" ref from a fresh snapshot.
3. **Confirmed:** a new snapshot shows Dark checked and Default unchecked.
4. **Text Editor:** it reopened your draft "Notes from agent desktop". I didn't edit it, but opening a second window moved it there. I typed into a new document instead, and the tool confirmed the text went in.
5. **Read back:** the field's value is exactly `Style switched to Dark by Claude Code via agent-desktop`. That document is still unsaved.
Don’t take the agent’s word for it, because a click reply can come back delivered_unverified, as the menu click did earlier. GNOME’s own setting is the independent check, so read it after the run:
gsettings get org.gnome.desktop.interface color-scheme
It printed the dark value, so the change reached GNOME and wasn’t just a UI state.
'prefer-dark'
At the end, your desktop would show both windows like this one did: the new note on the left with the dark style applied, and my restored draft untouched on the right:

Two things are worth carrying into your own prompts. Telling the agent to read skills get platform first paid off, because that’s where it learned which Linux actions need a fallback. And asking it to verify each step with a fresh snapshot is what made it catch the window swap instead of typing into the wrong document.
Choose between X11 and Wayland
Ubuntu 24.04 still lists “Ubuntu on Xorg” on the login screen, while Ubuntu 26.04 ships GNOME 50, whose session list on the lab VM held only Wayland entries (/usr/share/xsessions doesn’t exist there). That makes the choice for you on 26.04, and the Ubuntu 26.04 vs 24.04 comparison covers the rest of that change. For agent-desktop, the difference is about physical input, not about reading apps:
| Capability | Ubuntu 24.04 on Xorg | Ubuntu 26.04 on Wayland |
|---|---|---|
| snapshot, find, get, semantic click and type | Worked | Worked |
Key presses (press) | Worked through XTEST | Worked through Mutter RemoteDesktop, but failed while the screen was blanked |
Pointer gestures with --headed | Available | ACTION_NOT_SUPPORTED, cause wayland_session |
focus-window and window control | Supported per the platform docs (not run here) | ACTION_NOT_SUPPORTED |
| Clipboard | Bundled clipboard-owner helper | Needs wl-clipboard; worked once installed |
| Claude Code agent run | Settings plus Text Editor: 47 tool calls, 2 min 16 s | Settings only: 22 tool calls, 47 s |
On 26.04 the refusals are clean and honest, which is what you want from a tool an agent reads: each one names the cause and suggests the semantic alternative. Here’s double-click --headed and focus-window being turned down, plus the key press that failed before I found the screensaver problem:

A Settings-only version of the job ran on 26.04 too, and it got there without the 24.04 run’s environment detour. Claude pressed Down six times to reach Appearance and pressed Return, then clicked the Dark switch by ref and confirmed it with two fresh reads. So my advice is short. If your agent only needs to read, type and toggle, Wayland is fine and you can stay on the default session. If it needs drag, hover, double-click or to bring windows forward, use the Xorg session on 24.04, because Wayland does not let one client move another client’s pointer or windows.
Fix the errors you’ll hit
Every error below came out of the two lab VMs, except the 22.04 one, and each fix was confirmed by rerunning the same command unless the entry says otherwise. The JSON envelope always carries an error.code and a suggestion, so grep for the code first.
PLATFORM_NOT_SUPPORTED: No display server is configured in this session
You’re in an SSH shell or a TTY, so there’s no DISPLAY or WAYLAND_DISPLAY to connect to. status may still say granted because the session bus is reachable, but no command can find a window. Run from a terminal on the desktop, or import the session variables with the systemctl --user show-environment line from the status section.
Empty supported_surfaces and “No D-Bus session bus is reachable”
This was sudo agent-desktop status, with accessibility reported as denied and a state root under /root. Root has no desktop session, so agent-desktop finds no bus to ask. Drop the sudo and run it as the user who’s logged in to GNOME; a global npm install still needs sudo, but nothing after it does.
POLICY_DENIED: direct semantic delivery is unavailable
The ref you picked doesn’t advertise the action. In GTK4 apps a menubutton wraps a switch that carries Click, and sidebar rows in Settings only expose SetFocus. Look at available_actions in the snapshot and pick the element that lists your action, or fall back to keyboard navigation with press.
ACTION_NOT_SUPPORTED with cause wayland_session
You asked for pointer input or window control on Wayland. The message says it plainly: “physical pointer input is not available through the compositor on Wayland”. Switch to the semantic action on the element, or log in to the Xorg session on Ubuntu 24.04 if the task really needs the pointer.
ACTION_FAILED: Session creation inhibited
On 26.04, press failed with “The compositor rejected the keyboard request” and the platform detail org.freedesktop.DBus.Error.Failed: Session creation inhibited. GNOME’s screensaver was active on the idle VM, and clipboard-get timed out in the same state with “The display server did not answer in time”. Check the screensaver from the session, or over SSH after importing the session variables:
gdbus call --session --dest org.gnome.ScreenSaver --object-path /org/gnome/ScreenSaver --method org.gnome.ScreenSaver.GetActive
If it prints (true,), switch the screensaver off and check again. The second call should print (false,):
gdbus call --session --dest org.gnome.ScreenSaver --object-path /org/gnome/ScreenSaver --method org.gnome.ScreenSaver.SetActive false
gdbus call --session --dest org.gnome.ScreenSaver --object-path /org/gnome/ScreenSaver --method org.gnome.ScreenSaver.GetActive
I reproduced it on purpose to be sure: with the screensaver active the key press was refused, and right after SetActive false the same press escape went through as RemoteDesktop.press_key. The clipboard round-tripped “hello from wayland” again too:

To keep the screen from blanking again on a desktop you hand to an agent, turn off the idle timeout and the lock. These two settings are the standard GNOME ones, but I didn’t wait out an idle period to prove they hold:
gsettings set org.gnome.desktop.session idle-delay 0
gsettings set org.gnome.desktop.screensaver lock-enabled false
An idle timeout of 0 tells GNOME never to start the screensaver on its own, which is what you want on an unattended agent desktop.
PLATFORM_NOT_SUPPORTED: wl-paste was not found
agent-desktop shells out to wl-copy and wl-paste on Wayland. I removed the package to check, and the error names the fix itself: “Install the wl-clipboard package, then try again”. sudo apt install wl-clipboard brought clipboard commands straight back.
GNOME Settings exits with status 1 when launched
gnome-control-center only runs when XDG_CURRENT_DESKTOP names GNOME, which a desktop terminal always sets but a hand-built SSH environment can miss. agent-desktop reports it as a launch failure without a window, so the cause isn’t obvious from the error alone. Add the variable to the imported list, as the wrapper above does.
Ubuntu 22.04 aborts on Action.GetActions
Per the upstream install notes, 22.04’s AT-SPI bridge aborts on this call, and the platform page asks other distributions for an at-spi2-core with fix dc0dc33. I didn’t run 22.04, so I can’t show the crash. Whatever the trigger, you’ll need Ubuntu 24.04 or later. The lab’s VMs carried at-spi2-core 2.52 on 24.04 and 2.60 on 26.04.
Keep an agent with desktop control on a short leash
An agent with agent-desktop can read and type into anything your desktop user can, including a browser with saved sessions, a password manager window and the clipboard. The README itself warns that snapshots, clipboard reads and command output can hold private desktop content. The run above also showed how a well-behaved agent still causes side effects you didn’t ask for, like moving a draft into a new window. Before you point one at a desktop you care about, go through this list:
- You run the agent against a dedicated VM or a separate desktop user, not your daily login.
- You allow only the tools a task needs in Claude Code, for example
mcp__agent-desktop__desktop_snapshotplus the find and get tools for a read-only job, instead of the wholemcp__agent-desktopserver that the run above approved (all 67 tools, clipboard and key presses included). - You remember that
--allowedToolsonly pre-approves tools; to take a tool away completely, list it in--disallowedTools. - You leave headless mode on, so ref actions stay semantic and the pointer only moves when you add
--headedon purpose (key presses still go out as real key events). - You pass secrets with
type --stdinas a separate command, since batch JSON text ends up in process arguments. - You keep snapshot files and traces out of public logs and issue reports.
Dangerous key combos such as alt+f4 are blocked unless you pass --force, which is a sensible default but not a sandbox. If you’re weighing which coding agent to trust with this kind of reach, the OpenCode, Claude Code, Cursor and Codex comparison lays out how each one handles approvals. The Ubuntu 26.04 desktop install guide is a quick way to build a throwaway VM to hand it.