← BACK TO HOME
CASE STUDYSOURCE ONLY

gui-ssh

SystemsROLE — SOLE BUILDER

SSH, but for the desktop. A Rust daemon that streams a Wayland desktop to a browser and exposes it to AI agents over MCP: screenshots, the accessibility tree, mouse and keyboard. A human can take over at any moment.

RUSTTOKIOAXUMMCP
Private repository — walkthrough on request
gui-ssh viewer — mockup
gui-ssh — live preview

PROOF

MEASURED, SOURCED
88 ms
MEDIAN INPUT TO VISIBLE FRAME
Repository benchmark notes, Nov 2026
10 / 10
GUI-ONLY AGENT BENCHMARK TASKS PASSED
Repository benchmark, $0.97 and 356 s
332
AUTOMATED TESTS
256 Rust + 76 web viewer, repository test suites
OPEN REPOSITORY EVIDENCE (1)
29
PULL REQUESTS MERGED
Private repository, 4–12 Nov 2026

THE PROBLEM

WHAT NEEDED SOLVING

Coding agents live in the terminal, but a lot of real work happens in GUI apps. Remote-desktop tools are built for people, not agents, and on Wayland nothing may read the screen or inject input without the desktop's consent. The goal was one tunnel, like SSH, that gives an agent and a human the same desktop safely.

THE APPROACH

HOW IT WAS BUILT

One xdg-desktop-portal RemoteDesktop + ScreenCast session on KDE Plasma 6. PipeWire frames are encoded to JPEG and streamed over a WebSocket to a TypeScript viewer; input goes back through libei. The same session is exposed as an MCP Streamable HTTP server with 17 tools, from screenshot and zoom to ui_find and ui_act on the accessibility tree, typing and the clipboard. It listens only on loopback and is reached through ssh -L, with a bearer token, a watch-only token and Host/Origin checks against DNS rebinding. Every agent action is logged.

FIELD NOTES

PROBLEMS HIT — AND RESOLVED
  1. 01

    CONSENT WITHOUT A DIALOG EVERY TIME

    The portal asks the user before sharing the screen. A PermissionStore grant restores the approved session headlessly, so a reconnect is ready in 26 ms instead of waiting on a click.

  2. 02

    INPUT THAT ARRIVES IN ORDER

    libei reports EAGAIN under load and KWin could reorder a modifier and its key. Input is queued with backpressure, modifiers get a 4 ms gap, and release timers clear stuck keys.

  3. 03

    FRAMES OVER A SLOW LINK

    A pipelined window of three frames and 200 KB, with JPEG quality stepping down as round-trip time grows. In simulation at 220 ms RTT, frame rate went from 4.0 to 12.1 fps.

  4. 04

    A HUMAN CAN ALWAYS TAKE OVER

    Agent and human share the same session; the last person to press a key wins, so a user can grab control mid-task without a mode switch.

CAPABILITIES

WHAT IT ACTUALLY DOES
  • 17 MCP tools: screenshot, zoom, wait, ui_tree, ui_find, ui_act, ui_text, mouse, keyboard, scroll and clipboard
  • Browser viewer streams the live desktop; the agent and a human share one session
  • Loopback only, reached over ssh -L, with a 256-bit bearer token and a watch-only token
  • Accessibility boxes on Wayland via a KWin script
  • Every agent action written to an audit log