Skip to main content

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 /mcp endpoint

Android emulators also expose the emulator's built-in EmulatorController gRPC service on port 8554 (via -grpc 8554 launch flag). Local Android sandboxes (AndroidEmulatorRuntime) use GRPCEmulatorTransport to call getScreenshot() 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, /status endpoints
  • MCP server at /mcp endpoint (requires fastmcp package)

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

  1. Start the server (or run as a service/LaunchAgent):
python -m computer_server --port 8000
  1. 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 screen
  • computer_click - Click at coordinates
  • computer_double_click - Double-click
  • computer_move - Move cursor
  • computer_drag - Drag from start to end coordinates
  • computer_scroll - Scroll at position
  • computer_get_screen_size - Get screen dimensions
  • computer_get_cursor_position - Get cursor position

Keyboard

  • computer_type - Type text
  • computer_press_key - Press a single key
  • computer_hotkey - Press key combination (e.g., Ctrl+C)
  • computer_key_down / computer_key_up - Hold/release keys

Clipboard

  • computer_clipboard_get - Get clipboard content
  • computer_clipboard_set - Set clipboard content

Shell

  • computer_run_command - Execute shell command

File System

  • computer_file_read / computer_file_write - Read/write files
  • computer_file_exists / computer_directory_exists - Check existence
  • computer_list_directory - List directory contents
  • computer_create_directory - Create directory
  • computer_delete_file / computer_delete_directory - Delete files/directories

Window Management

  • computer_open - Open file or URL
  • computer_launch_app - Launch application
  • computer_get_active_window - Get active window
  • computer_activate_window - Focus a window
  • computer_minimize_window / computer_maximize_window - Window state
  • computer_close_window - Close window

Accessibility

  • computer_get_accessibility_tree - Get UI element tree
  • computer_find_element - Find UI element by role/title

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cua_computer_server-0.3.30.tar.gz (111.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cua_computer_server-0.3.30-py3-none-any.whl (122.5 kB view details)

Uploaded Python 3

File details

Details for the file cua_computer_server-0.3.30.tar.gz.

File metadata

  • Download URL: cua_computer_server-0.3.30.tar.gz
  • Upload date:
  • Size: 111.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for cua_computer_server-0.3.30.tar.gz
Algorithm Hash digest
SHA256 11e0080d62c5c6edb14c35671c3de4b39b3c13df65eaa8a378dc7d1439059706
MD5 cfb236e01eaaceb62ca6ff18eace5e38
BLAKE2b-256 c310dca87e59a2a5174c57422fd7cbbec067400458e78075ae9b4a537a880378

See more details on using hashes here.

File details

Details for the file cua_computer_server-0.3.30-py3-none-any.whl.

File metadata

File hashes

Hashes for cua_computer_server-0.3.30-py3-none-any.whl
Algorithm Hash digest
SHA256 05d929c8f6612409f245e6b87a0e3e2e4e9e6ba5ea8feb7658964a7874bad655
MD5 9db9bad646eb2b4aee558f75a6e49ef7
BLAKE2b-256 1ea48f8d1f8109c7dbc20e0a337b00cbe0261fa43c2e8914e526f882d88e6bf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page