Thank you for your interest in contributing to kwin-mcp, an MCP server for Linux desktop GUI automation on KDE Plasma 6 Wayland.
- Python 3.12+
- KDE Plasma 6 on Wayland (for running and testing)
- uv package manager
Install the required system packages for your distribution:
Arch Linux / Manjaro:
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-utilsFedora (KDE Spin):
sudo dnf install kwin-wayland spectacle at-spi2-core python3-gobject dbus-python
# Optional
sudo dnf install wl-clipboard wtype wayland-utilsKubuntu / KDE Neon:
sudo apt install kwin-wayland spectacle at-spi2-core python3-gi gir1.2-atspi-2.0 python3-dbus
# Optional
sudo apt install wl-clipboard wtype wayland-utilsgit clone https://github.com/isac322/kwin-mcp.git
cd kwin-mcp
uv syncThe project includes a docs-seo consistency checker (scripts/check_docs_seo.py) that validates SEO keywords and positioning terms across documentation files. It runs automatically in CI on pull requests and can be invoked locally:
python3 scripts/check_docs_seo.pyIn Claude Code sessions, use the /check-docs-seo skill or the @docs-seo agent to evaluate and update documentation after code changes.
This project uses ruff for linting and formatting, and ty for type checking.
uv run ruff check . # Lint
uv run ruff format . # Format
uv run ty check # Type checkKey style rules:
- Python 3.12+ syntax (use
typealiases,|unions, etc.) - Double quotes for strings
- Line length: 100 characters
- Type hints required for all function signatures
- All code comments and docstrings in English
After modifying kwin-mcp code, verify your changes via the interactive CLI:
uv run python -m kwin_mcp.cliThe CLI provides the same functionality as the MCP server and allows you to test tools interactively.
Use session_start to launch an isolated KWin Wayland session — safe for automated tests and CI since it does not touch your real desktop:
> session_start
Use session_connect to attach to your existing KDE Plasma desktop session. This is useful when testing features that require a real desktop environment (e.g., clipboard integration, real application interaction):
> session_connect
session_connect defaults to the current session via $DBUS_SESSION_BUS_ADDRESS and $WAYLAND_DISPLAY. You can also pass explicit values:
> session_connect dbus_address=unix:path=/run/user/1000/bus wayland_display=wayland-1
You can also start the CLI in live-session-default mode with --default-live-session:
uv run python -m kwin_mcp.cli --default-live-sessionNote: Do not test via the MCP server if it was started before your code changes -- it will still be running the old code. Always use the CLI for verification.
src/kwin_mcp/
├── core.py # AutomationEngine — MCP-independent automation logic
├── server.py # MCP server (thin wrappers around AutomationEngine)
├── cli.py # Interactive REPL + pipe mode
├── session.py # KWin session management (isolated virtual + live desktop)
├── screenshot.py # Screenshot capture via KWin ScreenShot2 D-Bus
├── accessibility.py # AT-SPI2 accessibility tree inspection
└── input.py # Input injection via KWin EIS D-Bus + libei
- Fork the repository and create a feature branch
- Make your changes following the code style guidelines above
- Run all checks:
uv run ruff check . && uv run ruff format --check . && uv run ty check - Update
CHANGELOG.mdif your change is user-facing (new tools, bug fixes, behavior changes) - Update
README.mdif you add new tools or change existing tool behavior - Open a pull request with a clear description of the changes
- Bug reports: Use the bug report template and include your kwin-mcp version, OS, KDE Plasma version, and steps to reproduce
- Feature requests: Use the feature request template with a clear use case description
By contributing to kwin-mcp, you agree that your contributions will be licensed under the MIT License.