kwin
MCP server for Linux desktop GUI automation on KDE Plasma 6 Wayland -- 29 tools for mouse, keyboard, touch, accessibility, and screenshot in isolated KWin sessions
claude mcp add --transport stdio isac322-kwin-mcp python -m kwin_mcp
How to use
kwin-mcp is a Model Context Protocol server that lets MCP clients (e.g., Claude Code, Cursor) interact with Linux GUI applications running inside isolated virtual KWin Wayland sessions. It exposes 29 MCP tools organized into three groups: session management, observation, and input/mouse control. Use session_start to spin up a new virtual KWin session and optionally launch an app; session_stop to cleanly tear down the session. You can capture screenshots with screenshot, inspect the accessibility tree with accessibility_tree, and find UI elements with find_ui_elements to drive UI actions based on roles, names, and states. Mouse and input tools (mouse_click, mouse_move, mouse_scroll, mouse_drag, and button events) enable precise control of UI interactions within the isolated session, while AT-SPI2 data provides structured widget information for robust automation without relying solely on vision data.
How to install
Prerequisites:
- Python 3.12+ and pip installed on your system
- KDE Plasma 6 running Wayland (for full functionality with KWin)
- Optional: a system with XDG compatible clipboard tools if you intend to use clipboard features
Installation steps:
-
Install kwin-mcp from PyPI
- Using pip (recommended): pip install kwin-mcp
-
Verify installation (example):
- Run the module directly to start the MCP server (see "Running Directly" in the project docs): python -m kwin_mcp
-
Alternative installation via uv (optional):
- Install via uv tool management (if you prefer uvx/uv tool workflow): uv tool install kwin-mcp
- Run via uvx: uvx kwin-mcp
-
Configuration (example for .mcp.json in your project): { "mcpServers": { "kwin-mcp": { "command": "python", "args": ["-m", "kwin_mcp"] } } }
Note: If you install the CLI entry points, you can also run:
- kwin-mcp
- python -m kwin_mcp
- kwin-mcp-cli
These commands will start the MCP server in the current environment.
Additional notes
Tips and considerations:
- kwin-mcp runs each session in an isolated manner (dbus-run-session + kwin_wayland --virtual), ensuring your host desktop is unaffected.
- For clipboard support inside sessions, enable clipboard tools like wl-clipboard (needed if you want clipboard interactions).
- The server uses the AT-SPI2 accessibility tree to provide structured UI data, so some actions may rely on accessibility support being present in target applications.
- If you encounter issues with rendering or input in virtual sessions, ensure your system has KDE Plasma 6 Wayland and necessary KWin components installed and that virtualization features are enabled in your GPU drivers.
- To integrate into CI/CD or automation pipelines, leverage the 2-3 piece workflow: start a session (session_start), perform automated UI actions (via mouse/keyboard tools and element discovery), then stop the session (session_stop) to clean up resources.
Related MCP Servers
OpenContext
A personal context store for AI agents and assistants—reuse your existing coding agent CLI (Codex/Claude/OpenCode) with built‑in Skills/tools and a desktop GUI to capture, search, and reuse project knowledge across agents and repos.
native-devtools
MCP server for native app testing — screenshot, OCR, click, type, find_text, template matching. macOS, Windows & Android. Works with Claude, Cursor, and any MCP client.
lad_mcp_server
Lad MCP Server: Autonomous code & system design review for AI coding agents (Claude Code, Cursor, Codex, etc.). Features multi-model consensus via OpenRouter and context-aware reviews via Serena.
HydraMCP
Connect agents to agents. MCP server for querying any LLM through your existing subscriptions: compare, vote, and synthesize across GPT, Gemini, Claude, and local models from one terminal.
timebound-iam
An MCP Server that sits between your agent and AWS STS and issues temporary credentials scoped to specific AWS Services
cadre-ai
Your AI agent squad for Claude Code. 17 specialized agents, persistent memory, desktop automation, and a common sense engine.