Skip to main content
Glama

hyprcage

A caged desktop for AI agents on Hyprland.

When an agent needs a graphical application for itself, to test a UI, take screenshots or drive an app, it should not do it on your desktop. hyprcage gives it a screen of its own: a cage compositor with its own output and its own seat, in memory. Hyprland never learns that screen exists, so your monitors, workspaces, focus and cursor are never touched, and the desktop scripts that watch for a monitor being plugged in never fire. You watch the agent work through a mirror window on a spare workspace, or not at all. It works on any Hyprland desktop, Omarchy included, with Claude Code, Codex, Cursor, Gemini CLI, Windsurf, OpenCode or any other MCP client.

Install

Claude Code

/plugin marketplace add hexadecimil/hyprcage
/plugin install hyprcage@hyprcage

The plugin fetches its binary on first start. If cage is missing, the agent asks for it through a password dialog the first time it needs a screen.

Terminal

curl -fsSL https://raw.githubusercontent.com/hexadecimil/hyprcage/main/install.sh | bash

Installs cage, the latest release, and registers hyprcage with every agent found on the machine. Options come after bash -s --:

curl -fsSL https://raw.githubusercontent.com/hexadecimil/hyprcage/main/install.sh | bash -s -- --agents codex,cursor

Option

Effect

--agents claude,codex,gemini,cursor,windsurf,opencode

register only these agents (default: every agent found)

--agents none

register no agent

--uninstall

remove the binary, the registrations, hyprcage's state and its configuration

HYPRCAGE_VERSION=v0.1.0

install that release instead of the latest

HYPRCAGE_FROM_SOURCE=1

build with Go instead of downloading

To pin the script itself to a version as well, fetch it from the tag:

curl -fsSL https://raw.githubusercontent.com/hexadecimil/hyprcage/v0.1.0/install.sh | HYPRCAGE_VERSION=v0.1.0 bash

From source (Go ≥ 1.24)

git clone https://github.com/hexadecimil/hyprcage && cd hyprcage
make build && install -Dm755 hyprcage ~/.local/bin/hyprcage
hyprcage setup && hyprcage config && hyprcage doctor

Related MCP server: ghost-desktop

Agents

Agent

Tools

Skill

Screens of a finished session

Claude Code

plugin

plugin

closed at once

Codex

codex mcp add

~/.codex/skills

closed by the safety timer

Cursor

~/.cursor/mcp.json

~/.cursor/skills

closed by the safety timer

Gemini CLI

gemini mcp add

closed by the safety timer

Windsurf

~/.codeium/windsurf/mcp_config.json

~/.codeium/windsurf/skills

closed by the safety timer

OpenCode

~/.config/opencode/opencode.json

~/.config/opencode/skills

closed by the safety timer

Any MCP client

hyprcage mcp on stdio

skills/hyprcage/SKILL.md

closed by the safety timer

The installer registers hyprcage with every agent it finds. To choose, install.sh --agents codex,cursor limits it to those, and --agents none skips the step. Only the Claude Code plugin carries session hooks, which close an agent's screens the moment its session ends. Elsewhere, the safety timer closes them within 15 minutes.

Usage

The agent gets screen_create, app_launch, screenshot, click, type, key, scroll, drag, wait, windows, screen_destroy and a few more. Its skill tells it to use a screen for anything it launches for itself, one application per screen, and to close it when done.

A screen normally opens a mirror window on one of your spare workspaces, 6 to 9 by default. Switch to it with your usual workspace binding to watch the agent live. Nothing you do there reaches the agent: the mirror shows the screen and relays nothing back, so clicking or typing in it does nothing. hyprcage mirror <screen> opens or closes that window at any time. Every tool has a command-line twin: hyprcage create, launch, shot, click, type, destroy, mirror, list, config, doctor.

Configuration

A screen is a virtual monitor of width × height pixels. Screenshots have exactly that size and clicks use those coordinates. 1280x800 is what vision models read without downscaling. Above 2000 px a side, screenshots are scaled and clicks lose precision, hence the ceiling. Each screen is a compositor of its own, with an output only it can see, so Hyprland never learns of it and your monitors, workspaces, focus and cursor are never touched. You watch a screen through the mirror, an ordinary window on one of your workspaces.

The installer writes ~/.config/hyprcage/config.toml with every key at its default, so changing a setting is editing a line. hyprcage config writes it again if it is missing and never touches one that exists. The file is read by every command, so a change applies to the next screen or mirror without restarting anything. A key hyprcage does not know, or a value out of range, makes it refuse the whole file rather than run on the defaults in silence.

[screen]
width = 1280          # a new screen is this wide, and so is every screenshot of it
height = 800          # and this tall, 1280x800 being what vision models read best
max_width = 3840      # refuse a wider screen, whichever agent asks for it
max_height = 2160     # refuse a taller one
max_per_session = 4   # screens one agent session may hold at once, 0 lifts the limit
mirror = true         # open the window you watch a screen through, unless the agent says otherwise
notify = true         # tell you, through your desktop notifications, when a screen opens or closes

[workspaces]
mirror = [6, 9]       # the mirror windows land here, never on a workspace holding something else

[mirror]
group = "session"     # session: one workspace per agent session, its mirrors tiled side by side
                      # pack: mirrors of every session share a workspace until it is full
                      # screen: one workspace per mirror, each fullscreen
per_workspace = 4     # mirrors a workspace holds before the next one is used (session and pack)
fps = 30              # most frames per second the mirror asks for, and it asks none when idle or hidden

[lifecycle]
safety_timer = "15m"  # close a screen this long after the session that opened it died

[cage]
renderer = "auto"     # auto tries the GPU first and falls back, gles or pixman forces one
render_device = ""    # DRM node cage renders on, empty to follow your compositor's GPU

Several screens at once. Each screen is its own compositor, with its own output, seat, applications and mirror window. An agent can hold several (four per session by default, max_per_session), and closing one leaves the others untouched. Where the mirror windows go is mirror.group. With "session" every mirror of one agent session lands on the same workspace and Hyprland tiles them, four screens in one glance, and your usual fullscreen key enlarges the one you want to read. Another session takes the next workspace. With "pack" the mirrors gather whatever their session, and a workspace fills up before the next one is used: two agents with two screens each share one. per_workspace says when a workspace is full, four by default, and a seat freed by a closed screen is taken again first. With "screen" each mirror takes a workspace of its own, fullscreen. In every case a workspace freed by a closed screen goes back into the pool.

The mirror window. mirror is a default, not a rule. With mirror = true every screen opens its window unless the agent has a reason not to, for instance a long batch you never asked to watch. With mirror = false no screen opens one unless the agent judges that this one is worth showing you. Agents are told to leave the choice to you unless you said something about watching. When a screen has no mirror, hyprcage list gives the reason in mirror_note, and hyprcage mirror <screen> opens one at any time (with -close to take it away). A mirror opened later gets a workspace from the same pool, and when the pool is empty the request is refused rather than the window opened on the workspace you are looking at. The window keeps the screen's proportions whatever its own shape, with dark bars around the image rather than a stretched or cropped one. The mirror only asks for a frame when its window is visible and the screen has changed, so a hidden or idle mirror costs nothing.

Compatibility

Arch Linux and derivatives, Hyprland ≥ 0.50 in either configuration mode (hyprland.conf or hyprland.lua), any launcher, any desktop shell. Verified on Hyprland 0.56 with vanilla Arch and with Omarchy, on a real GPU and under software rendering. The aarch64 build is tested under emulation only.

A screen creates no Hyprland output and emits no monitor event, so nothing on your desktop reacts to it. Hyprland is only asked to place the mirror window, and only when there is one. Everything else, including a screen created while no compositor is running at all, needs nothing from it.

Browsers and Electron apps are single-instance: launch them in a cage with their own profile, or with yours closed.

Security

hyprcage isolates the agent from your graphical session, not from your system: applications in a cage run as you. See SECURITY.md.

Development

make build, make test. Architecture and the VM test suite: docs/development.md.

License

MIT

Available Tools

18 tools
app_closeA

Ask a window of the screen to close gracefully. Window ids change when a window remaps, so take the id from windows rather than from an older reply.

Inputs: toplevel (required), screen.

app_launchB

Run a graphical application inside a screen. Returns its pid and, once it appears, its window.

Inputs: command (required), cwd, env, screen, +1 more.

batchB

Run several actions in one call; stops at the first error.

Inputs: actions (required), screen, settle_ms, screenshot_after.

clickB

Click at screen coordinates (left by default; count=2 for a double click).

Inputs: x (required), y (required), count, button, +4 more.

double_clickB

Double-click at screen coordinates with the left button.

Inputs: x (required), y (required), screen.

dragB

Press the left button at (x1,y1), move to (x2,y2) and release.

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +4 more.

keyB

Press key combinations such as ctrl+l, Return, alt+F4, ctrl+shift+t.

Inputs: keys (required), screen, settle_ms, screenshot_after.

mirrorA

Open (open=true, default) or close (open=false) the human's mirror window for a screen, without touching the screen. Use it when the human asks to watch, or to stop showing a screen.

Inputs: open, screen.

moveA

Move the pointer to screen coordinates without clicking (hover).

Inputs: x (required), y (required), screen.

screen_createA

Create a virtual screen for yourself: a compositor with an output of its own, invisible to the human's desktop. Returns its name; use it in every other tool. Destroy it when done. The reply carries mirror_note when there is no mirror window for the human, and why.

Inputs: name, size, mirror.

screen_destroyA

Close a screen you created: its applications, its mirror window and its compositor.

Inputs: screen.

screen_listB

List your screens (or every session's with all=true).

Inputs: all.

screenshotB

Capture the screen. Returns the image plus its geometry; coordinates for other tools are screen pixels.

Inputs: scale, cursor, format, region, +2 more.

scrollC

Scroll the mouse wheel at screen coordinates.

Inputs: x (required), y (required), direction (required), amount, +3 more.

setupA

Install what hyprcage needs on this machine (cage) through the package manager. A password dialog opens on the human's screen: tell the human before calling it. Use it when screen_create fails with cage_missing, then retry.

typeC

Type Unicode text with the virtual keyboard (accents and emoji included).

Inputs: text (required), screen, settle_ms, screenshot_after.

waitB

Wait for a delay, for the image to stop changing (stable_ms) or for a window title (regexp).

Inputs: ms, title, screen, stable_ms, +1 more.

windowsB

List the windows of a screen with their ids, titles and app ids.

Inputs: screen.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools target clearly distinct resources or actions (screen lifecycle, app lifecycle, pointer/keyboard primitives, observation tools like screenshot/windows/wait). The one real overlap is double_click, which is fully redundant with click's documented count=2 option, forcing an arbitrary choice between two tools that do the same thing. setup and screen_create are adjacent but the description explicitly chains them (cage_missing -> setup -> retry), so that pairing is not confusing.

    Naming Consistency3/5

    Two conventions coexist: noun_verb for managed resources (screen_create, screen_list, screen_destroy, app_launch, app_close) and bare verbs or bare nouns for input/observation (click, type, key, drag, scroll, move, wait, screenshot, windows, batch, mirror). The internal grouping is logical and readable, but it is not a single predictable pattern, and 'windows' breaks the app_* family it arguably belongs to (could be app_list).

    Tool Count3/5

    18 tools sits at the borderline of heavy for what is essentially a screen-automation loop. Input primitives legitimately need breadth, but double_click duplicates click and move+drag/click could be consolidated, so a couple of tools do not fully earn their place.

    Completeness4/5

    Coverage is strong: screen create/list/destroy, app launch/close, window enumeration, a full pointer and keyboard input set, screenshot, wait, mirroring, batching and environment setup. The main gaps are window-level manipulation (move/resize/focus a window) and clipboard/paste support, which agents can partly work around with key combos but not fully.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to control Hyprland desktops via MCP, including pointer/keyboard input, screenshots, launching apps, and natural-language window targeting using a local decision model.
      14
      1
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      An MCP server that lets agents observe and control an Omarchy or Hyprland desktop: list monitors, windows, workspaces, and accessibility controls, capture screenshots, then move the pointer, type text, send shortcuts, and manage windows and workspaces. It works over stdio with any MCP client, guarding actions with session-lock and single-driver checks while treating on-screen content as untrusted data.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives each agent its own isolated nested Hyprland desktop with a private seat, clipboard and accessibility bus, so it can see the screen and drive a mouse, keyboard, touchpad gestures, windows and apps without touching the user's pointer, focus or windows. Exposes screenshots, zoom, OCR, accessibility-tree control, window management and batched actions as MCP tools, and can optionally act read-only, or with input, on the real desktop.
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an MCP client to see and drive a Hyprland/Wayland desktop by taking cropped, downscaled screenshots, reading the compositor's window tree, and sending absolute pointer and keyboard input mapped back to global layout pixels. It also exposes off-screen tmux sessions, background task runners, and DevTools-driven Chrome tabs for work that needs no window focus.
      55 PyPI
      MIT