Skip to main content
Glama

Agent Bridge v2.2

Universal Any-App Desktop Automation with Zero-Conflict Virtual Mouse · Cross-Platform (macOS & Windows) Multi-Agent MCP Hub & Hybrid 3D Bridge

Platform Virtual Mouse Python MCP Tools License: MIT

English | 简体中文


Agent Bridge is a zero-dependency Python + native OS MCP server & Antigravity plugin across macOS and Windows that lets AI assistants operate any desktop software in the background without stealing your physical mouse, keyboard, clipboard, or active window, while unifying all your local AI coding agents:

  1. Universal Any-App Computer-Use v2.2 with Zero-Conflict Virtual Mouse (macOS Swift + Windows C# / WinRT)

    • Works with ANY desktop app — browsers (Chrome, Edge, Safari), Office / WPS, chat & collaboration apps (WeChat, DingTalk, Slack, Feishu), IDEs (VS Code, Cursor, JetBrains, Xcode), creative/CAD suites (Photoshop, Figma, DaVinci Resolve, AutoCAD, Blender), enterprise ERP clients, and native utilities.

    • Zero-Conflict Virtual Mouse & Background Keyboard (Default):

      • macOS: routes mouse clicks/drags/scrolls and Unicode typing directly to the target process via CGEvent.postToPid(pid) (.privateState source) + AXUIElement semantic actions + screencapture -o -l <wid> background window capture — your physical cursor never moves and your foreground app never loses focus.

      • Windows: drills into child window handles (RealChildWindowFromPoint + ScreenToClient) and dispatches WM_MOUSEMOVE / WM_L|R|MBUTTON* / WM_MOUSEWHEEL / WM_CHAR via PostMessage + UIAutomation patterns + PrintWindow(PW_RENDERFULLCONTENT) background capture.

      • Zero Clipboard Clobbering: virtual Unicode typing injects Chinese/CJK & multiline text directly without overwriting the user's clipboard.

      • Smart saved_restore Fallback: if a custom-rendered Chromium/Electron or DirectX/Metal app ignores background events, input_mode="saved_restore" waits until the user's physical input is idle (>= 350ms via secondsSinceLastEventType / GetLastInputInfo), executes, and immediately restores the cursor to its exact original position.

    • Offline Chinese + English OCR + Set-of-Marks (SoM) + Grid Overlay: Apple Vision on macOS and built-in WinRT Windows.Media.Ocr on Windows locate buttons/text even inside OpenGL/Metal/DirectX/Canvas UIs.

    • Zero pip dependencies, zero external SDKs: compiles in ~2 seconds using built-in swiftc on macOS and built-in .NET Framework 4.x csc.exe + PowerShell 5.1 WinRT on Windows 10/11!

  2. Extensible Multi-Agent Hub (8 Built-in + Zero-Code Custom Registry)

    • Built-in native adapters for OpenAI Codex, Claude Code / Desktop, Tencent WorkBuddy, DeepSeek Harness (dsh), OpenCode, Trae CN / Trae, VS Code, and Cursor.

    • Discovers local projects, reads SQLite/JSONL/.zst session transcripts & agent memories (AGENTS.md, CLAUDE.md, MEMORY.md), and supports both headless CLI (channel="cli") and live visible Desktop UI chat (channel="desktop").

    • Zero-code extension: dynamically register any new CLI tool (gemini_cli, aider, cursor_agent, qwen_code, goose, kimi_cli, openhands, or your own) with bridge_register_agent.

  3. Dependency-Aware Multi-Agent Orchestrator

    • Create persistent DAG task plans (collab_create_plan), dispatch independent agents in parallel (collab_dispatch_task) with automatic upstream handoff context injection, monitor status, and synthesize Markdown + Git handoff reports.

  4. Optional Hybrid Blender 3D Bridge (4.x / 5.x)

    • Specialized bonus bridge for Blender 3D modeling: live GUI bpy/bmesh TCP socket (127.0.0.1:9876) + headless --background batch execution + multi-angle visual verification renders (iso, front, side, top) + .blend/.glb/.obj/.stl/.fbx/.usdz export.


Zero-Conflict Virtual Mouse (Any Desktop App)

Every cua_mouse, cua_keyboard, and cua_batch_actions call supports a 3-tier input isolation strategy, defaulting to virtual:

input_mode

Physical Mouse Moved?

Steals Active Window Focus?

Clobbers Clipboard?

Best Used For

virtual (Default)

No (0 px)

No

No

Everyday background automation of any app (native macOS/Win32/Qt/WPF/Cocoa/Java apps, browsers, chat, Office, IDEs) while you keep working normally.

saved_restore

Briefly, then restored after user idle (≥ 350ms)

Only if app requires focus

Restores clipboard

Fallback for custom Chromium/Electron canvases or DirectX/Metal/OpenGL viewports that ignore background OS messages.

physical

Yes

Yes

Restores clipboard

Explicit foreground takeover when requested by the user (e.g., OS-level drag across apps or security prompts).

Recommended Priority Ladder:

  1. Semantic UI actions first (cua_element_action via AXUIElement / UIAutomation) — zero cursor movement, 100% background-safe.

  2. Background capture + Virtual Pointer (cua_screenshot(target="window", app_name=..., annotate="ocr"|"som") → cua_mouse(..., input_mode="virtual", app_name=...) / cua_keyboard(..., input_mode="virtual")).

  3. Idle-yielding fallback (input_mode="saved_restore") only if a target app ignores background events.


Related MCP server: ScreenHand

Platform Parity (macOS & Windows)

Capability

macOS (Apple Silicon / Intel)

Windows 10 / 11 (x64 / ARM64)

MCP Server Core

Pure Python 3.9+ stdlib

Pure Python 3.9+ stdlib (UTF-8 stdio)

Native CUA Helper

native/mac_cua.swift → bin/mac-cua-helper (swiftc)

native/win_cua.cs → bin/win-cua-helper.exe (built-in .NET 4.x csc.exe)

Virtual Mouse & Keyboard

CGEvent.postToPid(pid) (.privateState source, UTF-16 Unicode)

Win32 PostMessage (WM_* / WM_CHAR) to drilled child HWND

User-Idle Priority Guard

CGEventSource.secondsSinceLastEventType (user_idle_ms)

Win32 GetLastInputInfo (user_idle_ms)

Background Window Capture

screencapture -x -o -l <wid> (drop-shadow stripped) + Stage Manager discovery

PrintWindow(PW_RENDERFULLCONTENT) (occluded window capture) + DWM bounds

Offline OCR (ZH + EN)

Apple Vision Neural Engine (VNRecognizeTextRequest)

Built-in WinRT Windows.Media.Ocr (native/win_ocr.ps1) + optional rapidocr-onnxruntime

UI Tree & Semantic Actions

AXUIElement (AXPress, AXSetValue, AXFocus)

Windows UIAutomation (InvokePattern, ValuePattern, TogglePattern, SetFocus)

3D / CAD & Precision Input

Middle-drag, modifiers, full Numpad, Esc emergency abort

Middle-drag, modifiers, full Numpad, Unicode, Esc emergency abort

OS Scripting Action

cua_app_control(action="applescript")

cua_app_control(action="powershell")

8 Built-in Agent Adapters

/Applications/*.app, ~/Library/Application Support/*, ~/.{codex,claude,workbuddy,dsh}

%LOCALAPPDATA%\Programs\*, %APPDATA%\*, %USERPROFILE%\.{codex,claude,workbuddy,dsh}

Blender Hybrid Bridge

Auto-detects /Applications/Blender.app

Auto-detects Blender Foundation\Blender *\blender.exe (newest first)


Quick Install

Prerequisites

  • Python 3.9+ (standard library only — zero pip install needed)

  • macOS: Xcode Command Line Tools (xcode-select --install) for compiling mac-cua-helper

  • Windows 10 / 11: Nothing extra! Built-in .NET Framework 4.x (csc.exe) and PowerShell 5.1 are pre-installed on Windows.

macOS (One Command)

git clone https://github.com/Romeo-romeoo/agent-bridge.git
cd agent-bridge
bash scripts/install.sh

Developer symlink mode (edits in repo apply immediately to Antigravity): bash scripts/install.sh --link

Windows (PowerShell One Command)

git clone https://github.com/Romeo-romeoo/agent-bridge.git
cd agent-bridge
powershell -ExecutionPolicy Bypass -File scripts\install.ps1

Want to also wire Codex's native MCP server if codex is installed? Add --with-codex-mcp. Want to only compile & test inside the repo without installing to ~/.gemini/config/plugins/? Add --skip-plugin-install.


Using with Any MCP Client (Antigravity / Claude Desktop / Cursor / VS Code)

Running install.sh / install.ps1 installs the full plugin (MCP server + 4 Skills + Always-On Safety Rules + Coordinator Subagent) directly into:

  • macOS: ~/.gemini/config/plugins/agent-bridge

  • Windows: %USERPROFILE%\.gemini\config\plugins\agent-bridge

Standalone MCP Configuration (Claude Desktop / Cursor / VS Code)

macOS:

{
  "mcpServers": {
    "agent-bridge": {
      "command": "python3",
      "args": ["/path/to/agent-bridge/server/mcp_server.py"],
      "env": {
        "PYTHONUNBUFFERED": "1",
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

Windows:

{
  "mcpServers": {
    "agent-bridge": {
      "command": "python",
      "args": ["C:\\path\\to\\agent-bridge\\server\\mcp_server.py"],
      "env": {
        "PYTHONUNBUFFERED": "1",
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

OS Permissions & Setup Notes

macOS

To use Computer-Use (cua_*) or Desktop Live Chat (channel="desktop"), grant these toggles in System Settings → Privacy & Security to your host IDE/terminal (e.g. Antigravity / Terminal / iTerm2):

  1. Accessibility (for AXUIElement, virtual postToPid mouse/keyboard synthesis, window tiling)

  2. Screen & System Audio Recording (for background window screenshots and Apple Vision OCR)

Windows 10 / 11

  • Standard user privileges work out-of-the-box for all normal apps (browsers, Office, WeChat, VS Code, Cursor, Blender, Electron apps).

  • Automating Admin/UAC windows: Windows UIPI blocks non-elevated processes from sending input (PostMessage / SendInput) to Administrator windows; launch your host IDE as Administrator only if you need to control elevated apps.

  • Chinese/English OCR: Uses built-in Windows 10/11 OCR language packs automatically. If your Windows image lacks an OCR pack (e.g., LTSC/Server), either add a Windows language capability or install the optional fallback:

    pip install rapidocr-onnxruntime

MCP Tools Overview (38 Tools)

Category

Tools

Universal Computer-Use v2.2 (12)

cua_status, cua_screenshot (background window / SoM / OCR / Grid), cua_ocr, cua_ui_tree, cua_find_elements, cua_element_action, cua_mouse (virtual mouse default / saved_restore / 3D middle drag), cua_keyboard (virtual Unicode typing / Numpad / hold), cua_app_control (window tiling / AppleScript / PowerShell), cua_clipboard, cua_wait_for, cua_batch_actions

Agent Discovery & Extensibility (8)

bridge_list_agents, bridge_list_projects, bridge_list_sessions, bridge_read_session, bridge_read_agent_knowledge, bridge_register_agent, bridge_unregister_agent, bridge_list_agent_presets

Safe Workspace Inspection (4)

bridge_project_tree, bridge_read_file (blocks secrets/keys), bridge_search_files, bridge_project_git

Live Chat & Channel Control (4)

bridge_chat (CLI or Desktop UI), bridge_set_channel, bridge_get_channel, bridge_codex_computer_use

Multi-Agent Orchestrator (5)

collab_create_plan, collab_dispatch_task, collab_get_status, collab_cancel_task, collab_handoff_summary

Hybrid Blender 3D Bridge (5)

blender_status, blender_launch, blender_execute, blender_inspect_scene, blender_render_preview

Plus 4 MCP Resources (agent-bridge://status, agent-bridge://projects, agent-bridge://plans, agent-bridge://blender) and 4 MCP Prompts (continue_agent_project, multi_agent_sprint, desktop_computer_use, blender_3d_modeling).


Security Guardrails

  • Zero-Conflict by Default: Virtual Mouse & Keyboard avoid hijacking the user's physical cursor, focus, or clipboard, while saved_restore automatically yields when the user is actively moving the mouse or typing.

  • Credential Protection: bridge_read_file and bridge_search_files automatically block sensitive files (auth.json, .credentials.yaml, trae-jwt-token, .env*, .ssh/*, .aws/*, .gnupg/*, *.pem, *.key, .npmrc, .netrc).

  • Emergency Escape Abort: Every mouse drag, typing chunk, wait loop, and batch macro step checks live hardware Escape key state so the user can abort automation instantaneously on both macOS and Windows.

  • Audit Trail: Every GUI mutation is appended to ~/.agent-bridge/audit.jsonl.


Development & Testing

# macOS: compile Swift helper
bash scripts/build_native.sh

# Windows PowerShell: compile C# helper
powershell -ExecutionPolicy Bypass -File scripts\build_native.ps1

# Run full cross-platform unit test suite
python3 -m unittest discover -s tests -v    # macOS
python -m unittest discover -s tests -v     # Windows

# Run end-to-end MCP stdio verification
python3 scripts/self_test.py                # macOS
python scripts\self_test.py                 # Windows

License

MIT

Available Tools

38 tools
blender_executeA

Execute Blender Python (bpy/bmesh/mathutils) 3D modeling, modifier, shader, lighting, or animation scripts either LIVE inside the open Blender GUI (via Live Bridge) or HEADLESSLY (Blender --background). Supports saving .blend and exporting .glb/.gltf/.obj/.stl/.fbx/.usdz.

Inputs: code (required), mode, port, save_as, +3 more.

blender_inspect_sceneC

Inspect objects, mesh vertex/face counts, transforms, dimensions, modifiers, materials, and cameras in a live or saved Blender scene.

Inputs: mode, port, blend_file.

blender_launchC

Launch Blender GUI on screen with the Agent Bridge Live bpy socket preloaded so Antigravity can build 3D models live in the viewport.

Inputs: port, blend_file, wait_seconds, enable_live_bridge.

blender_render_previewC

Render multi-angle studio preview PNGs (iso, front, side, top, back, camera) of the current live Blender scene or a .blend file and return them as inline MCP images for visual 3D modeling verification.

Inputs: mode, port, width, angles, +5 more.

blender_statusB

Check local Blender installation, version, running GUI state, and Live Bridge TCP (127.0.0.1:9876) connection.

Inputs: port.

bridge_chatB

Converse with any built-in or custom AI coding agent via user-selectable channel: channel='cli' (headless CLI execution) or channel='desktop' (live visible dialogue inside the macOS/Windows desktop client window via Computer-Use v2.1 + lossless session readback) or channel='auto'.

Inputs: agent (required), prompt (required), cwd, mode, +9 more.

bridge_codex_computer_useC

Delegate an open-ended visual desktop task to Codex's native computer_use (SkyComputerUseService).

Inputs: task (required), cwd, mode, model, +2 more.

bridge_get_channelA

Inspect current global and per-agent CLI vs Desktop client channel preferences.

Inputs: no named parameters.

bridge_list_agent_presetsA

List ready-to-register preset templates for popular external AI coding CLIs (Gemini CLI, Aider, Cursor Agent, Qwen Code, Goose, Kimi CLI, OpenHands).

Inputs: no named parameters.

bridge_list_agentsB

Inspect local AI coding agents (codex, claude, workbuddy, deepseek_harness, opencode, trae, vscode, cursor, plus any dynamically registered custom agents): CLI paths, versions, desktop apps, computer-use readiness, and project/session counts.

Inputs: agent, only_installed.

bridge_list_projectsB

Discover and aggregate engineering project directories across all built-in and custom AI coding tools.

Inputs: agent, limit, search, only_existing.

bridge_list_sessionsB

List recent conversation sessions/threads across built-in and custom AI coding agents.

Inputs: agent, limit, query, project_path.

bridge_project_gitC

Inspect git branch, status, recent commits, and diff stats for a project directory.

Inputs: path (required), log_limit, include_diff_stat.

bridge_project_treeC

Inspect the directory tree and tech stack markers of any local project directory.

Inputs: path (required), max_depth, max_entries, include_hidden.

bridge_read_agent_knowledgeC

Read shared skills, plans, memories, AGENTS.md/CLAUDE.md/MEMORY.md, and goals across agents.

Inputs: agent, max_chars, include_content.

bridge_read_fileB

Read a text file with line numbers from any project directory (blocks credential/secret files).

Inputs: path (required), end_line, max_bytes, start_line.

bridge_read_sessionC

Read conversation transcripts, goals, and plans for a specific agent session_id.

Inputs: agent (required), session_id (required), tail_messages, include_tool_calls, +1 more.

bridge_register_agentA

Dynamically register ANY additional AI coding tool (or activate a built-in preset such as gemini_cli, aider, cursor_agent, qwen_code, goose, kimi_cli, openhands) into ~/.agent-bridge/custom_agents.json so it works seamlessly with bridge_chat, bridge_list_projects, and collab_create_plan.

Inputs: preset, aliases, agent_id, app_path, +8 more.

bridge_search_filesC

Fast regex or literal text search across files in a project directory.

Inputs: query (required), root_path (required), regex, max_matches, +2 more.

bridge_set_channelA

Set the user's default conversation channel ('cli', 'desktop', or 'auto') globally or for a specific agent (persisted in ~/.agent-bridge/config.json).

Inputs: channel (required), agent.

bridge_unregister_agentB

Remove a dynamically registered custom AI coding agent from ~/.agent-bridge/custom_agents.json.

Inputs: agent_id (required).

collab_cancel_taskB

Cancel a pending or running background task by task_id.

Inputs: task_id (required).

collab_create_planC

Create a persistent multi-agent collaborative engineering plan with dependency-ordered subtasks across any built-in or custom agents.

Inputs: tasks (required), title (required), objective (required), shared_cwd (required).

collab_dispatch_taskB

Dispatch ready tasks from a plan_id (or explicit task_ids) in parallel with automatic upstream handoff injection.

Inputs: wait, plan_id, task_ids, timeout_sec.

collab_get_statusB

Check live status, outputs, session IDs, and git diff stats for a plan_id, task_ids, or recent plans.

Inputs: plan_id, task_ids, wait_seconds.

collab_handoff_summaryC

Generate a consolidated Markdown + structured handoff report combining completed multi-agent outputs and git status.

Inputs: plan_id, task_ids, project_path.

cua_app_controlC

Manage macOS & Windows apps and windows: list, activate, launch, open_target (URL/file), applescript (macOS), powershell (Windows/cross-platform), plus window layout control (move, resize, maximize, tile_left, tile_right).

Inputs: action (required), h, w, x, +5 more.

cua_batch_actionsB

Execute a multi-step desktop GUI macro (activate, launch, mouse, keyboard, ax_action, clipboard, wait, wait_for, applescript, powershell) in a single tool call with Escape-key emergency abort and optional final screenshot.

Inputs: steps (required), app_name, input_mode, stop_on_error, +4 more.

cua_clipboardA

Read from or write UTF-8 text to the macOS or Windows system clipboard.

Inputs: action (required), text.

cua_element_actionB

Invoke a direct semantic Accessibility / UI Automation action (press, confirm, focus, set_value, show_menu, raise) on an element by ref or query without pixel guessing.

Inputs: ref, role, query, value, +2 more.

cua_find_elementsB

Search native Accessibility / UI Automation elements by label substring and/or role, returning exact coordinates, ref IDs, and supported semantic actions.

Inputs: pid, role, query, app_name.

cua_keyboardB

Zero-conflict Virtual Keyboard v2.2 for ANY macOS or Windows software. Defaults to input_mode='virtual' (direct background Unicode/CJK injection via macOS postToPid / Windows PostMessage WM_CHAR without clobbering the user's clipboard or stealing focus!). Supports type_text, key_press, hotkey, key_down, key_up, key_hold, and full Numpad keys.

Inputs: action (required), key, pid, hwnd, +6 more.

cua_mouseA

Zero-conflict Virtual Mouse v2.2 for ANY macOS or Windows software. Defaults to input_mode='virtual' (macOS CGEvent postToPid / Windows PostMessage to background HWND), so the user's physical mouse cursor and foreground focus are NEVER hijacked! Supports logical/normalized[0..1000]/image coords or element ref IDs, left/right/middle buttons, modifier-held smooth drags, triple-click, scroll, and saved_restore/physical fallbacks.

Inputs: action (required), x, y, dx, +14 more.

cua_ocrB

Run offline Chinese+English OCR (Apple Vision on macOS / WinRT Windows.Media.Ocr on Windows) on the screen, an app window, or an image file. Returns exact text, click coordinates (cx, cy), normalized [0..1000] boxes, and element ref IDs. Essential for OpenGL/Metal/DirectX apps like Blender, Photoshop, and DaVinci Resolve.

Inputs: fast, query, target, display, +2 more.

cua_screenshotB

Capture a macOS or Windows screenshot (full display, app window, or crop region) with optional coordinate grid (grid=true, ideal for Blender/Photoshop viewports) and Set-of-Marks or Offline OCR numbered boxes (annotate='som'|'ocr') that populate element refs for zero-guess clicking.

Inputs: grid, region, target, display, +4 more.

cua_statusA

Check Computer-Use v2.1 readiness across macOS & Windows: permissions/elevation, displays, cursor position, frontmost app, running GUI apps, and capabilities.

Inputs: no named parameters.

cua_ui_treeC

Read the native Accessibility / UI Automation tree (AXUIElement on macOS, UIAutomation on Windows) of the frontmost or named app with numbered element ref IDs and exact (cx, cy).

Inputs: pid, app_name, max_depth, max_nodes, +1 more.

cua_wait_forB

Smart wait until on-screen text appears (Offline OCR), an Accessibility/UIA element appears, an app window opens, or the screen visually changes.

Inputs: condition (required), value, app_name, timeout_sec, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 38 tools

    Disambiguation4/5

    The four domain prefixes (cua_, bridge_, blender_, collab_) make the tool set broadly easy to navigate, and most tools have a clearly distinct resource/action. Some overlap remains within CUA (cua_screenshot with annotate, cua_ocr, cua_find_elements, and cua_ui_tree all help locate elements), and cua_batch_actions overlaps with individual cua_mouse/cua_keyboard/cua_app_control primitives, but the descriptions generally clarify when to use each.

    Naming Consistency4/5

    All names use consistent snake_case with clear domain prefixes, which makes the set predictable. There are minor deviations from a strict verb_noun pattern, such as noun-only tools (cua_mouse, cua_keyboard, cua_status, blender_status) and noun_verb-style names (bridge_project_tree, bridge_project_git), but the convention is still readable and grouped coherently.

    Tool Count2/5

    At 38 tools, the server is heavy for a single MCP surface and exceeds the typical well-scoped range. The breadth is explained by four large sub-domains (computer use, agent bridge, Blender, multi-agent collaboration), but the total is still likely to overwhelm agents and make discovery harder.

    Completeness4/5

    The surface covers a lot: agent registration/listing/session reading/chat, extensive computer-use primitives, Blender launch/execute/inspect/render, and collaborative plan dispatch/status/cancel/handoff. Minor gaps exist, such as no direct project file write/edit tool and no explicit plan update/delete operation, but most workflows have a workable path.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      An experimental MCP server providing full control over the macOS user interface through mouse, keyboard, and window management tools. It enables AI assistants to automate desktop tasks by utilizing native accessibility APIs and OCR for real-time screen comprehension.
      7
      Creative Commons Zero v1.0 Universal
    • A
      license
      Not graded
      quality
      D
      maintenance
      An open-source MCP server for macOS and Windows that provides native desktop control via Accessibility APIs, OCR, and Chrome CDP. It enables AI agents to interact with applications, manage browser sessions, and automate workflows with high-speed native UI actions.
      45 npm
      15
      AGPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that gives any AI assistant eyes and hands on your desktop — screenshots, clicking, typing, OCR, window management, accessibility-tree queries, workflow recording.
      5
      Apache 2.0