Server component for the Computer-Use Interface (CUI) framework powering Cua
Project description
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]
Usage
# Start the server on default port 8000
python -m computer_server
# Or with custom port
python -m computer_server --port 8080
# With resolution scaling (useful for Retina displays or VMs)
python -m computer_server --width 1512 --height 982
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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cua_computer_server-0.3.37.tar.gz.
File metadata
- Download URL: cua_computer_server-0.3.37.tar.gz
- Upload date:
- Size: 113.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a24ed8cd37417990c0a1b0e468a873f46dc11573e4922967f7eb6562a4d8ea48
|
|
| MD5 |
e37e55ddd08bdc46a353587d3d75f606
|
|
| BLAKE2b-256 |
5af0a9de4e19b6b1a681a3d955edf5e53d36f27ff9e54a9577637323bfc53efb
|
File details
Details for the file cua_computer_server-0.3.37-py3-none-any.whl.
File metadata
- Download URL: cua_computer_server-0.3.37-py3-none-any.whl
- Upload date:
- Size: 120.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8ed02fc15f98a25faf3a5f41d92973aae33d3f11fbc25712e77c495fa2b49d3
|
|
| MD5 |
11b16c79038a9588ea1da0f9459c9f62
|
|
| BLAKE2b-256 |
f824d13e6bc8d785f91f85a7f89d28816e7474401e8910704b00eb110c41aba7
|