
perch
io.github.RedFoxxo/perch
Token-lean MCP server for desktop control: five compact tools for Linux and Windows apps.
Documentation
perch š¦
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-linux perch Tool list 19 tools, 67.8 KB 5 tools, 4.9 KB Server instructions 7.6 KB none One window's tree 31.5 KB 1.1 KB -
š Text first. A window is one line per element,
[e34 button "Save" disabled], and the assistant acts one34. 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
focusstep. -
š 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_oract_, so one rule per tier covers them all.
š Quick start
- š¦ 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. - š Connect your client: for Claude Code, run the command under Claude Code. Other clients are listed under Connect your client.
- 𩺠Check the desktop: ask your assistant "can you control my desktop?".
read_statussays what works and how to fix what doesn't (Requirements).
Then ask it "which windows are open?" or "press Save in the editor".
š¦ Install
| Way | For |
|---|---|
| Install script | Linux, Windows: the usual way |
| Claude Desktop bundle | Claude Desktop on Windows, nothing else to install |
| By hand | Downloading the file yourself |
| From source | Rust 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:
| Variable | Effect |
|---|---|
PERCH_VERSION | Install a given release, e.g. PERCH_VERSION=2.0.0 |
PERCH_INSTALL_DIR | Install into another folder |
PERCH_NO_MODIFY_PATH=1 | Leave 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):
| System | File |
|---|---|
| š§ Linux x64 | perch-linux-x64 |
| š§ Linux arm64 | perch-linux-arm64 |
| šŖ Windows x64, also Windows on ARM | perch-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 isperch-mcp; the program isperch), orcargo 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.
| System | Program | Download | Kept in |
|---|---|---|---|
| š§ Linux | computer-use-linux 0.7.53 | 17 MB | ~/.local/share/perch (or $XDG_DATA_HOME/perch) |
| šŖ Windows | open-computer-use 1.3.0 | 9 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.
| Id | Problem | perch fix |
|---|---|---|
accessibility | Accessibility is off | Turns it on; restart the apps afterwards |
gsettings | gsettings is missing | By hand |
gnome-extension | GNOME on Wayland: the window extension is not set up | Runs perch setup-window-targeting; log out and back in afterwards |
gnome-extension-login | The extension waits for your next login | By hand: log out and back in |
packages | xdotool (X11), wtype, hyprctl or grim (Hyprland, Sway and other wlroots desktops) not found | Installs them with pacman, apt or dnf |
grim-version | Hyprland: grim is older than 1.5 | By hand |
uinput | wlroots desktops: no access to /dev/uinput (the mouse) | Adds a udev rule and loads the module |
tesseract | Optional: no OCR for apps that show no buttons | Installs it |
blocked | The desktop program reports another blocker (what read_status shows) | By hand |
desktop-program | The desktop program could not check the desktop | By 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:
| Variable | Default | Effect |
|---|---|---|
PERCH_HOME | see above | Folder for the downloaded desktop program |
COMPUTER_USE_LINUX_BIN | perch's download | Linux: run this computer-use-linux instead; perch then downloads nothing |
COMPUTER_USE_LINUX_HYPRLAND_BACKGROUND | 1 | Hyprland: keys and window screenshots without focusing the window. 0 turns it off |
COMPUTER_USE_LINUX_AGENT_NAME | the client's name | Linux: 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:
| Tier | What it does | Suggested rule |
|---|---|---|
read_ | Looks: windows, elements, screenshots, status | allow |
act_ | Clicks, types and moves things in a window | ask |
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).
| Tool | What it does |
|---|---|
read_windows | Open windows: id, app, title, focus, workspace |
read_window | A window's buttons, fields and text as compact lines: [e34 button "Save" disabled] |
read_screenshot | A picture of one window (or the screen), or a new PNG file |
read_status | Whether accessibility, input and the window list work, and what blocks them |
act_window | Steps in one window: click, type, key, set, action, scroll, drag, focus, wait |
š Rules perch follows
- š·ļø e-refs.
read_windowlists elements ase34;act_windowturns them into the desktop program's element index and snapshot. A newread_windowreplaces them. - š Screenshot pixels.
[x, y]inact_windoware pixels of the window's lastread_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
actionstep. Mouse steps need an explicitfocusstep, 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_windowrefuses 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_screenshotand[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_BINat 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: trueafter afocusstep 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_windowcalls 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.
- Install perch as above.
- In your client's config, change
"command": "npx", "args": ["-y", "@redfoxxo/perch@1"]to"command": "perch"(opencode:"command": ["perch"]). - On GNOME, the setup command is now
perch setup-window-targeting. The extension you installed with 1.x keeps working. - 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.
https://github.com/RedFoxxo/perch/releases/download/v2.1.1/perch.mcpb# mcpb: https://github.com/RedFoxxo/perch/releases/download/v2.1.1/perch.mcpbRelated Servers
io.github.RedFoxxo/burrow
Read, search and edit LeafWiki pages with your own account, without overwriting others.
io.github.RedFoxxo/kit
Token-lean MCP server for Figma: read designs as compact text, render on demand.
io.github.RedFoxxo/pounce
Read and manage Targetprocess cards by name, with team rules applied.