Desk MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone git@github.com:KpihX/desk-mcp.git
cd desk-mcp
uv tool install --editable .
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "DISPLAY=${DISPLAY}" -e "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}" -e "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}" -e "WAYLAND_DISPLAY=${WAYLAND_DISPLAY}" desk-mcp -- node "<FULL_PATH_TO_DESK_MCP>/dist/index.js"

Replace <FULL_PATH_TO_DESK_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:DISPLAYDBUS_SESSION_BUS_ADDRESSXDG_RUNTIME_DIRWAYLAND_DISPLAY
README.md

Desktop automation MCP for AI agents — screenshot, mouse, keyboard, window.

desk-mcp

0 Trust – 100% Control | 0 Magic – 100% Transparency

Desktop automation MCP for AI agents — screenshot, mouse, keyboard, window inspection. Lets any MCP-capable agent (Claude, Gemini, Codex, Copilot, Vibe) see and interact with the KpihX-Ubuntu desktop.


The Problem

AI agents are blind to the desktop by default. They can read files and call APIs, but they cannot see what is on screen, click buttons, type in forms, or react to GUI state. desk-mcp bridges that gap — it exposes the desktop as a set of simple MCP tools that any agent can call over the standard stdio transport.

Agent CLI  ──stdio──►  desk-mcp  ──XDG Portal──►  Screenshot
                            └───────xdotool───────►  Click / Type / Key / Scroll
                            └───────xdotool───────►  Window list & geometry

Architecture

desk-mcp serve  (FastMCP, stdio transport)
│
├── screenshot()      XDG Desktop Portal  →  /usr/bin/python3 + dbus + GLib
│                     Full screen  →  optional crop (window name or {x,y,w,h})
│
├── get_windows()     xdotool search + getwindowgeometry
├── get_screen()      xdotool getdisplaygeometry + env vars
│
├── click()           xdotool mousemove + click
├── double_click()    xdotool click --repeat 2
├── right_click()     xdotool click 3
├── move_mouse()      xdotool mousemove
├── type_text()       xdotool type --delay <ms>
├── key()             xdotool key --clearmodifiers <combo>
└── scroll()          xdotool click (button 4/5/6/7)

Screenshot backend: XDG Desktop Portal via dbus-python + GLib. Works natively on GNOME Wayland without any dialog or user interaction. Does NOT depend on gnome-screenshot or grim.

Input backend: xdotool via XWayland. Covers all X11 and XWayland apps. For pure Wayland-native apps (e.g. WaveTerm in native mode), mouse coordinates are correct but window auto-detection via get_windows() may not see them.


Install

Prerequisites

sudo apt install xdotool python3-gi python3-dbus

From PyPI

uv tool install desk-mcp

Editable (development)

git clone git@github.com:KpihX/desk-mcp.git ~/Work/AI/MCPs/desk_mcp
cd ~/Work/AI/MCPs/desk_mcp
uv tool install --editable .

Usage

Claude Code (`~/.claude.json`)

"desk-mcp": {
  "command": "/home/kpihx/.local/bin/desk-mcp",
  "args": ["serve"],
  "env": {
    "DISPLAY": ":0",
    "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
    "XDG_RUNTIME_DIR": "/run/user/1000",
    "WAYLAND_DISPLAY": "wayland-0"
  }
}

Note: The display env vars must be injected explicitly because Claude Code does not inherit the user's graphical session environment.

Gemini (`~/.gemini/extensions/desk-mcp/gemini-extension.json`)

{
  "name": "desk-mcp",
  "version": "0.2.0",
  "description": "Desktop automation MCP for Gemini — screenshot, mouse, keyboard via xdotool.",
  "mcpServers": {
    "desk-mcp": {
      "command": "/home/kpihx/.local/bin/desk-mcp",
      "args": ["serve"],
      "env": {}
    }
  }
}

CLI test

desk-mcp status        # check environment and tool availability
desk-mcp screenshot    # take a test screenshot and print the path
desk-mcp serve         # start the MCP server (stdio)

Tools

Tool Description
screenshot Full screen or cropped to window name / region {x,y,w,h}
get_windows List all XWayland-visible windows with IDs and geometry
get_screen Screen resolution, session type, display vars
click Left / right / middle click at (x, y)
double_click Double-click at (x, y)
right_click Right-click at (x, y) — opens context menu
move_mouse Move mouse without clicking
type_text Type text at current keyboard focus
key Press key combo: "ctrl+c", "Return", "super", "alt+F4"
scroll Scroll up/down/left/right at (x, y)

Repos

Tools (10)

screenshotFull screen or cropped to window name or region.
get_windowsList all XWayland-visible windows with IDs and geometry.
get_screenGet screen resolution, session type, and display variables.
clickLeft, right, or middle click at specific coordinates.
double_clickDouble-click at specific coordinates.
right_clickRight-click at specific coordinates to open context menu.
move_mouseMove mouse cursor to specific coordinates.
type_textType text at current keyboard focus.
keyPress a key combination.
scrollScroll up, down, left, or right at specific coordinates.

Environment Variables

DISPLAYrequiredThe X11 display identifier.
DBUS_SESSION_BUS_ADDRESSrequiredPath to the D-Bus session bus.
XDG_RUNTIME_DIRrequiredPath to the XDG runtime directory.
WAYLAND_DISPLAYrequiredThe Wayland display identifier.

Configuration

claude_desktop_config.json
{
  "desk-mcp": {
    "command": "/home/kpihx/.local/bin/desk-mcp",
    "args": ["serve"],
    "env": {
      "DISPLAY": ":0",
      "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
      "XDG_RUNTIME_DIR": "/run/user/1000",
      "WAYLAND_DISPLAY": "wayland-0"
    }
  }
}

Try it

Take a screenshot of the current desktop to see what windows are open.
List all visible windows and their geometry to identify the browser window.
Move the mouse to the center of the screen and click to focus the active window.
Type 'Hello World' into the currently focused text field.
Press the 'super' key to open the application launcher.

Frequently Asked Questions

What are the key features of Desk MCP?

Full screen or region-based screenshot capture via XDG Desktop Portal. Window inspection to list IDs and geometry of visible applications. Mouse control including clicking, double-clicking, and movement. Keyboard input simulation for typing and complex key combinations. Native support for GNOME Wayland and XWayland environments.

What can I use Desk MCP for?

Automating GUI-based applications that lack a command-line interface. Enabling AI agents to visually inspect and interact with desktop software. Performing repetitive data entry tasks across multiple desktop windows. Creating automated testing workflows for Linux desktop applications.

How do I install Desk MCP?

Install Desk MCP by running: uv tool install desk-mcp

What MCP clients work with Desk MCP?

Desk MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Desk MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare