Listed from the MCP registry; nobody on Odel publishes it.
KDE Plasma 6 Wayland GUI automation for AI agents: 30 tools (EIS input, screenshots, AT-SPI2).
Runs on your machine from its package; the steps are below.
At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally
This server runs on your machine over stdio, but its source registry didn't list a distribution package. Check the source repository for setup instructions.
Model Context Protocol server for Linux desktop GUI automation on KDE Plasma 6 Wayland
Actively maintained fork of isac322/kwin-mcp. This fork ships the fixes users were waiting for: MCP Python SDK 2.x support, text input in virtual sessions (host keymap isolation), reliable window focus, bounded startup waits, silent input-drop fix, honest error contracts — see the changelog and releases. Install:
uv tool install git+https://github.com/VibeProgramm/kwin-mcp
A Model Context Protocol (MCP) server that enables AI agents (Claude Code, Cursor, and other MCP clients) to launch, interact with, and observe any Wayland application in a fully isolated virtual KWin session -- without affecting the user's desktop. It also supports live desktop automation by connecting to an existing KWin session (real desktop or container) for collaborative workflows. With 30 MCP tools covering mouse, keyboard, touch, clipboard, accessibility tree inspection, screenshot capture, and window management, kwin-mcp provides everything needed for end-to-end GUI testing and desktop automation on Linux.
dbus-run-session + kwin_wayland --virtual sandbox. Your host desktop is never affected.systemd-nspawn) for collaborative "share my screen" workflows.libei protocol.Run end-to-end GUI tests for KDE/Qt/GTK applications in headless isolated sessions. kwin-mcp launches each app in its own virtual KWin compositor, interacts via mouse, keyboard, and touch input, then verifies results through screenshots and the accessibility tree -- all without a physical display.
Let AI agents like Claude Code autonomously operate desktop applications. The agent reads the accessibility tree to understand the UI, performs actions through 30 MCP tools, and observes the results via screenshots -- creating a complete feedback loop for any Wayland application.
Connect to your real desktop session and let Claude observe and interact with what you see. Use session_connect or pass --default-live-session to make live mode the default. Also supports attaching to KWin running inside containers (e.g. systemd-nspawn) for isolated agent desktops.
Integrate Linux desktop GUI testing into CI/CD pipelines. kwin-mcp's virtual sessions require no X11 or physical display server, making it suitable for headless environments like GitHub Actions or GitLab CI runners on Linux.
Automate kiosk interfaces and embedded Linux desktops running KDE Plasma or a bare KWin Wayland compositor. Use session_start for isolated virtual testing of kiosk UIs, or session_connect to attach directly to a live kiosk or embedded device session for real-time automation and diagnostics.
Requires KDE Plasma 6 on Wayland. See System Requirements for details.
1. Install
# Using uv (recommended)
uv tool install git+https://github.com/VibeProgramm/kwin-mcp
# Or from a source checkout
git clone https://github.com/VibeProgramm/kwin-mcp.git
cd kwin-mcp
uv tool install .
2. Configure Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"kwin-mcp": {
"command": "uvx",
"args": ["kwin-mcp"]
}
}
}
3. Use it
Ask Claude Code to launch and interact with any GUI application:
Start a KWin session, launch kcalc, and press the buttons to calculate 2 + 3.
Claude Code will autonomously start an isolated session, launch the app, read the accessibility tree to find buttons, click them, and take a screenshot to verify the result.
The fastest way to wire kwin-mcp into your editor is to install one of the bundled plugins. Each plugin auto-registers the MCP server and ships the kwin-desktop-automation skill, which teaches the agent which tool to call when (session-mode selection, the observe → act → verify loop, US-QWERTY vs Unicode typing, AT-SPI2 coordinate translation, and other platform pitfalls).
Claude Code — install the plugin from the marketplace:
/plugin marketplace add VibeProgramm/kwin-mcp
/plugin install kwin-mcp@kwin-mcp
OpenCode — add the npm plugin to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@isac322/kwin-mcp-opencode"]
}
For the full integration guide (manual fallback, customising the skill, troubleshooting), see docs/ai-agent-integration.md.
Add to your project's .mcp.json:
{
"mcpServers": {
"kwin-mcp": {
"command": "uvx",
"args": ["kwin-mcp"]
}
}
}
Or if installed globally:
{
"mcpServers": {
"kwin-mcp": {
"command": "kwin-mcp"
}
}
}
Add to your claude_desktop_config.json:
{
"mcpServers": {
"kwin-mcp": {
"command": "uvx",
"args": ["kwin-mcp"]
}
}
}
# As an installed script
kwin-mcp
# As a Python module
python -m kwin_mcp
# Interactive CLI (REPL for rapid testing)
kwin-mcp-cli
# Live session mode (default to real desktop instead of virtual)
kwin-mcp --default-live-session
kwin-mcp-cli --default-live-session
| Tool | Parameters | Description |
|---|---|---|
session_start | app_command? str, screen_width? int (0 = auto-detect), screen_height? int (0 = auto-detect), enable_clipboard? bool (false), keep_screenshots? bool (false), isolate_home? bool (false), keep_home? bool (false), env? dict | Start an isolated KWin Wayland session, optionally launching an app. A screen size of 0 auto-detects the bounding box of the logical desktop (all enabled outputs / connected monitors). Set enable_clipboard=true to enable clipboard tools (requires wl-clipboard). Set keep_screenshots=true to preserve screenshot files after session_stop. Set isolate_home=true to create a temporary HOME with isolated XDG directories (config, data, cache, state), preventing apps from reading/writing host user settings. Set keep_home=true to preserve the isolated home directory after session_stop. Pass extra environment variables via env. |
session_connect | dbus_address? str, wayland_display? str, keep_screenshots? bool (false) | Connect to an existing KWin session (real desktop or container). Defaults to $DBUS_SESSION_BUS_ADDRESS and $WAYLAND_DISPLAY. Clipboard is always enabled. session_stop only disconnects without killing KWin or pre-existing apps. |
session_stop | (none) | Stop the session and clean up. For virtual sessions: terminates KWin and all apps. For live sessions: disconnects without killing KWin or pre-existing apps. |
| Tool | Parameters | Description |
|---|---|---|
screenshot | include_cursor? bool (false) | Capture a screenshot of the virtual display (saved as PNG, returns file path) |
accessibility_tree | app_name? str, max_depth? int (15), role? str | Get the AT-SPI2 widget tree with roles, names, states, and screen coordinates (translated from window-local coordinates via compositor-side window geometry). Use role to filter to specific element types (e.g. "button", "check box"). Non-matching elements are hidden but their children are still traversed. |
find_ui_elements | query str, app_name? str, states? list[str] | Search for UI elements by name, role, or description (case-insensitive). Returns screen coordinates suitable for mouse_click and friends. Optionally filter by AT-SPI2 states (e.g. ["focused"], ["active", "visible"]). query can be empty when filtering by states only. |
| Tool | Parameters | Description |
|---|---|---|
mouse_click | x int, y int, button? str ("left"), double? bool, triple? bool, modifiers? list[str], hold_ms? int (0), screenshot_after_ms? list[int] | Click at coordinates. Supports left/right/middle, single/double/triple click, modifier keys (e.g. ["ctrl", "shift"]), and long-press via hold_ms. |
mouse_move | x int, y int, screenshot_after_ms? list[int] | Move the cursor (hover) to coordinates without clicking |
mouse_scroll | x int, y int, delta int, horizontal? bool, discrete? bool, steps? int (1) | Scroll at coordinates. delta positive = down/right, negative = up/left. Use discrete=true for wheel ticks, steps to split into smooth increments. |
mouse_drag | from_x int, from_y int, to_x int, to_y int, button? str ("left"), modifiers? list[str], waypoints? list[[x,y,dwell_ms]], screenshot_after_ms? list[int] | Drag from one point to another with smooth interpolation. Supports custom waypoints for complex drag paths. |
mouse_button_down | x int, y int, button? str ("left") | Press a mouse button at coordinates without releasing. Use with mouse_button_up for manual drag control. |
mouse_button_up | x int, y int, button? str ("left") | Release a previously pressed mouse button at coordinates |
| Tool | Parameters | Description |
|---|---|---|
keyboard_type | text str, screenshot_after_ms? list[int] | Type a string of text character by character (US QWERTY layout) |
keyboard_type_unicode | text str, screenshot_after_ms? list[int] | Type arbitrary Unicode text (Korean, CJK, etc.) via wtype or clipboard fallback (wl-copy + Ctrl+V). Requires wtype or wl-clipboard installed. |
keyboard_key | key str, screenshot_after_ms? list[int] | Press a key or key combination (e.g., Return, ctrl+c, alt+F4, shift+Tab) |
keyboard_key_down | key str | Press and hold a key without releasing. Useful for holding modifiers across multiple actions (e.g., hold Ctrl while clicking items). |
keyboard_key_up | key str | Release a previously held key |
| Tool | Parameters | Description |
|---|---|---|
touch_tap | x int, y int, hold_ms? int (0), screenshot_after_ms? list[int] | Tap at coordinates. Use hold_ms for long-press gestures. |
touch_swipe | from_x int, from_y int, to_x int, to_y int, duration_ms? int (300), screenshot_after_ms? list[int] | Swipe from one point to another with configurable duration |
touch_pinch | center_x int, center_y int, start_distance int, end_distance int, duration_ms? int (500), screenshot_after_ms? list[int] | Two-finger pinch gesture. end_distance < start_distance = pinch in, end_distance > start_distance = pinch out. |
touch_multi_swipe | from_x int, from_y int, to_x int, to_y int, fingers? int (3), duration_ms? int (300), screenshot_after_ms? list[int] | Multi-finger swipe gesture (2-5 fingers) for system gestures like workspace switching |
| Tool | Parameters | Description |
|---|---|---|
clipboard_get | (none) | Read the current clipboard text content. Requires enable_clipboard=true in session_start and wl-clipboard installed. |
clipboard_set | text str | Set the clipboard text content. Same requirements as clipboard_get. |
| Tool | Parameters | Description |
|---|---|---|
launch_app | command str, env? dict | Launch an application inside the running session. Returns PID and log path. |
list_windows | (none) | List all accessible application windows with per-window titles and active/focused state markers via AT-SPI2 |
focus_window | app_name str | Focus a window by application name (case-insensitive match) |
| Tool | Parameters | Description |
|---|---|---|
wait_for_element | query str, app_name? str, timeout_ms? int (5000), poll_interval_ms? int (200), expected_states? list[str] | Poll the accessibility tree until an element matching the query and/or states appears or timeout expires. Use expected_states to wait for state changes (e.g. ["active"], ["checked"]). query can be empty when waiting for state changes only. |
| Tool | Parameters | Description |
|---|---|---|
dbus_call | service str, path str, interface str, method str, args? list[str] | Call any D-Bus method in the isolated session. Useful for controlling KWin scripting, app-specific D-Bus APIs, and system services. |
read_app_log | pid int, last_n_lines? int (50) | Read stdout/stderr output of a launched app by PID. Set last_n_lines=0 for all output. |
wayland_info | filter_protocol? str | List Wayland protocols available in the session. Useful for verifying protocol access (e.g., plasma_window_management). |
Frame capture: Many action tools accept an optional
screenshot_after_msparameter (e.g.,[0, 50, 100, 200, 500]) that captures screenshots at specified delays (in milliseconds) after the action completes. This is useful for observing transient UI states like hover effects, click animations, and menu transitions without extra MCP round-trips. Frame capture uses the fast KWin ScreenShot2 D-Bus interface (~30-70ms per frame).
Claude Code / AI Agent
|
| MCP (stdio)
v
kwin-mcp server (30 tools) kwin-mcp-cli (interactive REPL)
| |
+--- both delegate to AutomationEngine (core.py) ---+
|
|-- session_start (virtual) ---> dbus-run-session
| |-- at-spi-bus-launcher
| +-- kwin_wayland --virtual
| +-- [your app]
|
|-- session_connect (live) ----> existing KWin (real desktop / container)
|
|-- screenshot ---------------> KWin ScreenShot2 D-Bus (spectacle fallback)
|
|-- accessibility_tree -------> AT-SPI2 (via PyGObject)
|-- find_ui_elements ---------> AT-SPI2 (via PyGObject)
|-- wait_for_element ----------> AT-SPI2 (polling)
|
|-- mouse_* ------------------> KWin EIS D-Bus --> libei
|-- keyboard_* ---------------> KWin EIS D-Bus --> libei
|-- touch_* ------------------> KWin EIS D-Bus --> libei
| +-- screenshot_after_ms -> KWin ScreenShot2 D-Bus (fast frame capture)
|
|-- keyboard_type_unicode ----> wtype / wl-copy + Ctrl+V
|-- clipboard_* --------------> wl-copy / wl-paste (wl-clipboard)
|
|-- launch_app / list_windows / focus_window
| |-- subprocess spawn
| +-- AT-SPI2 (via PyGObject)
|
|-- dbus_call -----------------> dbus-send (generic D-Bus)
|-- read_app_log --------------> log file read
+-- wayland_info --------------> wayland-info
kwin-mcp provides three layers of isolation from the host desktop:
dbus-run-session creates a private session bus. The isolated session's services (KWin, AT-SPI2, portals) are invisible to the host.kwin_wayland --virtual creates its own Wayland compositor with a virtual framebuffer. No windows appear on the host display.isolate_home=true is set in session_start, a temporary HOME directory is created with isolated XDG directories (XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME, XDG_STATE_HOME). Apps in the session cannot read or modify host user settings (e.g. ~/.config/kdeglobals), improving test reproducibility and safety. XDG_RUNTIME_DIR is intentionally not isolated because the Wayland socket resides there.Mouse, keyboard, and touch events are injected through KWin's private org.kde.KWin.EIS.RemoteDesktop D-Bus interface. This returns a libei file descriptor that allows low-level input emulation without requiring the XDG RemoteDesktop portal (which would show a user authorization dialog). The connection uses:
The screenshot tool captures via the KWin org.kde.KWin.ScreenShot2 D-Bus interface (~30-70ms per frame), with spectacle CLI as a fallback. For action tools with the screenshot_after_ms parameter, the same D-Bus interface is used for fast burst capture. Raw ARGB pixel data is read from a pipe and converted to PNG using Pillow.
The AT-SPI2 accessibility bus within the isolated session is queried via PyGObject (gi.repository.Atspi). This provides a structured tree of all UI widgets with their roles (button, text field, menu item, etc.), names, states (focused, enabled, visible, etc.), screen coordinates, and available actions (click, toggle, etc.).
| Requirement | Details |
|---|---|
| OS | Linux with KDE Plasma 6 (Wayland session) |
| Python | 3.12 or later |
| KWin | kwin_wayland with --virtual flag support (KDE Plasma 6.x) |
| libei | Usually bundled with KWin 6.x (EIS input emulation) |
| spectacle | KDE screenshot tool (CLI mode) |
| AT-SPI2 | at-spi2-core for accessibility tree support |
| PyGObject | GObject introspection Python bindings |
| D-Bus | dbus-python bindings |
Optional dependencies:
| Package | Required for |
|---|---|
wl-clipboard (wl-copy, wl-paste) | clipboard_get, clipboard_set, and keyboard_type_unicode clipboard fallback |
wtype | keyboard_type_unicode (preferred over clipboard fallback) |
wayland-utils (wayland-info) | wayland_info tool |
sudo pacman -S kwin spectacle at-spi2-core python-gobject dbus-python-common
# Optional: for clipboard and Unicode input
sudo pacman -S wl-clipboard wtype wayland-utils
sudo dnf install kwin-wayland spectacle at-spi2-core python3-gobject dbus-python
# Optional: for clipboard and Unicode input
sudo dnf install wl-clipboard wtype wayland-utils
sudo zypper install kwin6 spectacle at-spi2-core python3-gobject python3-dbus-python
# Optional: for clipboard and Unicode input
sudo zypper install wl-clipboard wtype wayland-utils
sudo apt install kwin-wayland spectacle at-spi2-core python3-gi gir1.2-atspi-2.0 python3-dbus
# Optional: for clipboard and Unicode input
sudo apt install wl-clipboard wtype wayland-utils
Note: the
kwin-mcpname on PyPI tracks the upstream project (isac322/kwin-mcp, v0.7.0, MCP SDK 1.x). This repository is the actively maintained fork (v0.9.0, MCP SDK 2.x); install it from git or from a source checkout. Theuvx kwin-mcpconfig examples in the Configuration section resolve to the PyPI package.
uv tool install git+https://github.com/VibeProgramm/kwin-mcp
pip install git+https://github.com/VibeProgramm/kwin-mcp
git clone https://github.com/VibeProgramm/kwin-mcp.git
cd kwin-mcp
uv sync
uv run kwin-mcp
keyboard_type supports US QWERTY only. For non-ASCII text (Korean, CJK, etc.), use keyboard_type_unicode, which requires wtype or wl-clipboard installed.clipboard_get, clipboard_set) are disabled by default because wl-copy can hang in isolated sessions. Enable with enable_clipboard=true in session_start, and ensure wl-clipboard is installed.accessibility_tree or find_ui_elements. Workaround: use screenshot to visually locate menu items and click by coordinates.dbus_call with KWin scripting or keyboard shortcuts instead.screenshot to disambiguate.KWIN_MCP_DEBUG_EI=1)Set the environment variable KWIN_MCP_DEBUG_EI=1 to enable verbose
diagnostics for the EIS input injection path (kwin-mcp's direct libei
connection to KWin):
KWIN_MCP_DEBUG_EI=1 uv run kwin-mcp
When enabled, the kwin_mcp.input logger is raised to DEBUG level with a
stderr handler and logs EIS device lifecycle events
(ADDED / REMOVED / RESUMED / PAUSED / SEAT_REMOVED), device stalls, and
connection rebuilds. Use it when input injection silently does nothing or
behaves erratically: the log shows whether KWin is pausing/removing its EIS
devices around input bursts and whether kwin-mcp manages to rebuild the
connection.
KWIN_MCP_DEBUG_EI=1 uv run kwin-mcp 2>eis-debug.log
session_start output — KWin did not
expose its EIS RemoteDesktop interface; the session degrades to a
screenshot/AT-SPI2-only session (no injection). Check the KWin version
(Plasma 6 required) and the server log for the degradation reason.keyboard_type_unicode fails in virtual sessions — kwin_wayland --virtual does not expose the virtual-keyboard protocol wtype needs;
the clipboard fallback (requires wl-clipboard) is the primary path
there.Contributions are welcome! See CONTRIBUTING.md for development setup, code style guidelines, and the pull request process.
git clone https://github.com/VibeProgramm/kwin-mcp.git
cd kwin-mcp
uv sync
uv run ruff check src/
uv run ruff format --check src/
uv run ty check src/