macos-cua
by NaghtSieger
README.md
# macos-cua
Background-capable **macOS Computer Use** MCP server and Antigravity plugin built on top of `dsh-cua-native` (`SkyLight`, `ScreenCaptureKit`, and macOS Accessibility) plus a lazy-compiled Swift system bridge (`Vision` OCR, `CGHIDEventTap` continuous trackpad scrolling/dragging, and clipboard-safe `Cmd+V` shortcut paste).
## Highlights
- **Non-intrusive background control**: Targets apps and `CGWindowID`s directly without stealing focus or moving the physical mouse cursor where supported.
- **Single-window ScreenCaptureKit capture + Vision OCR**: `cua_screenshot({ ocr: true, includeImage: false })` returns exact screenshot-pixel bounding boxes (`bbox`, `center`) with zero PNG transfer overhead when only text/coordinates are needed.
- **Accessibility-first + coordinate fallback**: Inspect AX trees (`cua_get_state`), invoke AX actions (`cua_invoke`, `cua_perform_action`, `cua_set_value`, `cua_select_text`), or operate AX-less windows (such as `iPhone Mirroring`) using `cua_batch`, `useSystemPointer`, and `mode: "shortcut"` paste.
- **Zero third-party runtime npm dependencies**: Pure Node.js (`>=20`) ESM + macOS `swiftc` (compiled on demand into `.cache/`).
## Prerequisites
- **macOS** with Accessibility & Screen Recording permissions granted to the native helper (`DSH Computer Use`).
- **Node.js** `>= 20.0.0`.
- **Native helper binary** (`DSH Computer Use.app/Contents/MacOS/dsh-cua-native`):
- Auto-discovered from `DeepSeek Harness.app` or `~/Library/Application Support/DeepSeek Harness/Computer Use`, **or**
- Provided explicitly via `MACOS_CUA_HELPER_PATH=/path/to/dsh-cua-native`.
- Xcode Command Line Tools (`swiftc`) if using `Vision` OCR or `CGHIDEventTap` system-pointer actions.
## Plugin Installation (Antigravity)
Clone or symlink this directory into your Antigravity plugins folder (`~/.gemini/config/plugins/macos-cua`), then restart or reload plugins:
```bash
git clone https://github.com/NaghtSieger/macos-cua.git ~/.gemini/config/plugins/macos-cua
```
`mcp_config.json` launches `node ${PLUGIN_ROOT}/server/mcp-server.mjs` over stdio MCP.
## MCP Tools (22)
| Category | Tools |
|---|---|
| **Capabilities & Discovery** | `cua_capabilities`, `cua_list_apps`, `cua_find_apps`, `cua_get_app`, `cua_list_windows` |
| **Window Focus & Observation** | `cua_activate`, `cua_show`, `cua_get_state`, `cua_screenshot` |
| **Accessibility Actions** | `cua_list_actions`, `cua_invoke`, `cua_perform_action`, `cua_set_value`, `cua_select_text` |
| **Pointer, Keyboard & Paste** | `cua_click`, `cua_mouse_move`, `cua_scroll`, `cua_drag`, `cua_type_text`, `cua_press_key`, `cua_paste` |
| **Atomic Workflows** | `cua_batch` |
See [skills/macos-cua/SKILL.md](skills/macos-cua/SKILL.md) for detailed coordinate spaces, batch step schemas, and `iPhone Mirroring` recipes.
## Development & Testing
```bash
npm run check # Syntax check all JS modules and tests
npm test # Run portable unit & mocked MCP tests
npm run compile:swift # Verify cua-sys-helper.swift compiles cleanly (macOS)
npm run test:e2e # Run live macOS GUI E2E test against a background TextEdit window
```
## License
[MIT](LICENSE)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues