Linux 桌面自动化控制
computer-use-linux
通过 computer-use-linux MCP 服务器实现 Linux 桌面观察与控制:无障碍树、截图、窗口定位以及输入合成(点击、输入、滚动)。可与任何 MCP 宿主配合使用。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 221
- Forks
- 22
01 前言 Front Matter
- name
- computer-use-linux
- author
- agent-sh
- license
- MIT
- platforms
- [ "linux" ]
- description
- Linux desktop observation and control via the computer-use-linux MCP server: accessibility trees, screenshots, window targeting, and input synthesis (click, type, scroll). Works with any MCP host.
02 资源文件 2
- 参考文档references/hermes-setup.md1.1 KB
- 参考文档references/pi-setup.md1.2 KB
03 SKILL.md 正文
computer-use-linux
Use computer-use-linux when an agent needs to observe or operate a local Linux desktop through MCP: inspect the accessibility tree, list/focus windows, take screenshots, click, scroll, type, press keys, or invoke AT-SPI actions.
When to Use
Use this skill when:
- The user wants the agent to control a Linux GUI app.
- You need desktop state from AT-SPI, screenshots, or compositor window metadata.
- You are configuring the
computer-use-linuxMCP server for your agent. - A desktop action needs target-aware input instead of blind shell commands.
Do not use this for remote browsers, websites, or headless automation when a browser-specific tool is available. Do not assume desktop actions are safe just because the MCP connection works.
Install
Preferred install:
npm install -g @agent-sh/computer-use-linux
computer-use-linux doctor | jq .readiness
Rust users can install from crates.io:
cargo install computer-use-linux
computer-use-linux doctor | jq .readiness
If doctor reports missing input or accessibility support, run:
computer-use-linux setup
systemctl --user enable --now ydotoold
computer-use-linux setup-window-targeting
computer-use-linux doctor | jq .readiness
On GNOME Wayland, log out and back in after setup-window-targeting if the GNOME Shell extension was newly installed.
Configure Your Agent
The computer-use-linux binary is an MCP server. Configure it as a stdio MCP server in your agent of choice:
{
"command": "computer-use-linux",
"args": ["mcp"]
}
If the binary is not on PATH, use the absolute path (typically ~/.local/bin/computer-use-linux or the npm global bin directory).
Host-specific guides
Procedure
- Start every desktop-control session with
doctor. - If
can_build_accessibility_treeis false, runsetupand restart the target app. - If
can_query_windowsis false on GNOME Wayland, runsetup-window-targetingand ask the user to log out and back in if setup says the shell extension needs a reload. - Before targeted input, call
list_windowsorfocused_windowand verify the intended window by title, app id, pid, or wm class. - Prefer semantic targeting from
get_app_state: use element indices or role/name/text/states selectors. - Use coordinates only when the UI surface has no useful accessibility tree.
- For text input, prefer
type_textwith a target selector (window_id,pid,app_id,wm_class,title,tty,terminal_pid,terminal_command, orterminal_cwd) rather than relying on current focus. - After mutating actions, re-check state with
get_app_state,focused_window, or an app-specific readback.
Pitfalls
- Already-running GTK, Qt, and Electron apps may need a restart after AT-SPI is enabled.
- GNOME may show a portal prompt on the first screenshot or
get_app_statecall with screenshots enabled. - Desktop input is stateful. Avoid concurrent tool calls against this MCP server.
click,drag,press_key,type_text,perform_action, andset_valuecan change real application state.ydotooldshould run as a per-user service with its socket under/run/user/$UID, not as a system-wide service.- On COSMIC, the standard npm, Cargo, and install-script paths install the
computer-use-linux-cosmichelper automatically. Manual binary installs must copy both binaries.
Verification
Run:
computer-use-linux doctor | jq .readiness
Ready output should have:
can_register_mcp_tools: truecan_build_accessibility_tree: truecan_query_windows: truecan_send_development_input: trueblockers: []
Then test with your agent by calling the doctor tool or asking the agent to list desktop windows.
04 同仓库更多 Skills
claude-design
Produce thoughtful, high-fidelity design artifacts in HTML — landing pages, slide decks, interactive prototypes, animated videos, posters, wireframes, and visual explorations. Use whenever the user asks to design, mock up, prototype, visualize, storyboard, or explore UI options — including phrases like "make a deck", "design a landing page", "prototype this flow", "animate this concept", "build a pitch deck", "create a poster", "visualize this idea", or "design something for a brand". Enforces fact verification (WebSearch before assuming a product exists or its version), the Core Asset Protocol for branded work (logo, product shots, and UI screenshots are first-class, not just colors and fonts), a Design Direction Advisor fallback that offers 3 differentiated directions from 10 design philosophies when the brief is too vague, commits to a visual system up front, presents multiple variations, and avoids AI-design tropes (aggressive gradients, emoji bullets, generic templates).
GitHub PR 评论处理
gh-address-comments
使用 gh CLI 处理当前分支上开放的 GitHub PR 的审查/问题评论;先验证 gh auth,若未登录则提示用户进行认证。
ADHD 友好输出适配
i-have-adhd
为 ADHD 读者调整输出:先给出下一步行动,多步骤工作进行编号,跨轮次重申当前状态,抑制枝节话题,给出具体的时间估计,让成果清晰可见。使用 /i-have-adhd 调用;持续生效,直到用户说 "stop adhd mode"。