Repository avatar
Other Tools
v2.1.1
active

perch

io.github.RedFoxxo/perch

Token-lean MCP server for desktop control: five compact tools for Linux and Windows apps.

Documentation

perch 🦊

CI Release MCP Registry Platforms License: MIT

perch MCP server

A token-lean MCP server for desktop control. Your AI assistant sees and uses the apps on your Linux or Windows desktop with five compact tools: windows and their buttons, fields and text as short lines, pictures only on demand.

perch does no desktop work itself. On Linux it drives computer-use-linux (accessibility trees, screenshots, Wayland and X11 input, window targeting on GNOME, KDE, Hyprland, Sway and others). On Windows it drives the Windows runtime of open-computer-use (UI Automation, window messages, window capture). macOS is not supported yet.

Releases are listed in CHANGELOG.md.

✨ Why perch

  • šŸ¤ Small in the context. Five tools in 4.9 KB (~1,200 tokens) on every request, and no server instructions. Measured against computer-use-linux 0.7.53 on the file manager Thunar:

    computer-use-linuxperch
    Tool list19 tools, 67.8 KB5 tools, 4.9 KB
    Server instructions7.6 KBnone
    One window's tree31.5 KB1.1 KB
  • šŸ“ Text first. A window is one line per element, [e34 button "Save" disabled], and the assistant acts on e34. Screenshots are for apps that show nothing to accessibility.

  • šŸ™ˆ Your screen stays yours where it can. Element clicks run in the background. On Hyprland and Windows, keys, typing and window screenshots do too. A step that would show a window needs an explicit focus step.

  • šŸ›‘ Refuses instead of guessing. A window id that now belongs to another app, a point outside the screenshot, keys after the focus moved: nothing is sent, and the answer says how to go on.

  • 🪶 One small program. No Node.js or other runtime; about 4 MB of memory.

  • šŸ” Simple permissions. Every tool name starts with read_ or act_, so one rule per tier covers them all.

šŸš€ Quick start

  1. šŸ“¦ Install perch: Linux curl -fsSL https://raw.githubusercontent.com/RedFoxxo/perch/main/install.sh | sh, Windows (PowerShell) irm https://raw.githubusercontent.com/RedFoxxo/perch/main/install.ps1 | iex.
  2. šŸ”Œ Connect your client: for Claude Code, run the command under Claude Code. Other clients are listed under Connect your client.
  3. 🩺 Check the desktop: ask your assistant "can you control my desktop?". read_status says what works and how to fix what doesn't (Requirements).

Then ask it "which windows are open?" or "press Save in the editor".

šŸ“¦ Install

WayFor
Install scriptLinux, Windows: the usual way
Claude Desktop bundleClaude Desktop on Windows, nothing else to install
By handDownloading the file yourself
From sourceRust users, or a Docker image

Install script

# Linux
curl -fsSL https://raw.githubusercontent.com/RedFoxxo/perch/main/install.sh | sh
# Windows, in PowerShell
irm https://raw.githubusercontent.com/RedFoxxo/perch/main/install.ps1 | iex

The script downloads the file for your system from the latest release, checks it against the release's SHA256SUMS, and installs perch in ~/.local/bin (Windows: %LOCALAPPDATA%\Programs\perch). If that folder isn't on your PATH, it adds it: log out and back in (Windows: open a new terminal), then check with perch --version.

It then runs perch fetch, which downloads the desktop program perch drives.

šŸ”„ Update: run the same line again.

āš™ļø Options, set for the script:

VariableEffect
PERCH_VERSIONInstall a given release, e.g. PERCH_VERSION=2.0.0
PERCH_INSTALL_DIRInstall into another folder
PERCH_NO_MODIFY_PATH=1Leave your PATH alone

For example curl -fsSL …/install.sh | PERCH_VERSION=2.0.0 sh, or in PowerShell $env:PERCH_VERSION = '2.0.0' before irm … | iex.

Claude Desktop

Download perch.mcpb from the latest release and open it, or drag it into Settings → Extensions. Claude Desktop runs perch from the bundle. The bundle is for Windows (and Linux hosts that take bundles).

By hand

Download the file for your system from the latest release into a folder on your PATH and rename it to perch (perch.exe on Windows):

SystemFile
🐧 Linux x64perch-linux-x64
🐧 Linux arm64perch-linux-arm64
🪟 Windows x64, also Windows on ARMperch-windows-x64.exe

On Linux, make it executable: chmod +x perch. The release also has perch-macos-arm64 and perch-macos-x64, so one setup can install perch everywhere; on macOS its tools answer that desktop control is not available yet.

From source or Docker

  • šŸ¦€ With Rust: cargo install perch-mcp --locked (the crate is perch-mcp; the program is perch), or cargo install --git https://github.com/RedFoxxo/perch --tag v2.0.0 --locked.
  • 🐳 Docker: docker build -t perch . in a clone. The image lists the tools, which is what MCP directories need; to control a desktop, install perch in that desktop's session.

šŸ“„ The desktop program perch downloads

perch names one version of the program it drives and downloads it from that project's GitHub release, the first time a tool needs it (or when you run perch fetch). Each file is checked against a SHA-256 written in perch before it is used.

SystemProgramDownloadKept in
🐧 Linuxcomputer-use-linux 0.7.5317 MB~/.local/share/perch (or $XDG_DATA_HOME/perch)
🪟 Windowsopen-computer-use 1.3.09 MB%LOCALAPPDATA%\perch

A new perch release may name a newer version; the old folder can then be deleted.

🧩 Requirements

  • 🐧 Linux: x64 or arm64 with glibc (the builds computer-use-linux ships), in a desktop session. Accessibility on, and an input backend, as computer-use-linux's quick start describes.

  • 🐧 GNOME on Wayland: computer-use-linux lists and focuses windows through a small Shell extension. Install it with the version perch runs, then log out and back in:

    perch setup-window-targeting
    
  • 🪟 Windows: nothing else to install. Run perch in the signed-in desktop session, not over SSH or as a service.

read_status tells what is missing on a desktop, and how to fix it.

🩺 Checking and fixing a Linux desktop

perch doctor               # what is missing, and how each item gets fixed
perch doctor --json        # the same as one JSON object, for installers
perch fix <id>             # fix one problem doctor listed
perch fix --all            # fix everything perch can; add --optional for OCR
perch fix --undo           # accessibility and the GNOME extension back off, no /dev/uinput access

perch doctor prints one line per problem (✘ problem: how to fix, or āœ” the desktop setup is ready) and exits 1 while something that is not optional is missing. Run it in a terminal on the desktop: over SSH it checks nothing and says so. On Windows and macOS it reports no problems.

IdProblemperch fix
accessibilityAccessibility is offTurns it on; restart the apps afterwards
gsettingsgsettings is missingBy hand
gnome-extensionGNOME on Wayland: the window extension is not set upRuns perch setup-window-targeting; log out and back in afterwards
gnome-extension-loginThe extension waits for your next loginBy hand: log out and back in
packagesxdotool (X11), wtype, hyprctl or grim (Hyprland, Sway and other wlroots desktops) not foundInstalls them with pacman, apt or dnf
grim-versionHyprland: grim is older than 1.5By hand
uinputwlroots desktops: no access to /dev/uinput (the mouse)Adds a udev rule and loads the module
tesseractOptional: no OCR for apps that show no buttonsInstalls it
blockedThe desktop program reports another blocker (what read_status shows)By hand
desktop-programThe desktop program could not check the desktopBy hand

Installing packages and /dev/uinput need administrator rights. perch never reads a password: it runs sudo when sudo needs none or you are in a terminal, and otherwise pkexec, which shows the system's password dialog. In a container on Hyprland the /dev/uinput step runs on the host, through that dialog. Where none of these is possible, doctor prints the command to run by hand instead.

perch doctor --json prints { "problems": [{ "id", "problem", "optional", "pending", "fix" }] }, where fix is { "run": ["perch", "fix", "<id>"], "say": "what it does" } (with "needs": "password" when it takes administrator rights) or { "manual": "what to do by hand" }. pending problems are fixed and wait for a new login. Without a desktop session it adds "skipped" with the reason. It exits 0 whenever the check ran.

āš™ļø Settings

perch needs no settings. These environment variables change what it does:

VariableDefaultEffect
PERCH_HOMEsee aboveFolder for the downloaded desktop program
COMPUTER_USE_LINUX_BINperch's downloadLinux: run this computer-use-linux instead; perch then downloads nothing
COMPUTER_USE_LINUX_HYPRLAND_BACKGROUND1Hyprland: keys and window screenshots without focusing the window. 0 turns it off
COMPUTER_USE_LINUX_AGENT_NAMEthe client's nameLinux: the name computer-use-linux shows on screen while it acts

Other COMPUTER_USE_LINUX_* variables pass through to computer-use-linux unchanged. On Windows, perch starts the runtime with __COMPAT_LAYER=HighDpiAware unless you set that variable, so window positions and UI Automation coordinates are both in pixels on scaled displays.

šŸ”Œ Connect your client

Claude Code

Register perch once for all your projects:

claude mcp add --scope user perch -- perch

Then add the permission rules to ~/.claude/settings.json:

{
  "permissions": {
    "allow": ["mcp__perch__read_*"],
    "ask": ["mcp__perch__act_*"]
  }
}

Claude Code names MCP tools mcp__<server>__<tool>, so the server name must be perch for these rules to match. Check the connection with claude mcp get perch, or /mcp inside a session.

opencode

Add the server and the permission rules to opencode.json (global: ~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "perch": { "type": "local", "command": ["perch"] }
    }
  },
  "permissions": [
    { "action": "perch_read_*", "resource": "*", "effect": "allow" },
    { "action": "perch_act_*", "resource": "*", "effect": "ask" }
  ]
}

opencode names MCP tools <server>_<tool>, so the server name must be perch for these rules to match (read_windows becomes perch_read_windows). Restart opencode after changing the file; opencode mcp list shows whether it connected.

Other MCP clients

Any client that starts local (stdio) servers works. Most accept an mcpServers block like this one (Cursor, ...):

{
  "mcpServers": {
    "perch": { "command": "perch" }
  }
}

🧰 Tools

šŸ” Permission tiers

Tool names start with their tier, so client approval rules can allow looking and ask before acting:

TierWhat it doesSuggested rule
read_Looks: windows, elements, screenshots, statusallow
act_Clicks, types and moves things in a windowask

read_screenshot of a window brings that window to the front outside Hyprland and Windows, so perch does not mark it read-only for the client.

šŸ“š Tool list

Your client sends every listed tool to the model with each request: 5 tools, about 4,900 characters (~1,200 tokens).

ToolWhat it does
read_windowsOpen windows: id, app, title, focus, workspace
read_windowA window's buttons, fields and text as compact lines: [e34 button "Save" disabled]
read_screenshotA picture of one window (or the screen), or a new PNG file
read_statusWhether accessibility, input and the window list work, and what blocks them
act_windowSteps in one window: click, type, key, set, action, scroll, drag, focus, wait

šŸ“ Rules perch follows

  • šŸ·ļø e-refs. read_window lists elements as e34; act_window turns them into the desktop program's element index and snapshot. A new read_window replaces them.
  • šŸ“ Screenshot pixels. [x, y] in act_window are pixels of the window's last read_screenshot; perch converts them, and refuses points outside that image.
  • šŸ™ˆ Background first. Clicking an element whose primary action is click, press or toggle (Windows: invoke, select or toggle) runs that action without focusing the window. Other elements (a table cell that expands or edits) are refused with their action names, to use as an action step. Mouse steps need an explicit focus step, and keys for the focused window are refused if the focus moved.
  • ā™»ļø Reused window ids. If a window closed and another app got its id, act_window refuses instead of acting in the wrong app.
  • 🤐 Typed text is never echoed in answers. Long text and field values in trees are cut at 1,000 characters.
  • 1ļøāƒ£ One call at a time. Calls share one desktop and one pointer, so perch runs them in the order they arrive.

āš ļø Limitations

  • macOS is not supported yet.
  • Apps without accessibility (old toolkits, Wine, games, canvases) show no tree; use read_screenshot and [x, y] clicks there.
  • Drags on Linux take pixels of a whole-screen screenshot; on Windows, pixels of the window's screenshot, like clicks.
  • Linux without glibc (Alpine and other musl systems): perch itself runs, but the computer-use-linux build it downloads does not. Point COMPUTER_USE_LINUX_BIN at a build for your system.
  • Windows, background input: keys and typing are posted to the window as messages. Classic Win32 fields take them; some newer apps (Chromium, Electron, WinUI) ignore them, so the step says to check the result. focused: true after a focus step sends real keystrokes instead.
  • Windows, classic controls come forward when UI Automation acts on them: in CI, a WinForms button and check box (click, action) and Notepad's text field (set) all brought their window to the front. The step then says "the app came to the front".
  • Windows, trees show no disabled or checked state: the runtime doesn't report them.
  • Windows, refused apps: open-computer-use won't touch terminals, PowerShell, password managers or Windows Security. Apps running as administrator can be read but not clicked or typed into unless perch runs as administrator too.
  • Windows, speed: the runtime runs every operation in a new process, so a crashing capture can't take perch down. On GitHub's Windows runner, reads took 0.1 s and act_window calls 0.5–1.2 s.

ā¬†ļø Upgrading from 1.x

perch 1.x ran through npx from the npm package @redfoxxo/perch, which gets no new versions.

  1. Install perch as above.
  2. In your client's config, change "command": "npx", "args": ["-y", "@redfoxxo/perch@1"] to "command": "perch" (opencode: "command": ["perch"]).
  3. On GNOME, the setup command is now perch setup-window-targeting. The extension you installed with 1.x keeps working.
  4. Tool names, arguments, answers and permission rules stay the same. Two behaviour changes: unknown argument names are refused instead of ignored, and calls run one at a time.

šŸ› ļø Development

Building from source, running the tests and releasing are described in DEVELOPMENT.md.

šŸ“„ License

MIT. computer-use-linux and open-computer-use are MIT-licensed projects of their own authors; perch downloads them from their releases and does not include them.

MCPB
https://github.com/RedFoxxo/perch/releases/download/v2.1.1/perch.mcpb
Install Command
# mcpb: https://github.com/RedFoxxo/perch/releases/download/v2.1.1/perch.mcpb