kwin-mcp
CLAUDE.md61 starsChanged 2 months 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 desktop automation workflows. See ROADMAP.md. Key modules: - core.py: AutomationEngine — MCP-independent automation logic (session,…
In this repository2 other files it gives its agents.
- check-docs-seoSkill
- release-notesSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
6
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 49
Read ROADMAP.md to understand current progress
- Distinctive: line 50
Start from the first incomplete item in the next milestone
- Very specific: line 51
After code changes, run uv run ruff check .
- Distinctive: line 52
Update ROADMAP.md checklist when a milestone item is completed
- Very specific: line 54
Invoke docs-seo agent after relevant file changes: After modifying any of the trigger files below, invoke the @docs-seo agent to evaluate …
- Very specific: line 80
Manual invocation: Use /check-docs-seo skill or the @docs-seo agent directly.
- Very specific: line 92
When writing or editing any documentation (README.md, CHANGELOG.md, GitHub release notes, pyproject.toml metadata, or repository settings), …
- Distinctive: line 104
Use keyword-rich headings (e.g.
- Distinctive: line 108
Keep the architecture diagram (ASCII art) up to date when adding tools or modules
- Distinctive: line 112
Follow Keep a Changelog format
- Distinctive: line 113
Use Added / Changed / Deprecated / Removed / Fixed / Security categories
- Distinctive: line 120
Always written in English
- Distinctive: line 131
Keep classifiers up to date (Development Status, Python versions, Topics)
- Very specific: line 136
About description: must match pyproject.toml description or be a shorter variant with primary keywords
- Distinctive: line 139
Social preview: use a branded 1280x640 image with project name, tagline, and technology logos/icons
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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 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
See ROADMAP.md. Key modules:
core.py: AutomationEngine — MCP-independent automation logic (session, input, screenshot, a11y)server.py: Thin MCP wrappers delegating to AutomationEnginecli.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_connect to real desktop or container)screenshot.py: KWin ScreenShot2 D-Bus (screenshots)accessibility.py: AT-SPI2 (widget tree)input.py: KWin EIS D-Bus + libei (input injection)
Pre-work Checklist
- Read
ROADMAP.mdto understand current progress - Start from the first incomplete item in the next milestone
- After code changes, run
uv run ruff check .+uv run ruff format .+uv run ty check - Update ROADMAP.md checklist when a milestone item is completed
- 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 MCP server tools. The MCP server process is already running with the old code loaded in memory — calling MCP tools after editing source files will NOT reflect the changes. Use the CLI to launch a session and test the modified functionality. Usekeep_screenshots=trueinsession_startto preserve screenshot files aftersession_stop(they are deleted by default). Files in/tmp/kwin-mcp-screenshots-*must be cleaned up manually when this option is used. - Invoke docs-seo agent after relevant file changes: After modifying any of the trigger files below, invoke the
@docs-seoagent to evaluate whether documentation is stale. A no-op conclusion is acceptable if nothing needs updating.
docs-seo Auto-Trigger Files
| Changed File | Trigger Label | docs-seo Action |
src/kwin_mcp/server.py | tool-registration, code-general | Check tool count, README tool tables, CONTRIBUTING structure, integrations//skills//SKILL.md tool list freshness |
src/kwin_mcp/session.py | session-api | Check README arch diagram, CONTRIBUTING session docs |
src/kwin_mcp/core.py | engine-api, code-general | Check README arch description, CONTRIBUTING structure |
src/kwin_mcp/*.py (any) | code-general | Check concrete numbers, CONTRIBUTING file listing, integrations//skills//SKILL.md "30 capabilities" reference |
pyproject.toml | package-metadata | Sync keywords with .claude/positioning.yml; check CLAUDE.md keyword tiers; run python3 scripts/sync_plugin_version.py to propagate version to integrations manifests |
CHANGELOG.md | changelog-update | Sync docs-seo.md positioning; add new search intents |
README.md | readme-update | Sync docs-seo.md positioning; update CLAUDE.md keyword tiers |
ROADMAP.md | roadmap-update | Add new long-tail keywords; update CONTRIBUTING.md if milestone adds contributor workflow |
.claude/positioning.yml | manifest-update | Full sync of docs-seo.md + CLAUDE.md SEO sections; propagate plugin_manifest_required_keywords to integrations manifests |
.claude-plugin/marketplace.json | plugin-manifest | Verify version matches pyproject; verify keywords ⊇ plugin_manifest_required_keywords |
integrations/claude-code/.claude-plugin/plugin.json | plugin-manifest | Verify version + keywords (same rule as above) |
integrations/opencode/plugin/package.json | plugin-manifest | Verify version + keywords (same rule as above) |
integrations/claude-code/skills/*/SKILL.md | plugin-skill | This is the source-of-truth SKILL.md. After edit, run python3 scripts/sync_plugin_version.py to mirror it into integrations/opencode/plugin/skill/<name>/SKILL.md |
integrations/opencode/plugin/skill/*/SKILL.md | plugin-skill | This file is auto-generated from the Claude Code source. Direct edits are forbidden — check_docs_seo.py::check_skill_identical will fail CI. Edit the Claude Code SKILL.md instead |
scripts/sync_plugin_version.py | code-general | Self-tests: run --check after editing the script itself |
Automation — Claude Code hook: .claude/settings.json registers a PostToolUse hook on Bash that runs .claude/hooks/docs-seo-trigger.sh when git commit or git add is executed. The script detects whether committed files match trigger patterns, then injects context into the conversation prompting docs-seo evaluation.
Automation — CI: .github/workflows/docs-seo.yml runs scripts/check_docs_seo.py on pull requests to validate SEO keyword consistency.
Manual invocation: Use /check-docs-seo skill or the @docs-seo agent directly.
System Dependencies (Arch/Manjaro)
at-spi2-core: AT-SPI2 accessibility framework (installed)python-gobject: GObject introspection Python bindings (installed)kwin: KWin Wayland compositor (installed)spectacle: Screenshot tool (installed, fallback)selenium-webdriver-at-spi: inputsynth binary (AUR, may need installation)
Documentation & SEO
When writing or editing any documentation (README.md, CHANGELOG.md, GitHub release notes, pyproject.toml metadata, or repository settings), follow these SEO guidelines.
Target Keywords
Primary: kwin-mcp, MCP server, GUI automation, KDE Plasma, Wayland automation, Linux desktop automation, live desktop automation Secondary: headless GUI testing, AI agent desktop, accessibility tree, AT-SPI2, libei, EIS, KWin virtual session, live session, session_connect, desktop testing framework, Wayland compositor testing, MCP tools, real desktop automation, desktop collaboration, kiosk automation, embedded device automation Long-tail: headless Wayland GUI testing, KDE Plasma automated testing, Linux GUI test automation CI/CD, Claude Code desktop automation, AI-driven Linux desktop testing, live KDE Plasma session automation, AI agent real desktop control, connect to live KWin session, container desktop automation, kiosk desktop automation, embedded Linux desktop testing
README.md Rules
- H1 must be the project name; the line immediately after must be a bold description under 160 characters (acts as meta description for GitHub/search engines)
- Include a badge row (PyPI version, downloads, Python version, license, CI status)
- Use keyword-rich headings (e.g. "Available Tools", "System Requirements", "How It Works")
- Maintain the tool reference tables with tool name, parameters, and description columns
- Include copy-paste installation commands (uv, pip, from source)
- Cross-link sections with a Table of Contents
- Keep the architecture diagram (ASCII art) up to date when adding tools or modules
CHANGELOG.md Rules
- Follow Keep a Changelog format
- Use Added / Changed / Deprecated / Removed / Fixed / Security categories
- Name specific tools (e.g.
mouse_click,accessibility_tree) in entries - Include comparison links at the bottom (
[0.x.y]: https://github.com/...) - Maintain an
[Unreleased]section at the top for in-progress changes
GitHub Release Notes Rules
- Always written in English
- Minor+ releases structure: opening paragraph with value proposition -> Highlights (bullet list) -> New Tools table (if applicable) -> Installation commands -> Full Changelog comparison link
- Patch releases structure: What's Changed -> detailed description -> Full Changelog comparison link
- First sentence must convey the value proposition (what the user gains)
- Name exact technologies: AT-SPI2, libei, EIS, KWin ScreenShot2, D-Bus, PyGObject, wl-clipboard, wtype
- Include tool counts when relevant (e.g. "30 MCP tools" or "17 new tools")
pyproject.toml SEO Rules
descriptionmust be under 120 characters and include "MCP server" + "Linux" + "GUI automation" + "KDE Plasma" + "Wayland"- Maintain 20+ keywords covering: protocol (mcp, model-context-protocol), compositor (kwin, kde, plasma, wayland), purpose (gui-automation, desktop-automation, testing, e2e-testing, headless, headless-testing), technology (at-spi2, libei, accessibility, ai-agents), ecosystem (claude-code, linux-desktop, wayland-automation, mcp-server)
- Keep classifiers up to date (Development Status, Python versions, Topics)
[project.urls]must include Homepage, Repository, Issues, Changelog, and Documentation
GitHub Repository Decoration Rules
- About description: must match pyproject.toml
descriptionor be a shorter variant with primary keywords - Topics: maintain 15-20 topics mirroring pyproject.toml keywords plus GitHub-specific tags (e.g.
hacktoberfestwhen applicable) - Homepage URL: link to PyPI project page (
https://pypi.org/project/kwin-mcp/) - Social preview: use a branded 1280x640 image with project name, tagline, and technology logos/icons
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.

