claude-linux-mcp
Summary: Control a Linux desktop (X11/Wayland) via screenshots, mouse, keyboard, windows, clipboard, and app launching.
Screenshot: capture full screen or active window, plus OCR text extraction from screen (
screenshot_text)Windows: list, focus, move/resize, and close windows by title pattern
Mouse: move pointer, click (left/middle/right), drag, and scroll in any direction
Keyboard: type text into the focused window and press key combos (e.g.
ctrl+c,alt+Tab)Clipboard: read and write the clipboard
Apps: launch applications detached via shell command
Info:
desktop_inforeports backend, keyboard layout, and missing tools
Integrates with GNOME Shell via a bundled helper extension for listing, focusing, moving, and closing windows on Wayland, and uses GNOME settings for keyboard layout remapping and pointer acceleration adjustments.
Provides full desktop control on Linux, including screenshots, mouse and keyboard input, window management, clipboard read/write, application launching, and OCR of screen text.
Supports Wayland sessions with input injection via ydotool, clipboard access via wl-clipboard, screenshots via gnome-screenshot or grim, and window management through a GNOME Shell helper extension when available.
Linux Desktop — Claude Desktop extension
A Claude Desktop extension that gives Claude full desktop control on Linux (X11 and Wayland): screenshot, mouse, keyboard, window management, clipboard, and app launch.
Fills the same niche as Windows-MCP but for Linux. Built to pair with claude-terminal-mcp — Terminal handles the shell; this handles the GUI.
⚠️ Security — read this first
Installing this extension gives Claude full control over your desktop. Anything you can do with a keyboard and mouse, Claude can do through this tool:
Move your mouse anywhere and click anything (including dialogs, "Yes" buttons, Send buttons in open chat windows)
Type into whatever window currently has focus (including password fields)
Read and write your clipboard (so anything you've copied recently is visible)
Launch applications
Close windows (including unsaved work)
Treat installing this like giving someone physical access to your keyboard and mouse while they sit at your desk. Don't install it on machines with sensitive data you wouldn't want Claude to interact with, on shared systems, or if you're going to leave a chat unattended.
The denylist-style protection used by claude-terminal-mcp doesn't really apply here — a mouse click is a mouse click; you can't pattern-match intent. The safety rails in v0.1 are: (1) honest framing in this README, (2) destructiveHint: true annotations on every tool that changes system state, so Claude's own reasoning layer is aware, (3) the install flow requires explicit Extension Developer mode (red "unverified" warning).
Related MCP server: claude-terminal-mcp
What it does
Sixteen tools:
Tool | Purpose |
| Capture full screen (or active window if |
| Enumerate visible windows with id/pid/geometry/title. |
| Bring a window to the foreground. |
| Move/resize a window. |
| Request a window to close gracefully. |
| Move pointer to absolute screen coordinates. |
| Click left/middle/right; optional coords. |
| Drag from → to. |
| Scroll up/down/left/right by N clicks. |
| Type a string into the focused window. On Wayland, |
| Press a combo like |
| Read the CLIPBOARD selection as text. |
| Write a string to the CLIPBOARD. |
| Spawn an application detached (e.g. |
| Screenshot + OCR with tesseract; returns the recognized text. |
| Shows the active backend (X11/Wayland), keyboard layout, what's installed, what's missing, and the exact setup commands. |
All shell out to small, well-known CLI tools — no npm dependencies. The backend is picked automatically from $XDG_SESSION_TYPE / $WAYLAND_DISPLAY; set CLAUDE_LINUX_MCP_BACKEND=x11 or wayland to override.
Requirements
Display server: X11 or Wayland. To check which session you're on:
echo $XDG_SESSION_TYPEIf it says wayland, follow Wayland setup below instead of this section.
System tools for X11 (one-time install):
sudo apt install xdotool wmctrl xclipgnome-screenshot ships with Ubuntu GNOME; if you're on a different DE, install a screenshot tool:
# One of:
sudo apt install gnome-screenshot # GNOME, works everywhere
sudo apt install scrot # Minimal CLI
sudo apt install maim # Modern replacement for scrotOCR (optional, for screenshot_text — added in v0.2):
sudo apt install tesseract-ocr tesseract-ocr-eng
# Add tesseract-ocr-<lang> for other languages (fra, deu, nld, …).If tesseract isn't installed, only screenshot_text is unavailable — the other tools work normally.
Claude Desktop: ≥ 0.10.0 on Linux (bundles a recent Node; no system Node required).
Wayland setup
Wayland doesn't let one program read or drive another's windows, so each job uses a different tool:
Job | Tool |
Mouse and keyboard |
|
Clipboard |
|
Screenshots |
|
Window list/focus/move/close | the bundled GNOME Shell helper extension (without it, only XWayland windows are visible via |
Run the desktop_info tool at any point; it reports what's missing and prints these commands with the right paths filled in.
Packages:
sudo apt install ydotool wl-clipboard gnome-screenshotLet your user drive
/dev/uinput(a dedicated group, rather thaninput, which could also read every keyboard). The rule is numbered99-so it runs after the one Debian's ydotool package installs:sudo groupadd -f uinput sudo usermod -aG uinput "$USER" echo 'KERNEL=="uinput", GROUP="uinput", MODE="0660", OPTIONS+="static_node=uinput"' | sudo tee /etc/udev/rules.d/99-uinput.rules sudo udevadm control --reload-rules && sudo udevadm triggerReboot so the group applies. Logging out isn't always enough: the systemd user session that starts terminals and
ydotooldcan outlive it. Afterwardsid | grep uinputshould match andls -l /dev/uinputshould show groupuinput.ydotool 1.0 or newer only: start the daemon. Check with
ydotool(no arguments). If its command list has norecorderentry, you have 1.x:systemctl --user enable --now ydotoolydotool 0.1.x (what Ubuntu 24.04 packages) needs no daemon, but it can't drag or scroll.
Make absolute mouse moves exact. ydotool positions the pointer by moving it relatively from the top-left corner, so pointer acceleration throws it off:
gsettings set org.gnome.desktop.peripherals.mouse accel-profile 'flat'GNOME helper extension (for
list_windows,focus_window,move_window,close_window). It ships inside the.mcpband ingnome-extension/:mkdir -p ~/.local/share/gnome-shell/extensions cp -r gnome-extension/claude-linux-mcp@lukelamb.github.io ~/.local/share/gnome-shell/extensions/ # log out and back in (GNOME on Wayland only loads new extensions at login) gnome-extensions enable claude-linux-mcp@lukelamb.github.ioIt only exposes a small D-Bus interface (
io.github.lukelamb.ClaudeLinuxMcpon the session bus) and does nothing on its own.
Keyboard layouts. ydotool sends physical keys and types with a US keymap. key_press remaps letters for AZERTY (fr, be) and QWERTZ (de, ch, …) layouts, read from GNOME's input-source settings (override with CLAUDE_LINUX_MCP_KB_LAYOUT=be). On non-US layouts type_text defaults to pasting through the clipboard (it presses ctrl+v, then restores your previous clipboard); pass method: "type" to force keystrokes. In terminals, paste with key_press("ctrl+shift+v") after clipboard_set instead.
HiDPI. With display scaling, screenshot pixels and pointer coordinates can differ by the scale factor.
Install
Download
LinuxDesktop.mcpbfrom the latest release.Claude Desktop → Settings → Extensions → Extension Developer section → Install Extension → select the
.mcpbfile.Review the red "developer info not verified by Anthropic" warning. If you trust the source, click Install.
Back on All extensions, make sure Linux Desktop is toggled on.
In a chat, open the connector/tools picker and enable Linux Desktop for that conversation.
On first tool call, the server detects missing utilities and returns a clear "install with: sudo apt install …" error — you don't have to read the full README to discover what's missing.
Usage examples
Try asking Claude:
"Take a screenshot and tell me what's on my screen."
"List my open windows."
"Focus the Firefox window."
"Open gnome-terminal and then type
nvtopinto it.""Copy 'hello world' to my clipboard."
"Drag the Claude Desktop window to the top-left corner of the screen, resize it to 800×600."
"Scroll down three times in the active window."
Known limitations
Wayland needs one-time setup (see Wayland setup), and window management there needs GNOME plus the helper extension. On other Wayland compositors only XWayland windows can be listed or moved.
No AT-SPI UI inspection. v0.1 works with coordinates + window titles. Semantic ("click the Send button") targeting requires AT-SPI inspection, which is messy on Electron/Chromium apps and deserves its own focused v0.2.
Yellow "Tool result could not be submitted" banner. Cosmetic; fires on dynamic-tool-loading steps. Affects the stock Filesystem extension too. Not this extension's bug.
Privacy policy
No data leaves your machine. This extension runs entirely locally:
Data collection: None. The extension does not phone home, emit telemetry, or make any network requests of its own.
Data usage & storage: Screenshots are saved to
/tmp/claude-linux-mcp/shots/so Claude can reference them later in the same conversation. Nothing else is persisted by the extension itself.Clipboard:
clipboard_get()reads whatever is currently on your clipboard and passes it back to Claude Desktop in the tool result. Treat this the same way you'd treat pasting into a chat — don't ask for it if sensitive data is on your clipboard.Third-party sharing: None. Nothing is transmitted to Anthropic, the extension author, or any third party by this extension. (Claude Desktop itself separately sends tool inputs/outputs to Anthropic as part of the normal chat flow — that's Anthropic's relationship with you, not this extension's.)
Retention:
/tmp/claude-linux-mcp/is cleared at every reboot. To clear manually:rm -rf /tmp/claude-linux-mcp.Permissions scope: All tools run with your own user's permissions — the same as anything you'd type into a terminal or do with a mouse.
Contact / questions: Open an issue at https://github.com/LukeLamb/claude-linux-mcp/issues.
License
MIT. Use freely, attribution appreciated, no warranty.
Available Tools
15 toolsclipboard_getARead-only
Read the current X11 CLIPBOARD selection as text.
Inputs: no named parameters.
clipboard_setADestructive
Write a string to the X11 CLIPBOARD selection.
Inputs: text (required).
close_windowADestructive
Request a window matching the given title pattern to close (gracefully, via the WM close hint).
Inputs: title_pattern (required).
focus_windowADestructive
Bring a window matching the given title pattern (substring, case-insensitive per wmctrl) to the foreground.
Inputs: title_pattern (required).
key_pressADestructive
Press a keyboard combination using xdotool's keysym notation. Examples: 'ctrl+c', 'alt+Tab', 'super', 'Return', 'Escape', 'Page_Down'.
Inputs: combo (required).
launch_appADestructive
Launch an application via a shell command (e.g. "firefox", "gnome-terminal", "code /path/to/project"). The process is detached from this server.
Inputs: command (required).
list_windowsARead-only
List all visible windows with id, pid, desktop, geometry (x/y/width/height), hostname, and title.
Inputs: no named parameters.
mouse_clickADestructive
Click a mouse button. If x and y are provided, the pointer moves there first; otherwise clicks at the current pointer location.
Inputs: button, x, y.
mouse_dragBDestructive
Drag from (x1, y1) to (x2, y2) while holding the given button (default left).
Inputs: x1 (required), y1 (required), x2 (required), y2 (required), +1 more.
mouse_moveADestructive
Move the mouse pointer to absolute screen coordinates (x, y).
Inputs: x (required), y (required).
mouse_scrollADestructive
Scroll in a direction (up/down/left/right) by N clicks (default 3).
Inputs: direction (required), amount.
move_windowADestructive
Move and/or resize a window matching the given title pattern. Any of x, y, width, height omitted leaves that dimension unchanged.
Inputs: title_pattern (required), x, y, width, +1 more.
screenshotARead-only
Capture a screenshot of the full screen (or the active window if active_window=true). Saves a PNG under /tmp/claude-linux-mcp/shots/ and returns the path.
Inputs: path, active_window.
screenshot_textARead-only
Take a screenshot and OCR it with tesseract. Returns the recognized text plus the path to the underlying PNG. Use when Claude needs to READ what is on screen (log windows, error dialogs, terminal output in non-focused windows) rather than just see the image. Requires tesseract-ocr installed.
Inputs: active_window, path, lang.
type_textADestructive
Type a string into the currently-focused window (emits keystrokes). Use key_press for special/modifier combos.
Inputs: text (required), delay.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct purpose covering clipboard operations, window management, keyboard input, mouse actions, app launching, and screenshot capture. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., clipboard_get, close_window, mouse_click). The naming scheme is predictable and easy to parse.
15 tools is perfectly scoped for a desktop automation MCP server. Each tool addresses a distinct action without unnecessary redundancy, covering the essential operations for window management, input, and clipboard.
The tool surface covers the full lifecycle of desktop automation: window discovery and manipulation, input simulation (keyboard, mouse, clipboard), app launching, and screenshot capture with optional OCR. No obvious gaps are present for typical use cases.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
A cloud Linux desktop for your AI: browse, click, type, read the screen and run commands.
Give your Grok Bot a phone: an MCP server to see and use your phone. Also works with Claude.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables Claude Code to interact with Linux X11 desktops by performing mouse actions, keyboard input, and capturing screenshots. It provides a suite of tools for automation tasks such as clicking, typing, and zooming on specific screen regions.16-
- AlicenseAqualityCmaintenanceGive Claude Desktop terminal, filesystem, and background-job access on your local Linux machine. Zero-dependency MCP extension, MIT-licensed.85MIT
- AlicenseNot gradedqualityAmaintenanceControls a real Linux desktop from any MCP host. Reads accessibility trees, takes screenshots, and drives clicks, scrolls, and keystrokes across GNOME, KDE/KWin, Hyprland, i3, and COSMIC.3,142 npm920MIT
- AlicenseAqualityDmaintenanceEnables LLMs to capture desktop screenshots and control the mouse and keyboard on Linux, including Wayland, through MCP.111MIT