Skip to main content
Glama

UI-Venus MCP

A remote-first, cross-platform Computer-Use MCP server for AI agents — unified GUI automation across Windows, Linux, macOS, Android, iOS and browsers. Its primary job is not the local machine: it drives remote, awkwardly-accessed targets (SSH-only intranet hosts, no-internet boxes, locked-down sessions) with zero installs on the target side. Structured APIs first (UIA / AX / AT-SPI / UIAutomator / XCUITest / DOM), vision grounding as the fallback, with UI-Venus-2-9B (official protocol, W8A8 build verified) as the default — and pluggable — vision provider.

Remote targets are the main path: one command onboards a new Windows host (scripts/win-remote/bootstrap-remote.mjs), one env var registers any number of them (CUMCP_REMOTES). Verified on real hardware: the vision agent autonomously computed 7×3=21 on a remote, intranet, SSH-only Windows 11 box — twice. Full playbook: docs/remote-targets.md.

中文文档:docs/README.zh-CN.md

                    ZCode / Claude Code / Codex / OpenAI Agents / your agent
                                        │
                              ┌─────────┴─────────┐
                              │   Text or VLM     │   (any model, any size)
                              └─────────┬─────────┘
                                        │ MCP (stdio / Streamable HTTP)
                                        ▼
                     ┌──────────────────────────────────────┐
                     │      Computer-Use MCP Server         │
                     │  Orchestrator · Fusion Locator ·     │
                     │  Verifier · Recorder · DSL · Guard   │
                     └──────────────────┬───────────────────┘
                                        │
                              Platform Router (per-device sessions)
        ┌──────────┬──────────┬────────┴───┬────────────┬───────────┐
        ▼          ▼          ▼            ▼            ▼           ▼
     Windows     Linux      macOS      Android        iOS       Browser
   UIA+SendInput AT-SPI+    AX+     UIAutomator  XCUITest/   Playwright/
   PowerShell   xdotool   SystemEvents   +adb      WDA+simctl     CDP
        └──────────┴──────────┴────────────┴────────────┴───────────┘
                                        │  vision fallback (spec §4)
                                        ▼
                        UI-Venus-2-9B (remote GPU, OpenAI-compatible)

The product definition: give any AI agent — text-only or multimodal, small or large — unified, cross-platform, structure-first, vision-fallback computer-use capabilities. Not "an AI mouse for Windows", and not "UI-Venus wrapped in a few click APIs": UI-Venus acts as the cross-platform GUI expert (visual grounding, next-action decision, visual verification), while platform adapters execute reliably through native semantics whenever they exist.

Highlights

  • 17 MCP tools — targets, state, inspect, screenshot, locate, action, step, execute_task, verify, recorder (start/stop/to_script), run_script, run_ui_test, get/cancel_task. Full contract in docs/api.md.

  • Four agent modes (spec-level): delegate (autonomous loop for text-only agents), assist / direct (your agent stays in control; MCP provides primitives), auto (structured-first with per-step vision fallback).

  • Structure-first execution: click(elementRef) becomes UIA Invoke on Windows, AXPress on macOS, AT-SPI doAction on Linux, UIAutomator tap on Android, XCUITest tap on iOS, Playwright click in browsers. Raw coordinates are the last resort — and when vision produces a point, the fusion locator snaps it back onto a structured element before acting.

  • Cross-platform coordinate system: vision-normalized [0,1000] ↔ screenshot px ↔ logical points ↔ physical pixels, with DPI/Retina/density handled and unit-tested.

  • Honesty by construction: missing permissions, offline devices, Wayland restrictions, unsigned WDA — reported as permission_required / restricted / BLOCKED, never faked as success.

  • Anti-stagnation loop guard: same-action / same-element / same-screen (perceptual hash) detection with a recovery ladder (re-observe → alternate strategy → honest failure).

  • Security: app/device/action/domain allowlists + sensitive-action detection (删除/支付/转账/install…) parking tasks in WAITING_CONFIRMATION with confirm tokens.

  • Recorder → portable DSL: recordings become YAML scripts with semantic locators (never click(432,621); sleep(2)), replayable across platforms; a UI-test runtime reports PASS / FAIL / SKIP / BLOCKED.

  • Remote GPU architecture: the 9B vision model runs on a server (OpenAI-compatible endpoint); clients only send screenshots — phones and laptops need no VRAM.

  • Remote Windows control (spec §13): drive a Windows box over SSH from macOS/Linux with nothing installed on the target — a hidden session-1 queue agent runs the inbox PowerShell bridges; screenshots SCP back, SendInput goes forward. Verified on real hardware: the vision agent autonomously computed 7×3=21 in the remote Windows calculator (scripts/win-remote/remote-agent-e2e.mjs).

Related MCP server: oswright

Quick start

# packaged (GitHub Release) — see docs/install/README.md for ZCode & clients:
npm install github:q1820926174-cpu/UI-Venus-MCP

# or from source:
git clone https://github.com/q1820926174-cpu/UI-Venus-MCP.git
cd UI-Venus-MCP
pnpm install
pnpm build

export VENUS_BASE_URL=http://<gpu-host>:8300/v1   # OpenAI-compatible
export VENUS_API_KEY=<your-key>
export VENUS_MODEL=UI-Venus-2-9B-W8A8

# stdio (ZCode / Claude Code / Codex)
node dist/index.js

# Streamable HTTP (remote agents / LAN)
node dist/index.js --http --port 8765

Smoke-test the vision endpoint (one calibration request):

pnpm smoke:venus

ZCode / Claude Code config

{
  "mcpServers": {
    "ui-venus-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/UI-Venus-MCP/dist/index.js"],
      "env": {
        "VENUS_BASE_URL": "http://<gpu-host>:8300/v1",
        "VENUS_API_KEY": "<your-key>",
        "VENUS_MODEL": "UI-Venus-2-9B-W8A8"
      }
    }
  }
}

More configs (HTTP transport, Codex, OpenAI Agents): examples/mcp-config.md.

Usage patterns

Assist mode — a multimodal agent drives; the MCP executes and grounds:

computer_inspect  → screenshot + UI tree (+ optional vision description)
computer_locate   → "关闭按钮" → {element, point}   (structured first, vision fallback)
computer_action   → { type: "click", element: {...} }
computer_verify   → structured assertion, else vision verdict

Delegate mode — a text-only agent hands over the whole task:

{
  "tool": "computer_execute_task",
  "arguments": {
    "target": { "type": "device", "platform": "android", "deviceId": "emulator-5554" },
    "task": "打开设置,将Wi-Fi打开",
    "mode": "delegate",
    "maxSteps": 30
  }
}

Internally: Observe → Plan → Locate → Execute → Observe → Verify → Recover/Finish, with the state machine, security gates, and loop guard enforcing honest termination. Poll with computer_get_task, cancel with computer_cancel_task; sensitive actions return WAITING_CONFIRMATION + confirmToken.

Record → script → replay:

computer_record_start → (drive the app via computer_action) → computer_record_to_script
name: disable-auto-update
steps:
  - locate: { role: button, name: 设置 }
    action: click
  - locate: { name: 自动更新 }
    action: toggle
    value: false
assert:
  - element: { name: 自动更新 }
    property: { checked: false }

Replay with computer_run_script, or run as a UI test (PASS/FAIL/SKIP/BLOCKED) with computer_run_ui_test. DSL reference: examples/dsl/toggle-autoupdate.yaml.

Platform support matrix

Capability

Windows

Linux

macOS

Android

iOS

Browser

Screenshot

✅ CopyFromScreen

✅ import/scrot/grim

✅ screencapture

✅ screencap

✅ simctl/WDA

✅ Playwright

Accessibility tree

✅ UIA

✅ AT-SPI (pyatspi)

✅ AX (System Events)

✅ UIAutomator dump

⚠️ WDA/idb

✅ aria snapshot

Semantic actions

✅ UIA patterns

✅ doAction/setText

✅ AXPress/AXValue

✅ dump+tap center

⚠️ WDA elements

✅ role/text/testid locators

Global input

✅ SendInput

✅ xdotool / wtype

✅ CGEvent

✅ adb input

⚠️ WDA/idb

✅ keyboard/mouse

App control

✅

✅

✅ open/AppleScript

✅ monkey/am

✅ simctl/WDA

n/a

Unicode typing

✅ KEYEVENTF_UNICODE

✅ xdotool type

✅ CGEvent unicode

⚠️ ADBKeyboard IME

✅ WDA

✅

Vision fallback

✅

✅

✅

✅

✅

✅

⚠️ = capability depends on optional tooling/signing — the server reports exactly what is missing (capabilities.notes), per the honesty rules. Platform-specific setup: docs/install/ — macOS · Windows · Linux · Android · iOS.

The UI-Venus provider (verified endpoint contract)

The default provider speaks the OpenAI chat/completions format with chat_template_kwargs: {enable_thinking: false} and grounds natural-language elements to [0,1000]-normalized points. Calibrated against the W8A8 build (2026-09-28): button at pixel (1300,740) on 1920×1080 → [676, 680]; the official grounding prompt and the live verification live in ui-venus-service/README.md and tests/e2e/venus-live.test.ts.

Swapping providers (UI-TARS, Qwen-GUI, any VLM): implement ComputerVisionProvider (src/providers/types.ts) and register it in the registry — nothing else knows which model is in use.

Development

pnpm test                  # full hermetic suite (unit + integration + browser E2E)
pnpm test:e2e:macos        # real macOS E2E (needs permissions) — RUN_MACOS_E2E=1
pnpm test:e2e:venus        # live grounding E2E against your endpoint — RUN_VENUS_LIVE=1
pnpm typecheck && pnpm build

QA status per platform (what is really verified vs mocked): docs/qa-report.md. Architecture deep-dive: docs/architecture.md.

Repository layout

src/
├── mcp/            17 tools, server assembly
├── orchestrator/   task loop, fusion locator, verifier, loop guard, security
├── providers/      ComputerVisionProvider + UI-Venus implementation + mock
├── platforms/      adapter interface, router, macos/linux/windows/android/ios/browser
├── scripting/      YAML DSL + runner      ├── recorder/   semantic recording
├── coordinate/     space transforms      ├── screenshot/ pipeline (ROI/hash/JPEG)
├── core/           types, actions, state machine, errors
ui-venus-service/   endpoint contract & serving reference
tests/              unit · integration (mock+browser+mcp) · e2e (opt-in real)

License

MIT — see LICENSE.

Available Tools

17 tools
computer_actionExecute one actionB

Execute a single unified action (spec §17): click/double_click/right_click/long_press/move/drag/swipe/scroll/type/set_value/clear/press/hotkey/select/toggle/invoke/launch_app/terminate_app/focus/back/home/wait. Provide element (from computer_locate) or point. Records to the active recorder if recording.

Inputs: action (required), target, confirmToken.

computer_cancel_taskCancel taskB

Request cancellation of a running task; also cancels its pending confirmation.

Inputs: taskId (required).

computer_execute_taskExecute a full GUI taskA

Delegate a natural-language task to the autonomous GUI agent loop (observe → decide → locate → execute → verify → recover). mode=delegate|auto. Returns immediately with a taskId unless wait=true. Sensitive actions park in WAITING_CONFIRMATION with a confirmToken — re-call with the token to approve.

Inputs: task (required), mode, wait, target, +3 more.

computer_get_stateGet computer stateA

Cheap structural state: screen info, frontmost app, windows, capabilities. No screenshot.

Inputs: target.

computer_get_targetGet target detailsB

Resolve one target and report its capabilities, permission state and platform details.

Inputs: target.

computer_get_taskGet task statusB

Fetch a task record: state, steps, outcome, pending confirmation.

Inputs: taskId (required).

computer_inspectInspect screen (vision)B

Full observation: screenshot + UI tree, optionally with a vision-model description focused on a topic.

Inputs: focus, target, includeTree, maxTreeDepth.

computer_list_targetsList computer targetsA

Enumerate every device/platform this MCP server can currently serve (local desktops, android devices, ios simulators, browser), with availability and honest capability notes.

Inputs: no named parameters.

computer_locateLocate element (fusion)A

Find an element by natural language or structured descriptor. Structured (UIA/AX/AT-SPI/DOM) first, UI-Venus vision grounding as fallback; vision points are snapped back to structured elements when possible. Coordinates in results are screenshot pixel space; use with computer_action.

Inputs: instruction (required), target, descriptor, preferStructured.

computer_record_startStart recordingB

Start recording executed actions on a target session (semantic evidence: elements, hashes, apps).

Inputs: target.

computer_record_stopStop recordingC

Stop recording and return the recorded entries.

Inputs: target.

computer_record_to_scriptRecording → automation scriptC

Convert the current/last recording into a portable YAML automation script with semantic locators (never raw coordinates).

Inputs: name, stop, target.

computer_run_scriptRun automation scriptC

Execute a portable YAML automation DSL script (semantic locators, cross-platform) against a target.

Inputs: path, yaml, target.

computer_run_ui_testRun UI test suiteB

Run one or more YAML UI test cases; returns PASS/FAIL/SKIP/BLOCKED per case with step evidence. BLOCKED = environmental restriction (permissions/offline/unsupported), reported honestly.

Inputs: cases (required), target.

computer_screenshotTake screenshotC

Capture the screen/window/display. Returns metadata + image content; optionally saves to a file.

Inputs: region, target, savePath, windowId, +1 more.

computer_stepOne autonomous stepB

Observe + let the vision GUI expert decide the next action + execute it. Returns the decision and execution result. Useful for building your own loop in the calling agent.

Inputs: goal (required), dryRun, target, language.

computer_verifyVerify stateB

Verify a goal against the current screen: structured UI-tree heuristics first, UI-Venus vision verification as fallback. Supports structured assertions (checked/exists/value/textVisible).

Inputs: goal, target, assertion.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools have clearly distinct scopes (single action vs. one autonomous step vs. full task delegation; different observation depths; recording vs. script execution). Some boundaries among computer_action, computer_step, computer_execute_task, and computer_run_script could blur, but descriptions and parameter differences largely disambiguate them.

    Naming Consistency5/5

    All tool names use consistent computer_ snake_case with clear verb/noun or record_* patterns. There is no mixed casing or conflicting verb style.

    Tool Count4/5

    17 tools is slightly above the typical 3-15 sweet spot, but the breadth of GUI automation capabilities (targets, observation, action, tasks, recording, scripting, testing) justifies most tools. A few tools could potentially be consolidated but are reasonable for this domain.

    Completeness5/5

    The surface covers target discovery, observation, element location, action execution, autonomous task delegation, verification, cancellation, recording/scripting, and UI testing. There are no obvious dead ends for the stated GUI automation purpose.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to see, locate UI elements, and operate any Windows desktop app through natural language, using accessibility-tree matching with optional vision-model fallback, plus an autonomous visual loop with introspection and meta-learning.
      14
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to automate real desktop applications across Windows, Linux, and macOS using incremental screen perception, accessibility trees, OCR, and window management, dramatically reducing token usage compared to screenshot-per-step approaches.
      27 PyPI
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to operate local desktops and Chromium browsers through MCP tools, unifying accessibility trees, physical input, screenshots, DOM/ARIA, visual grounding, and result verification.
      4,740 npm
      MIT