Cua Computer Server
Server component for the Computer-Use Interface (CUI) framework providing low-level computer control primitives.
Documentation - Installation, guides, and configuration.
Interfaces
The Computer Server exposes multiple interfaces simultaneously:
- HTTP/WebSocket - REST API and WebSocket for programmatic access
- MCP via HTTP - Model Context Protocol over streamable HTTP at
/mcpendpoint
Android emulators also expose the emulator's built-in EmulatorController gRPC service on port 8554 (via
-grpc 8554launch flag). Local Android sandboxes (AndroidEmulatorRuntime) useGRPCEmulatorTransportto callgetScreenshot()directly on this service, bypassing the computer-server HTTP layer entirely. Benchmark: p50 ~20ms, ~49 RPS vs ADB-backed HTTP p50 ~519ms, ~1.8 RPS.
Installation
# Basic installation (HTTP/WebSocket only)
pip install cua-computer-server
# With MCP support
pip install cua-computer-server[mcp]
# With the generated native Cua Driver SDK backend
pip install cua-computer-server[driver]
Usage
# Start the server on default port 8000
python -m computer_server
# Or with custom port
python -m computer_server --port 8080
# Allow external access explicitly
python -m computer_server --host 0.0.0.0
# With resolution scaling (useful for Retina displays or VMs)
python -m computer_server --width 1512 --height 982
# Delegate portable whole-desktop actions to Cua Driver in this process
python -m computer_server --backend cua-driver --capture-scope desktop
# Or connect to an already-running Cua Driver daemon
python -m computer_server --backend cua-driver --driver-mode daemon
By default the server binds to 127.0.0.1. Deployments that need access from
other hosts should pass --host 0.0.0.0 or another explicit interface.
This provides:
- HTTP API at
/ws,/cmd,/statusendpoints - MCP server at
/mcpendpoint (requiresfastmcppackage)
MCP clients can connect via streamable HTTP at http://localhost:8000/mcp.
Cua Driver backend
--backend cua-driver keeps computer-server's HTTP/WebSocket, MCP, shell,
file, PTY, browser, accessibility, and window-management surfaces while routing
portable desktop capture, pointer, scroll, and keyboard actions through the
generated cua-driver Python SDK. The default embedded mode loads the Rust
runtime into computer-server and does not require a daemon. daemon mode is a
compatibility option for deployments that already own a long-lived driver.
The driver backend never falls back to OS-native input injection. Separate
mouse_down, mouse_up, key_down, and key_up calls return an explicit
unsupported-operation error; use drag, click, press_key, or hotkey
instead.
Each computer-server process opens a distinct driver session. Its capture scope
defaults to desktop, which enables the get_desktop_state command and
screen-absolute actions. Select auto or window with --capture-scope when a
stricter session policy is required. In auto, call escalate_capture_scope
with the concrete ladder-exhaustion reason before using desktop-only actions;
computer-server never escalates implicitly. Strict window sessions cannot
escalate. The equivalent environment variables are
CUA_DRIVER_MODE, CUA_DRIVER_SOCKET, CUA_DRIVER_SESSION_ID, and
CUA_DRIVER_CAPTURE_SCOPE.
Resolution Scaling
When running on Retina displays or in VMs where the coordinate system may differ, use the --width and --height flags to specify the target resolution:
- Screenshots will be resized to the target resolution
- Click coordinates received will be scaled from target to actual screen coordinates
- Cursor position will be reported in target coordinates
This ensures the AI model sees consistent coordinates between screenshots and mouse actions.
Claude Code Integration
- Start the server (or run as a service/LaunchAgent):
python -m computer_server --port 8000
- Add the MCP server URL to Claude Code:
claude mcp add cua-computer-server --transport http http://localhost:8000/mcp
Available MCP Tools
The MCP interface exposes 40+ tools for computer control:
Screen & Mouse
computer_screenshot- Capture current screencomputer_click- Click at coordinatescomputer_double_click- Double-clickcomputer_move- Move cursorcomputer_drag- Drag from start to end coordinatescomputer_scroll- Scroll at positioncomputer_get_screen_size- Get screen dimensionscomputer_get_cursor_position- Get cursor position
Keyboard
computer_type- Type textcomputer_press_key- Press a single keycomputer_hotkey- Press key combination (e.g., Ctrl+C)computer_key_down/computer_key_up- Hold/release keys
Clipboard
computer_clipboard_get- Get clipboard contentcomputer_clipboard_set- Set clipboard content
Shell
computer_run_command- Execute shell command
File System
computer_file_read/computer_file_write- Read/write filescomputer_file_exists/computer_directory_exists- Check existencecomputer_list_directory- List directory contentscomputer_create_directory- Create directorycomputer_delete_file/computer_delete_directory- Delete files/directories
Window Management
computer_open- Open file or URLcomputer_launch_app- Launch applicationcomputer_get_active_window- Get active windowcomputer_activate_window- Focus a windowcomputer_minimize_window/computer_maximize_window- Window statecomputer_close_window- Close window
Accessibility
computer_get_accessibility_tree- Get UI element treecomputer_find_element- Find UI element by role/title
Metadata
Release files for cua-computer-server 0.3.45
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cua_computer_server-0.3.45.tar.gz | 132.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cua_computer_server-0.3.45-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 265.2 kB
Release files / cua_computer_server-0.3.45.tar.gz
| Download URL | cua_computer_server-0.3.45.tar.gz |
|---|---|
| Size | 132.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad64cd4526a7ee6715a4e56cd0479bb31ed31f9702f4875ea436887aabcc8ffa
|
|
BLAKE2b-256 checksum How to use checksums |
526703f658b0e3a81dc87cd060f9b3b70cabe62eaa3add03eb314a6099328acb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / cua_computer_server-0.3.45-py3-none-any.whl
| Download URL | cua_computer_server-0.3.45-py3-none-any.whl |
|---|---|
| Size | 132.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6821d30f15a4c576b6f7dee25171fa45dfcc732fe3c4889894eb233169bdc7f
|
|
BLAKE2b-256 checksum How to use checksums |
05cc753a1d54449f9856645e041db38cf1cf098206c937c64249a82f668769bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|