kwin-mcp
CLAUDE.md77 starsChanged 47 days agoMITView on GitHub
kwin-mcp is an MCP (Model Context Protocol) server for Linux desktop GUI automation on KDE Plasma 6 Wayland. Purpose: Enable AI agents (Claude Code and other MCP clients) to launch, interact with, and observe any Wayland application — either in a fully isolated virtual KWin session for reproducible GUI testing, or by connecting to a live KDE Plasma desktop (real session or container) for collaborative live desktop automation workflows. Key modules in src/kwin_mcp/: - models.py: Shared argument types and result…
In this repositoryOne other file it gives its agents.
- release-notesSkill
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
All documents (.md files), code comments, and docstrings must be written in English
- Very specific: line 55
After code changes, run uv run ruff check ., uv run ruff format --check ., uv run ty check src tests, and uv run pytest tests/unit.
- Very specific: line 56
Verify with CLI, not MCP tools: After modifying any kwin-mcp code, verify via the CLI (uv run python -m kwin_mcp.cli), NOT the running MCP …
- Very specific: line 57
Plugin and documentation sync: After changing pyproject.toml, src/kwin_mcp/server.py, or …
- Very specific: line 61
Before tagging a release, verify every kwin-mcp tool end to end on the release commit with the Docker E2E suite (scripts/run-e2e-docker.sh, …
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Code Working Guidelines
Project Overview
kwin-mcp is an MCP (Model Context Protocol) server for Linux desktop GUI automation on KDE Plasma 6 Wayland. Purpose: Enable AI agents (Claude Code and other MCP clients) to launch, interact with, and observe any Wayland application — either in a fully isolated virtual KWin session for reproducible GUI testing, or by connecting to a live KDE Plasma desktop (real session or container) for collaborative live desktop automation workflows.
Toolchain
- Package Manager:
uv(Astral). Always use uv instead of pip/poetry. - Lint + Format:
ruff(Astral). Config inpyproject.tomlunder[tool.ruff]. - Type Check:
ty(Astral). Config inpyproject.tomlunder[tool.ty]. - Build:
uv build(uv_build backend)
Common Commands
uv sync # Install/sync dependencies
uv add <pkg> # Add dependency
uv add --dev <pkg> # Add dev dependency
uv run ruff check . # Lint
uv run ruff format . # Format
uv run ty check # Type check
uv run python -m kwin_mcp # Run serverCode Style
- Python 3.12+
- ruff rules: E, F, W, I, N, UP, B, A, SIM, TCH, RUF
- Line length: 100
- Quotes: double quote
- Type hints required
- All documents (.md files), code comments, and docstrings must be written in English
Architecture
Key modules in src/kwin_mcp/:
models.py: Shared argument types and result models; onerender()per resultcore.py:AutomationEngine— MCP-independent automation logic for all 29 toolsserver.py: Thin MCP wrappers delegating toAutomationEnginecli.py: Interactive REPL + pipe mode viacmd.Cmd(kwin-mcp-clientry point)session.py: Virtual sessions (dbus-run-session+kwin_wayland --virtual) and live session attachment (session_connectto real desktop or container)screenshot.py: KWin ScreenShot2 D-Bus, Spectacle, and X11/scrot captureaccessibility.py: AT-SPI2 widget queries, element refs, and actionsspoken_name.py: Unicode normalization and spoken accessible-name matchinggeometry.py: Windows, virtual desktops, activation, and output topology via KWin scriptingclipboard.py: Private Wayland data-control helper for Unicode pastedbus_args.py:dbus_callargument parser (dbus-sendstrings and typed JSON)dbus_service_file.py: Bounded D-Bus service-file parser and direct AT-SPI exec helperinput.py: KWin EIS D-Bus + libei input injection and held-input tracking
Verification & Sync Checks
- After code changes, run
uv run ruff check .,uv run ruff format --check .,uv run ty check src tests, anduv run pytest tests/unit. - Verify with CLI, not MCP tools: After modifying any kwin-mcp code, verify via the CLI (
uv run python -m kwin_mcp.cli), NOT the running MCP server process (which still has old code loaded in memory). Useretention='{"artifacts": true}'insession_startto preserve/tmp/kwin-mcp-screenshots-*aftersession_stop, and remove it manually when done. - Plugin and documentation sync: After changing
pyproject.toml,src/kwin_mcp/server.py, orintegrations/claude-code/skills/kwin-desktop-automation/SKILL.md(the source of truth — never edit the OpenCode mirror directly), runpython3 scripts/sync_plugin_version.pyandpython3 scripts/check_docs_seo.py.
Release Gate
Before tagging a release, verify every kwin-mcp tool end to end on the release commit with the Docker E2E suite (scripts/run-e2e-docker.sh, once per --distro variant).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

