Computer Use MCP 标志

Computer Use MCP

社区
minghinmatthewlam

Open, agent-agnostic MCP server exposing macOS computer use to any MCP client (Claude Code, Cursor, Codex, …). Background-safe, works on every app.

发布者minghinmatthewlam
代码仓库computer-use-mcp
语言Swift
复刻数
4
星标数
49
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    Computer Use MCP 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 49 个星标和 4 个复刻。

computer-use-mcp

CI version platform Swift license MCP

The open, agent-agnostic version of macOS computer use. A single signed Swift binary that exposes your Mac as a standard MCP server. Point Claude Code, Cursor, Codex CLI, Gemini CLI, or your own agent at it and the agent can see and operate the apps on your Mac — in the background, without hijacking your cursor or stealing focus.

Status: pre-1.0, used in production by the authors. macOS only. Runs while the Mac is unlocked (the system is kept from idle-sleeping during active sessions; if the screen locks, mutating tools pause with a recoverable error until you unlock).

Table of contents

Why it's different

  • Universal — works on every app. Accessibility-first for precision, with an automatic pixel-coordinate fallback (z-order hit-testing) for apps with poor or absent accessibility trees. The agent's own vision provides the grounding — no bundled ML model. Web apps included: Chromium/Electron web-content accessibility is enabled on demand, and structural wrapper nodes are collapsed so deeply nested page content actually reaches the agent.
  • Background-safe. A layered input ladder (AX action → per-window event → per-PID event, with explicit global fallback for clicks) delivers actions to the target app without moving the real cursor or changing focus by default. You keep working while the agent works.
  • Agent-agnostic. Standard MCP over stdio. Any compliant client connects with one line of config — no lock-in.
  • Observable. A smooth self-drawn agent cursor (separate from your real pointer) glides to each target so you can watch what the agent does.
  • Verified outcomes. Every mutating action re-reads the target and reports whether the effect actually happened — not just whether the call returned without throwing. See What's new this cycle.
  • Multi-session safe. Sessions are thin shims over one shared engine daemon (spawned on demand, retired on version changes, self-reaping when idle), so any number of concurrent agents go through a single process that owns capture, accessibility, input, and the cursor — and per-app leases keep two agents from interleaving actions inside the same app.
  • Reliable. Every action returns fresh app state (screenshot + accessibility tree). Element IDs retain exact live AX handles and fail stale if the app recreates or detaches them; destructive actions pass a confirmation policy.
  • One native binary. Zero runtime dependencies, frictionless install.

Install

macOS 14 or newer. On first run the binary asks for Accessibility and Screen Recording permission (Input Monitoring is not required).

From GitHub Releases (recommended once published)

Heads-up: the first tagged release may not be published yet. If the Releases page is empty, use build from source below. These steps are correct as soon as the first release is cut.

Download the notarized .app (or standalone binary) from the latest release, move it to /Applications (or anywhere on your PATH), and confirm it runs:

bash
computer-use-mcp version
computer-use-mcp doctor          # check Accessibility / Screen Recording grants

A notarized, stably-signed build matters here: macOS ties Accessibility and Screen Recording grants to a signing identity, so a notarized bundle keeps its permissions across upgrades (see Distribution notes).

Build from source

bash
git clone https://github.com/minghinmatthewlam/computer-use-mcp.git
cd computer-use-mcp
swift build -c release
.build/release/computer-use-mcp version

The binary is .build/release/computer-use-mcp. Put it on your PATH, or point your MCP client's command at the absolute path. To build the stable-identity .app wrapper locally:

bash
python3 scripts/build_app_bundle.py            # local .app wrapper
python3 scripts/deploy_app_bundle.py           # release build + install to ~/Applications

Homebrew (coming)

A Homebrew formula is drafted under packaging/homebrew/computer-use-mcp.rb as groundwork. It is not tapped or published yet; once the first release ships with a stable tarball, the intended flow is:

bash
# Not live yet — planned:
brew install minghinmatthewlam/tap/computer-use-mcp

Quickstart per client

The server speaks MCP over stdio; every client launches it the same way — computer-use-mcp serve. Pick your client below.

bash
claude mcp add computer-use -- computer-use-mcp serve

That registers the server for the current project. Use -s user to register it globally for all projects. Verify with claude mcp list.

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

json
{
  "mcpServers": {
    "computer-use": { "command": "computer-use-mcp", "args": ["serve"] }
  }
}

Add to ~/.codex/config.toml:

toml
[mcp_servers.computer-use]
command = "computer-use-mcp"
args = ["serve"]

Add to ~/.gemini/settings.json:

json
{
  "mcpServers": {
    "computer-use": { "command": "computer-use-mcp", "args": ["serve"] }
  }
}

Any MCP-compliant client that launches a stdio server works. The command is computer-use-mcp with a single argument serve:

json
{
  "mcpServers": {
    "computer-use": { "command": "computer-use-mcp", "args": ["serve"] }
  }
}

If the binary is not on your PATH, use its absolute path as command.

How it works

Each MCP client spawns serve, a thin stdio shim; tool calls are forwarded to a shared engine daemon (one per user, spawned on demand over a unix socket) that owns accessibility, screen capture, input delivery, and the agent cursor. One engine process means concurrent agent sessions cannot collide on shared system services, and short per-app leases keep two sessions from interleaving actions inside the same app. Tool calls fail fast with structured DAEMON_UNAVAILABLE metadata if the daemon cannot be reached; they never fall back in-process. The daemon also owns privacy-filtered runtime metrics: events are buffered and flushed in bounded batches to rotating JSONL plus an aggregate summary.

Click interactions first resolve to an accessibility element and a screen point, then descend a delivery ladder, stopping at the first tier that works:

  1. Accessibility action (AXPress, etc.) — precise, background, no event posted.
  2. Per-window event — a windowNumber-routed event delivered to the target process, so the action lands without activating the app or moving the cursor.
  3. Per-pid event — delivered to the process when no window id resolves.
  4. Global cursor — opt-in last resort only (allow_global_cursor: true); it moves the real pointer, then restores it.

State is re-perceived after every action and returned to the caller, so the agent always acts on current ground truth. Element ids carry a snapshot generation, so reusing a stale id fails loudly instead of mis-clicking.

For the precise production contract across observation, dispatch, coordinate spaces, foreground/background guarantees, TCC requirements, stale snapshots, and failure recovery, see Modality Contract. For strict background focus/cursor behavior, see Background Control Contract.

Architecture

A longer walkthrough of the process model, dispatch ladder, outcomes, and source map lives in docs/architecture-overview.html.

Tools

Perceive get_app_state (with scope_element_id/max_elements for huge windows, skeleton: true for a shallow overview of a large tree, and ocr: true for apps that draw their own UI) · list_apps · list_windows

Act click · type_text · press_key · scroll · drag · set_value · select_text · perform_secondary_action

System open_app · open_url · manage_window · read_clipboard · write_clipboard · health_report

Element actions use ids from get_app_state; coordinate-capable tools also accept raw screenshot coordinates. The intentionally small surface keeps perception, delivery, and verification in one inspectable path.

Action results return a reduced-resolution screenshot to keep the agent loop fast, and skip resending the element tree when the action changed nothing (existing ids stay valid). When the UI did change, results carry a compact diff of what changed, appeared, or disappeared — elements that survive a change keep their ids, so everything the agent holds stays valid. Pass include_screenshot: false for tree-only results, include_state: false for a bare confirmation (fastest), and call get_app_state whenever full-resolution pixels are needed.

What's new this cycle

Three capabilities landed on main this cycle; the README documents them so it stays truthful about current behavior.

Verified action outcomes

Mutating tools no longer report "success = the call didn't throw." Each action now does a read → act → re-read of the target and classifies whether the intended effect actually occurred, surfaced in a computer-use-mcp/outcome block in the result's _meta. The classification is one of four values:

ClassificationMeaning
successThe effect was observed, or the target was already in the requested state (an idempotent no-op is a success).
unsupportedThe target cannot perform this action (disabled control, no settable value). Retrying won't help.
effect_not_verifiedDispatched without error, but no confirming change was observed — a failure_domain distinguishes a likely-dropped background event (transport, retry at a higher tier may help) from a control that lied about acting (verification).
verifier_ambiguousThe action may well have worked, but the verifier couldn't read enough state to prove it (secure field, unobservable menu item). Never a false failure.

isError is unchanged — a thrown exception still sets it, and everything else stays false — so agents that ignore _meta behave exactly as before. Agents that read the outcome block get an honest verdict plus a plain-language sentence in the text body for non-success results. The full design, including the per-tool false-success trap matrix, is in docs/outcome-contract.md.

Delivery fallback telemetry

The input ladder silently falls from tier to tier; results previously reported only the tier that finally landed the event. A computer-use-mcp/delivery block in _meta now carries delivery_tier, a fallback_reasons array explaining why each higher tier was skipped (e.g. axActionUnsupported, windowNumberUnresolved, eventBridgeFailed, globalCursorRequested), and ui_changed. This is pure telemetry — it does not change which tier is attempted — and it lets an agent reason about whether escalating the delivery tier is worth trying.

Skeleton overview + dense-collection viewport windowing on get_app_state

Two ways to keep large windows from blowing up the tree:

  • skeleton: true returns a shallow overview: the outline recurses a few levels, then a deeper container is emitted with a children_count annotation instead of its subtree, and stays a drill target. Pass that container's id as scope_element_id for a full scoped re-query. Skeleton is the overview, scope_element_id is the drill-in, and max_elements still bounds either.
  • Dense-collection viewport windowing (automatic): virtualized collections (lists, tables, outlines, grids) with many children are windowed to the on-screen slice — preferring the app's own visible-rows attributes, else a viewport-frame intersection — instead of a blind first-N prefix that ignores scroll position. Off-window items are summarised as a count on the container's line (never silently dropped), and materialised rows retain live-handle identity while the app keeps the same AX objects. Use scope_element_id to inspect a specific retained container with the full element budget.

Requirements

  • macOS 14+
  • Permissions granted on first run: Accessibility and Screen Recording (Input Monitoring is not required). Run computer-use-mcp health_report to inspect current identity/permission state, or computer-use-mcp doctor --prompt when you intentionally want macOS prompts.

Safety

The server gates risky actions itself (it does not trust the calling agent). Destructive/irreversible button clicks (Delete, Erase, Reset, …), typing into secure password fields, and actions against apps on a confirmation list return a recoverable Confirmation required: … error until the caller retries with "confirm": true.

Browser pages get their own gate: before acting in a known browser the server reads the current URL from the accessibility tree and applies the URL policy — url_deny patterns block the action outright (confirm does not override), url_confirm patterns (plus built-in payment-page defaults) require confirm per action. The server also yields to the human: when real hardware input was seen in the last second and the target app is the one the user is working in (or the action uses the global cursor), the call returns a recoverable error instead of interleaving with the user (see interference_idle_seconds).

See SECURITY.md for the TCC permission model, threat model, and private disclosure process.

Configuration

Every option is settable as an environment variable (COMPUTER_USE_MCP_<KEY>) or a key in ~/.config/computer-use-mcp.json (env wins):

Key (file) / variableEffect
cursor / COMPUTER_USE_MCP_CURSOR=0Hide the animated agent-cursor overlay (on by default; set 0 for headless/CI).
cursor_idle_fadeSeconds of quiet before the agent cursor fades (default 12).
cursor_topmost / COMPUTER_USE_MCP_CURSOR_TOPMOST=1Keep the agent cursor unconditionally above every window (escape hatch from target-relative z-order).
status_chip / COMPUTER_USE_MCP_STATUS_CHIP=0Hide the "Agent working" pill shown on every display during activity (on by default).
no_safety / COMPUTER_USE_MCP_NO_SAFETY=1Disable the safety policy entirely.
confirm_appsApps (name or bundle id) where every action needs confirm.
destructiveExtra destructive label substrings to gate.
url_denyURL substrings where browser actions are blocked outright (confirm does not override).
url_confirmExtra URL substrings where browser actions need confirm (defaults cover payment pages).
ax_timeoutPer-call accessibility timeout in seconds (default 2).
ax_element_timeoutPer-element AX messaging timeout during tree traversal (default 0.25s).
viewport_probe_timeoutTighter AX timeout for dense-collection viewport frame probes (default 0.05s).
no_app_leaseDisable per-app session arbitration.
app_lease_secondsHow long an app stays leased to a session after its last action (default 10).
no_interference_yieldDisable yielding to real user input (yield is on by default).
interference_idle_secondsHardware quiet time required before acting in the app the user is working in, or via the global cursor (default 1; 0 disables).
no_sleep_assertionDo not hold a prevent-idle-sleep assertion while tool calls are flowing.
no_telemetry / COMPUTER_USE_MCP_NO_TELEMETRY=1Disable funnel/telemetry recording.
show_meta / COMPUTER_USE_MCP_SHOW_META=1Dump _meta (focus / delivery / outcome) on call harness output.
log / COMPUTER_USE_MCP_LOG=1Per-tool-call stderr log lines (name, ok/error, duration).
max_actions_per_secOptional global throttle on tool calls (off by default).
COMPUTER_USE_MCP_SKYLIGHT=1Env-only: enable the opt-in SkyLight SLEventPostToPid input rung (not a config-file key).

Comparison

How computer-use-mcp relates to the closest projects. This is a factual snapshot; cells marked "Not public" mean the project is closed-source and the behavior isn't documented, not that it's absent.

computer-use-mcpOpenAI Codex computer useactuallyepic/background-computer-uselahfir/agent-desktop
ProtocolMCP over stdio (agent-agnostic)Closed, Codex-onlyHTTP loopback (no auth)Rust CLI
Background inputAX action → per-window → per-pid event ladder, opt-in global cursorNot publicWeaker; only physical path is an experimental WindowServer routeGlobal HID tap (raises windows)
Capture APIScreenCaptureKitNot publicCGWindowListCreateImage (deprecated)screencapture shell-out
Verified outcomesYes (classification enum in _meta)Not publicYesYes
Visible agent cursorYes (self-drawn overlay)Not publicNoNo
Multi-sessionYes (shared daemon + per-app leases)N/A (hosted)NoNo
Safety gatesYes (destructive / URL / interference / screen-lock)Provider-sideMinimal (no auth)Not documented
LicenseMIT (open source)ClosedOpen sourceOpen source

The two independent open-source efforts above both converged on verified outcomes ("don't trust an AX success — re-read and confirm the effect"), which is the model computer-use-mcp adopts in docs/outcome-contract.md. computer-use-mcp's distinguishing bets are the standard MCP surface, the shared-daemon multi-session model, and the visible agent cursor.

Distribution notes

The binary needs Accessibility and Screen Recording permission, and macOS ties those grants to the host process that spawns the server (your terminal or agent app). A rebuilt binary keeps its grants; a different host needs its own. Use computer-use-mcp health_report --json to record the current executable, bundle id (if any), parent process, permission state, and daemon socket/secret paths without revealing daemon secrets. Add --probe-capture when you intentionally want a bounded ScreenCaptureKit/replayd responsiveness probe. For redistribution, codesign with a Developer ID and notarize (codesign --sign "Developer ID Application: ..." && xcrun notarytool submit ...) so TCC grants attach to a stable identity. See Permissions and app identity for the first productionization checklist.

Known limitations

  • Background delivery uses macOS per-process event posting, which is app-dependent: a few apps that require real keyboard focus (e.g. some pro audio apps, secure input fields) may ignore background events. For clicks, use allow_global_cursor: true as an explicit fallback.
  • Menu key-equivalents (e.g. cmd+a) are reliable when the app is the key window; some apps ignore them when targeted purely in the background.
  • macOS only (the engine is built on Accessibility, ScreenCaptureKit, and CoreGraphics). The protocol/tool layer is OS-agnostic.

Development

bash
swift build
swift test
.build/debug/computer-use-mcp serve                  # run the stdio MCP server
.build/debug/computer-use-mcp call get_app_state '{"app":"Calculator"}'   # drive one tool
.build/debug/computer-use-mcp health_report --json   # non-mutating diagnostics
.build/debug/computer-use-mcp health_report --probe-capture   # bounded capture-service probe
.build/debug/computer-use-mcp doctor                 # check permissions
python3 scripts/preflight.py                         # CI-safe release preflight
python3 scripts/build_app_bundle.py                  # local .app wrapper build
python3 scripts/deploy_app_bundle.py                 # release build + bundle + install to ~/Applications + daemon handover
python3 scripts/deploy_app_bundle.py --check         # exit 1 if the installed bundle is older than source/build
python3 scripts/preflight.py --use-app-bundle        # non-live checks through the .app executable
python3 scripts/e2e_demo.py                          # safe structured smoke artifact; no GUI mutation

Default CI covers the non-mutating path: package build, pure unit tests, and CLI version/help/health_report --json smoke checks. Live app-control checks are local-only because they require a logged-in macOS desktop plus Accessibility/Screen Recording permission and can operate real apps. See Testing and Preflight for the testing tiers, local command loop, and release preflight expectations. The architecture-level behavior target for these tiers is captured in Modality Contract.

Benchmark and smoke tiers

Use deterministic checks for hosted CI and live GUI checks only on a local Mac or a future self-hosted macOS runner with explicit permissions.

TierWhat it provesSafe for hosted CI?Command
Deterministic unit testsPure Swift behavior such as parsing, safety policy, coordinates, and tree shaping.Yesswift test
Structured dry-run smokeThe benchmark entrypoint, schema, git/macOS metadata collection, and opt-in gate. It does not start the MCP server or open apps.Yespython3 scripts/e2e_demo.py
Release preflightBuild, unit tests, CLI smoke, health report, and dry-run background eval in one JSON report.Yespython3 scripts/preflight.py
Local app-bundle runtimeProduces an ad-hoc signed .app wrapper and runs non-live CLI/dry-run checks through Contents/MacOS/computer-use-mcp.Nopython3 scripts/preflight.py --use-app-bundle
Deterministic background evalThe fixture-app path mutates a stable AX text field while preserving the current frontmost app.Nopython3 scripts/live_background_eval.py --live
Real-app compatibility smokeLightweight live matrix for Finder read-only discovery and TextEdit background stdio behavior.Nopython3 scripts/real_app_smoke.py --live
Live GUI smokeThe real MCP stdio path against TextEdit in the background, including perceive, type, select, and focus-stability checks. Setup launches TextEdit without activation and fails if the current frontmost app changes.Nopython3 scripts/e2e_demo.py --live

Live GUI mutation is opt-in. Use --live for local manual runs. Do not add the live tier to hosted CI — it depends on an unlocked macOS desktop, TCC permissions, Finder/TextEdit behavior, and user-visible app state. Before running the live tier, build the binary and make sure the spawning terminal has Accessibility and Screen Recording permission:

bash
swift build
.build/debug/computer-use-mcp doctor --prompt
python3 scripts/e2e_demo.py --live

Contributing

Contributions welcome. See CONTRIBUTING.md for build/test conventions and PR expectations, SECURITY.md for the security model and private disclosure process, and CHANGELOG.md for release history.

License

MIT — see LICENSE.

安装

TypingMind
{
  "mcpServers": {
    "minghinmatthewlam-computer-use-mcp": {
      "command": ".build/debug/computer-use-mcp",
      "args": [
        "serve"
      ]
    }
  }
}

将 Computer Use MCP MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Computer Use MCP 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 Computer Use MCP 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Computer Use MCP MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "minghinmatthewlam-computer-use-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Computer Use MCP MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Computer Use MCP MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Computer Use MCP 帮我完成这项任务吗?
Computer Use MCP
当然,我看过了。
以下是我使用 Computer Use MCP 得到的结果。

常见问题

Computer Use MCP MCP 服务器有什么用途?

Computer Use MCP 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Computer Use MCP MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 Computer Use MCP。

为什么在 TypingMind 中使用 Computer Use MCP MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 Computer Use MCP 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Computer Use MCP MCP 连接到 TypingMind?

Computer Use MCP 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Computer Use MCP MCP 在 TypingMind 中提供哪些工具?

Computer Use MCP 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Computer Use MCP MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 Computer Use MCP 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇