dual-wield-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dual-wield-mcpopen a terminal and type 'ls -la'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dual-wield-mcp
MCP (Model Context Protocol) server exposing Linux desktop control to AI agents over Wayland, for Fedora Linux with KDE Plasma only. Built for dual-client compatibility with Claude Code and Hermes Agent.
Status
v1.13.3 — Phases 1-12 and 15-18 complete; Phase 13 (session initialization and permission warm-up) mostly complete. Phase 14 (Concurrent Input Detection) is exploratory, no version target. See ROADMAP.md.
Tip: call focus_window before type_text/key_press to target a specific window —
synthetic mouse clicks alone do not reliably transfer keyboard focus on KWin (see
ROADMAP.md Phase 2/3 for details).
Related MCP server: desk-mcp
Requirements
Fedora Linux with KDE Plasma (Wayland), Python 3.14+
spectaclefor screenshot capture (KDE's native screenshot tool —grim/slurpwere tried first but depend on thewlr-screencopyprotocol, which KWin does not implement)ydotoolfor input control, withydotooldrunning as a user-level systemd service (requires/dev/uinputaccess — see uinput Permission Setup in ROADMAP.md)kdotool(KDE) orwlrctl(other wlroots compositors) for window managementwl-clipboard(wl-copy/wl-paste) forclipboard_set/clipboard_gettesseract(OCR engine) forfind_textPillow and pytesseract (installed automatically as Python dependencies) for
inspect_region's image cropping andfind_text's OCR — no manual setup beyond thetesseractbinary above
Installation
Not published to PyPI yet — install from a local clone with uv
as an isolated tool, so the dual-wield-mcp command lands on your PATH (at
~/.local/bin) where MCP clients can find it:
git clone <this-repo>
uv tool install ./dual-wield-mcpFor local development instead (editable install inside a project-local venv — note the
entry point then lives at .venv/bin/dual-wield-mcp, not on your global PATH):
uv venv .venv --python 3.14
uv pip install --python .venv/bin/python -e .System dependencies (Fedora):
sudo dnf5 install kde-spectacle ydotool kdotool wlrctl wl-clipboard tesseractydotoold must run as your user, not root (the packaged system unit runs as root, which
leaves the daemon socket unusable by your session). Create
~/.config/systemd/user/ydotoold.service with:
[Unit]
Description=ydotool daemon (user session)
[Service]
Type=simple
Restart=on-failure
ExecStart=/usr/bin/ydotoold
KillMode=process
[Install]
WantedBy=default.targetThen enable it:
systemctl --user daemon-reload
systemctl --user enable --now ydotoold.serviceUsage
Run the server directly:
dual-wield-mcpClaude Code registration
Recommended — via the CLI (registers at local scope, personal to you and this project):
claude mcp add dual-wield -- dual-wield-mcpUse --scope project instead to write the registration to .mcp.json in the repo root
and share it with your team via git.
Manual alternative — add this to .mcp.json (project scope) yourself:
{
"mcpServers": {
"dual-wield": {
"type": "stdio",
"command": "dual-wield-mcp"
}
}
}Hermes Agent registration
hermes mcp add dual-wield --command dual-wield-mcpdual-wield is just the label Hermes stores the server under; --command is the actual
binary to launch (verified against a real Hermes Agent v0.13.0 install — hermes mcp add
requires an explicit --command or --url, a bare server name alone is not enough).
Recommended agent configuration
For best performance, specify in your agent's configuration (CLAUDE.md, AGENT.md, or
equivalent project instructions) that it should perform all desktop navigation and
interaction through this MCP server's tools — not a mix of manual shell commands, other
tools, and this server. Mixing approaches means some actions still go through ad hoc,
dynamically-constructed shell commands, which can trigger a permission prompt on every
single invocation regardless of any allowlist entry (Claude Code flags shell syntax it
cannot statically analyze, such as command substitution, every time). Each such prompt
interrupts the agent mid-task and requires clicking into the agent's own window to
respond, which can itself change focus on the desktop being automated. Routing
everything through this server's typed, schema-validated tools avoids that class of
prompt entirely once the tools are allowlisted by name.
For clients that support pre-approving tools by name (Claude Code's
.claude/settings.json/settings.local.json, via permissions.allow), pre-populate
it with every tool listed under Tools below, rather than letting each one hit its own
first-use approval prompt scattered across a session. Confirmed live: doing this
eliminates a fresh session's scattered-prompt problem entirely, with no server changes
needed. List each tool explicitly as mcp__dual-wield__<tool_name> (e.g.
mcp__dual-wield__mouse_click) — a mcp__dual-wield__* wildcard entry is also
accepted, but community reports (anthropics/claude-code issues #3107, #6010) say the
wildcard form alone isn't always honored, so keep the explicit per-tool list alongside
it rather than relying on the wildcard by itself.
A note on the desktop session environment
MCP clients (including the reference Python SDK used by Claude Code) only pass a small,
curated allowlist of environment variables to the server subprocess by default — HOME,
LOGNAME, PATH, SHELL, TERM, USER. WAYLAND_DISPLAY, DBUS_SESSION_BUS_ADDRESS,
and XDG_RUNTIME_DIR are not included, which breaks every tool here (spectacle,
kdotool, ydotool all need at least one of them). dual-wield-mcp fills in the
standard systemd-user-session defaults for these at startup if they're missing
(/run/user/<uid>, unix:path=<runtime_dir>/bus, wayland-0), so this works
out of the box for the common single-session desktop. If you run multiple Wayland
sessions or a non-standard setup, override them explicitly via the client's env config
for the server (e.g. an "env": {"WAYLAND_DISPLAY": "wayland-1"} block).
Configuration
Environment variables (all optional):
Variable | Default |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tools
initialize()— call this once, as the first action in a new session, before any task-driven tool use. Pre-warmsmouse_move's pointer calibration (the first real click of a fresh session can otherwise land off-target while that calibration is still converging) and returns a snapshot of session-start desktop state — display scale, detected window backend, and (KDE backend only) a fresh window listing — instead of rediscovering it reactively call by call.screenshot(mode="full"|"region", output_path=None, include_image=True)— captures the desktop viaspectaclein background mode, optionally selecting a region first via an on-screen drag selection. Returns the saved file's absolute path as text, followed by the captured image. Passinclude_image=Falseto return only the path when the screenshot is just input tofind_text/click_textand won't be viewed directly — skips sending the image for vision processing.inspect_region(path, x, y, width, height, output_path=None)— crops a rectangular region out of an existing screenshot for close-up pixel inspection, without shelling out tomagick/identify. Returns the cropped file's absolute path as text, followed by the cropped image.mouse_move(x, y, space="physical")— move the pointer to an absolute screen position.space="logical"acceptsget_windows/move_window-style coordinates directly, converting via the display scale instead of requiring the caller to do it by hand.mouse_click(button="left", x=None, y=None, space="physical", expected_window_class=None, double=False)— click a mouse button (left,right,middle,side,extra,forward,back,task). Passx/y(and optionallyspace, same meaning asmouse_move's) to move the pointer there first and click in one call — required together, and removes the MCP round trip a separatemouse_move+mouse_clickpair leaves open for the user's own live mouse movement to land in; omit both to click wherever the pointer already is. Ifexpected_window_classis given, verifies the focused window's class (after any move, immediately before clicking) and raisesToolErroron a mismatch instead of clicking a possibly stale target (KDE backend only). Passdouble=Trueto double-click (two clicks within this one call, separated by a short server-side delay) — two separatemouse_clickcalls do not reliably register as a double-click, since the round trip between them is slower than the desktop's double-click timing threshold.key_press(keys)— press a key or+-joined combination (e.g."ctrl+shift+t").type_text(text, expected_window_class=None)— type a literal string. Text over 100 characters is pasted via the clipboard instead of typed — a single atomic paste, immune to the partial-type corruption a killed-on-timeoutydotool typecan leave behind, but it overwrites the current clipboard contents. Text at or under 100 characters is still typed viaydotoolwith no clipboard side effect; if that call times out, the error explicitly warns that partial text may already be in the focused window rather than failing silently. Ifexpected_window_classis given, verifies the focused window's class both before and after typing or pasting, raisingToolErroron a mismatch — the post-check catches focus drift (e.g. the user alt-tabbing) mid-action (KDE backend only).get_windows()— list visible windows with id, title, class, pid, and position/size. KDE backend only (wlrctlhas no window-listing command). Note: position/size are in KWin's logical (HiDPI-scaled) pixels, which can differ from the physical pixels used byscreenshot/mouse tools.get_active_window()— metadata for the currently focused window, same fields asget_windows. KDE backend only. Use beforetype_text/key_pressto confirm the window you think is focused actually is, instead of trusting a staleget_windows/focus_windowresult.focus_window(window)— activate (focus and raise) a window by id (KDE) or title substring (either backend). Use this beforetype_text/key_pressto reliably target a specific window — see the Tip above.wait_for_window(title=None, window_class=None, timeout=10.0)— poll for a window matching a title substring and/or class substring, returning its metadata as soon as it appears instead of raising after a fixed sleep. Use this afterlaunch_appinstead of a manualget_windowspolling loop. KDE backend only.close_window(window)— close a window by id or title substring. KDE backend only (wlrctlhas no close action). Prefer this over a Bashkill <pid>, which needs a fresh permission grant for every never-before-seen pid.move_window(window, x, y)/resize_window(window, width, height)— move or resize a window by id or title substring, in KWin's logical pixels (same space asget_windows). KDE backend only. Goes through KWin's own scripting interface, so it works even where a launched application's own--window-position/--window-sizeflags are silently ignored by Wayland. Waits briefly before returning so a screenshot taken immediately after doesn't catch the window still animating into place.launch_app(command, args=None)— launch a desktop application via a directsubprocess.Popeninside the server, detached and not waited on. Prefer this over a Bash command to launch anything: a never-before-launched binary always needs a fresh Bash permission grant even as a literal command, while this tool only needs allowlisting once regardless of what's launched afterward. Position the new window withmove_window/resize_windowonce it appears, rather than a launch-time position flag.clipboard_set(text)/clipboard_get()— set or read the Wayland clipboard viawl-copy/wl-paste. Preferpaste_text(below) over calling this pluskey_press("ctrl+v")separately unless you need the clipboard set without pasting immediately.paste_text(text)—clipboard_setfollowed bykey_press("ctrl+v")in one server-side call — the same mechanismtype_textnow falls back to automatically above 100 characters, without needing two separate tool calls. Focus the target field first, same astype_text/key_press.find_text(path, query, case_sensitive=False, window=None)— locate text in a screenshot via local OCR (tesseract), returning each matching line's text, bounding box, and center point in the same physical-pixel spacemouse_move/mouse_clickuse. Use this to click a specific labeled button, link, or menu item without a manual screenshot ->inspect_region-> eyeball-the-pixel loop. Not infallible — treat a single high-confidence match as safe to click directly, and fall back to a visual check on multiple matches or low confidence. Passwindow(a window id fromget_windows, or a title substring) to scope OCR to just that window's region — the screenshot is cropped to the window's bounds before OCR runs, and returned coordinates are translated back to absolute screen space. Use this whenever the query text could plausibly appear elsewhere on the desktop too (most commonly the calling agent's own visible terminal), since without scoping, OCR can merge real text from the target window with unrelated text from a different window into one line, silently shifting the match off target rather than cleanly refusing. KDE backend only.click_text(query, path=None, case_sensitive=False, button="left", expected_window_class=None, window=None)— findsqueryvia OCR and clicks it in one server-side call: captures a fresh screenshot ifpathis omitted, and only acts when there is exactly one match. No image is ever sent back for review on this path. Refuses (ToolError) on zero or multiple matches instead of guessing — fall back tofind_textplus a visual check in that case. A single match acts regardless of its OCR confidence score (still reported in the result message): confidence has been shown live to be an unreliable proxy for correctness in either direction, so it's informational rather than a second gate on top of the ambiguity check.windowhas the same scoping semantics asfind_text's parameter.read_screen_text(path=None, window=None)— likefind_textbut with no query filter: returns every detected line of text and its position, sorted top-to-bottom then left-to-right. Captures a fresh screenshot ifpathis omitted. Use this to read a whole board, grid, or list in one call (e.g. every revealed number in a puzzle game, or every row of a file list) instead of severalfind_textcalls or eyeballinginspect_regioncrops one at a time.windowscopes the read to one window's region, same semantics asfind_text— but note this is not automatically a strict improvement: cropping can occasionally cause tesseract to miss stylized/hyperlink text it would find with full-page context, so prefer scoping when disambiguating a click target and prefer a full, unscoped read when bulk-reading content matters more than excluding unrelated text.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for Hyprland desktop automation that allows AI assistants to see the screen, control mouse and keyboard, and manage windows using native Wayland tools. It integrates OCR for text-based interaction and supports complex multi-monitor setups with pixel-accurate coordinate mapping.Last updated275MIT
- Alicense-qualityDmaintenanceA desktop automation MCP server that enables AI agents to interact with Linux environments through screenshots, window inspection, and input simulation. It provides tools for mouse control, keyboard input, and screen capture using xdotool and XDG Desktop Portals.Last updatedMIT
- Alicense-qualityAmaintenanceControls a real Linux desktop from any MCP host. Reads accessibility trees, takes screenshots, and drives clicks, scrolls, and keystrokes across GNOME, KDE/KWin, Hyprland, i3, and COSMIC.Last updated254331MIT
- Flicense-qualityBmaintenanceAn MCP server that gives a model eyes and hands on a Linux Wayland desktop, enabling screenshot capture, mouse/keyboard control, OCR, and icon detection via OmniParser.Last updated3
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SpiritualMachines/dual-wield-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server