What kwin-mcp does
The kwin-mcp MCP server provides Linux desktop GUI automation for KDE Plasma 6 running on Wayland. It exposes 29 MCP tools for starting and managing sessions, launching applications, reading the AT-SPI2 accessibility tree, capturing screens, controlling windows, injecting mouse and keyboard input, handling touch, using the clipboard, and communicating over D-Bus.
Two operating modes are available. An isolated virtual session runs its own dbus-run-session and virtual KWin compositor, keeping application windows and injected input away from the user's desktop. A live session connects to an existing KWin environment, including a real KDE desktop or a KWin instance inside a container. The project describes this as suitable for collaborative workflows where an agent observes and operates an existing desktop.
The server is in the OS Automation category and supports applications that run on KDE Plasma 6 Wayland, including Qt, GTK, and Electron applications.
How it works
In an isolated session, kwin-mcp starts the compositor and applications inside the session, then uses KWin's private EIS D-Bus interface and the standard libei protocol for input. This avoids XDG RemoteDesktop portal confirmation prompts. The isolation covers the desktop display and input path; it is not described as a filesystem or network sandbox.
Agents can inspect structured accessibility data instead of depending only on screenshots. AT-SPI2 exposes widget roles, names, coordinates, states, and available actions. Returned element references can be passed to pointer or touch operations, while element actions can invoke supported widget actions without coordinates. Screenshots remain available for visual verification.
Each tool provides an MCP output schema and structured content alongside readable text. This lets clients receive values such as window identifiers, element rectangles, and captured-frame paths without parsing unstructured output.
Setup and configuration
kwin-mcp requires KDE Plasma 6 on Wayland and Python 3.12 or newer. Installation is available through uv tool install kwin-mcp or pip install kwin-mcp. The documented installation process may build PyGObject, Pycairo, and dbus-python, so isolated environments need a C compiler and development headers. On Debian 13, the README lists build-essential, pkg-config, python3-dev, libcairo2-dev, libgirepository-2.0-dev, and libdbus-1-dev as required packages.
For Claude Code, register the kwin-mcp MCP server in a project .mcp.json and run it with uvx kwin-mcp, or use the installed kwin-mcp command. The repository also documents a Claude Code plugin and an OpenCode plugin. Claude Desktop configuration is supported through its MCP configuration file. Live operation can be selected with the session connection tool or made the default with the --default-live-session flag.
Tools and capabilities
The 29 tools cover:
- Virtual and live session creation, connection, and management
- Application launching and interaction
- Screen capture and observation
- AT-SPI2 accessibility-tree inspection
- Window management
- Mouse, keyboard, and multi-touch input
- Clipboard operations
- D-Bus access
The kwin-mcp MCP server is suited to end-to-end GUI tests, headless CI jobs, AI-guided desktop workflows, kiosk interfaces, and embedded Linux systems using KDE Plasma or a bare KWin Wayland compositor. Virtual sessions are intended for isolated testing; live connections are intended for existing desktops or containerized KWin environments.