computer-use-mcp
minghinmatthewlam/computer-use-mcp
- Type
- Repo
- Scanned
- Nov 17, 2026
- Version
- 82dd8093e448
- Files read
- 151
This MCP server lets an AI agent see and operate macOS apps in the background by reading accessibility trees, capturing window screenshots, accessing the clipboard, launching apps or URLs, and sending clicks and keystrokes. Its biggest risks are that a relative path lookup when spawning its helper daemon can run an untrusted computer-use-mcp binary from the current project folder, and its safety confirmations rely on an agent-supplied flag rather than a real prompt to the user.
What it can reach
- System
- Reads UI trees and takes screenshots of open macOS windows, sends mouse and keyboard input to running apps, manages windows, launches applications, reads and overwrites the system clipboard, and prevents idle system sleep during active sessions.
- Browser
- Reads page text, URLs, and screenshots from open web browsers, clicks and types inside logged-in browser tabs, and opens web or custom-scheme URLs in default handlers.
- Files
- Opens existing local files in their default macOS apps via open_url, reads ~/.config/computer-use-mcp.json, and writes local daemon sockets, auth secrets, logs, metrics, and CLI screenshot files under ~/Library/Caches/computer-use-mcp and the user's temp folder.
- Shell commands
- Does not expose a direct shell tool, but can open terminal apps such as Terminal.app via open_app and type arbitrary shell commands into them.
- Secrets
- Can read sensitive text visible in open windows or on the clipboard, and can type into password fields when confirm is set to true.
Findings
-
HighDaemon and overlay spawning resolves argv[0] relative to the current working directory
Sources/computer-use-mcp/Daemon/DaemonClient.swift:235
The README instructs users to put computer-use-mcp on their PATH and configure MCP clients with command "computer-use-mcp" and args ["serve"]. When launched via PATH lookup, CommandLine.arguments[0] is the bare string "computer-use-mcp", and URL(fileURLWithPath: CommandLine.arguments[0]) in both DaemonClient.spawnDaemon() and AgentCursor.spawnAndConnect() (Sources/computer-use-mcp/Overlay/AgentCursor.swift) resolves that relative name against the server's current working directory instead of the installed binary's real path. If a user opens an AI coding agent inside a cloned repository that contains an executable named computer-use-mcp, even a harmless read-only tool call such as list_apps or health_report will execute the repository's ./computer-use-mcp binary in the background, inheriting the host app's Accessibility and Screen Recording permissions.
Fix: Use Bundle.main.executableURL (with _NSGetExecutablePath as fallback), as HealthReport.swift already does, to locate the running executable in both DaemonClient.spawnDaemon() and AgentCursor.spawnAndConnect(), and refuse to spawn if an absolute executable path cannot be resolved.
-
LowBrowser URL policy checks only the front window's first web area and downgrades url_deny when URLs are unreadable
Sources/computer-use-mcp/Core/URLPolicy.swift:90
The server's browser gate (for built-in payment-page confirmation and configured url_deny hard blocks) calls currentBrowserURL(app:), which always inspects targetWindow(for: app, title: nil) — the browser's frontmost window — and returns the first AXWebArea within depth 12. Because SnapshotStore keeps snapshots per window, a prompt-injected agent can keep or open a benign page in the browser's front window while clicking or typing in a background window (or second split-view web area) that is on a url_deny or payment page. In addition, if currentBrowserURL returns nil (for example before Chromium web accessibility is initialized or past depth 12), urlPolicyDecision returns .requireConfirm even when denyPatterns are configured, allowing confirm:true to bypass url_deny, and read-only get_app_state is not checked by URLPolicy at all.
Fix: Check the URL of the exact window targeted by element_id or window_title and the AXWebArea ancestor of the targeted element, return .deny rather than .requireConfirm when denyPatterns are non-empty and the URL cannot be read, and enforce url_deny on get_app_state.
-
LowSafety confirmation gates accept an agent-supplied confirm flag with no user prompt
Sources/computer-use-mcp/Core/SafetyPolicy.swift:46
Although the README and SECURITY.md state that the server gates risky actions itself because it does not trust the calling agent, SafetyPolicy.confirmed(_:) only checks whether the tool call arguments include "confirm": true, and unconfirmed refusals instruct the caller to re-run with "confirm": true. Because there is no OS-level user confirmation dialog or out-of-band approval step, a prompt-injected agent can set "confirm": true itself on the first call (or immediately retry with it) to click Delete/Erase buttons, type into password fields, launch Terminal.app, open local files or custom URL schemes, overwrite the clipboard, or act in confirm_apps without asking the user.
Fix: Require an out-of-band native macOS confirmation dialog from the helper/daemon process (or MCP client elicitation) before allowing actions flagged by SafetyPolicy, and clarify in the documentation that model-supplied tool parameters alone cannot stop a prompt-injected agent.
-
LowDestructive click check inspects only the hit-tested leaf element instead of the actuated ancestor button
Sources/computer-use-mcp/Tools/ClickTool.swift:151
When checking whether a click targets a destructive button (such as Delete, Erase, or Reset), clickImpl passes clickTargetLabel(target) — which inspects only target.element — to SafetyPolicy.checkClick, but leftClick and rightClick then walk up to 5 parent hops via selfOrAncestor(of:supporting:) to find and press an enclosing AXButton or menu owner. Even if an MCP host blocks calls that set confirm:true, an agent can target an unlabeled child element (such as an AXImage icon inside a Delete button) by element_id or screenshot coordinates so clickTargetLabel returns nil while leftClick still triggers AXPress on the destructive parent button.
Fix: Evaluate SafetyPolicy.checkClick against clickableLabel on the resolved pressable/menu element and every ancestor between target.element and the actuated control.
-
LowAccessibility tree builder does not redact values on AXSecureTextField elements
Sources/computer-use-mcp/Core/TreeBuilder.swift:560
While ActionOutcome.swift and TextTools.swift explicitly skip reading kAXValueAttribute when kAXSubroleAttribute equals kAXSecureTextFieldSubrole so secure fields are never echoed, TreeBuilder.swift reads kAXValueAttribute and kAXSelectedTextAttribute unconditionally on every get_app_state call and post-action state capture. Native AppKit secure fields return bullet characters (still revealing exact password length), and custom or bridged accessibility controls that rely on the AXSecureTextField role or subrole without masking AXValue or AXSelectedText will have their contents exposed in the returned tree text.
Fix: Check for role == "AXSecureTextField" or subrole == (kAXSecureTextFieldSubrole as String) in axTreeAccessors() and omit kAXValueAttribute and kAXSelectedTextAttribute for secure text fields.
