Sponsored by Deepsite.site

Cua Agent

Created By
libsa year ago
Content
Cua logo

Python Swift macOS Discord

Cua (pronounced "koo-ah", short for Computer-Use Agent) is an open-source framework that combines high-performance virtualization with AI agent capabilities to enable secure, isolated environments for AI systems to interact with desktop applications.

What is Cua?

Cua offers two primary capabilities in a single integrated framework:

  1. High-Performance Virtualization - Create and run macOS/Linux virtual machines on Apple Silicon with near-native performance (up to 90% of native speed) using Apple's Virtualization.Framework.

  2. Computer-Use Interface & Agent - A framework that allows AI systems to observe and control these virtual environments - interacting with applications, browsing the web, writing code, and performing complex workflows.

Why Use Cua?

  • Security & Isolation: Run AI agents in fully isolated virtual environments instead of giving them access to your main system
  • Performance: Near-native performance on Apple Silicon
  • Flexibility: Run macOS or Linux environments with the same framework
  • Reproducibility: Create consistent, deterministic environments for AI agent workflows
  • LLM Integration: Built-in support for connecting to various LLM providers

System Requirements

  • Mac with Apple Silicon (M1/M2/M3/M4 series)
  • macOS 14 (Sonoma) or newer
  • Python 3.10+ (for Computer and Agent libraries)
  • Disk space for VM images (40GB+ recommended)

Quick Start

Option 1: Lume CLI Only (VM Management)

If you only need the virtualization capabilities:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"

For Lume usage instructions, refer to the Lume documentation.

Option 2: Full Computer-Use Agent Capabilities

If you want to use AI agents with virtualized environments:

  1. Install the Lume CLI:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
    
  2. Install the Python libraries:

    pip install cua-computer cua-agent[all]
    
  3. Use the libraries in your Python code:

    from cua.computer import Computer
    from cua.agent import ComputerAgent, LLM, AgentLoop, LLMProvider
    
    async with Computer(verbosity=logging.DEBUG) as macos_computer:
      agent = ComputerAgent(
          computer=macos_computer,
          loop=AgentLoop.OPENAI, # or AgentLoop.ANTHROPIC, or AgentLoop.OMNI
          model=LLM(provider=LLMProvider.OPENAI) # or LLM(provider=LLMProvider.ANTHROPIC)
      )
    
      tasks = [
          "Look for a repository named trycua/cua on GitHub.",
      ]
    
      for task in tasks:
        async for result in agent.run(task):
          print(result)
    

    Explore the Agent Notebook for a ready-to-run example.

  4. Optionally, you can use the Agent with a Gradio UI:

    from utils import load_dotenv_files
    load_dotenv_files()
     
    from agent.ui.gradio.app import create_gradio_ui
    
    app = create_gradio_ui()
    app.launch(share=False)
    
  5. For Developers only (contribute and use latest features):

    # Clone the repository
    git clone https://github.com/trycua/cua.git
    cd cua
    
    # Open the project in VSCode
    code ./vscode/py.code-workspace
    
    # Build the project
    ./scripts/build.sh
    

    See our Developer-Guide for more information.

Monorepo Libraries

LibraryDescriptionInstallationVersion
LumeCLI for running macOS/Linux VMs with near-native performance using Apple's Virtualization.Framework.DownloadGitHub release
ComputerComputer-Use Interface (CUI) framework for interacting with macOS/Linux sandboxespip install cua-computerPyPI
AgentComputer-Use Agent (CUA) framework for running agentic workflows in macOS/Linux dedicated sandboxespip install cua-agentPyPI

Docs

For the best onboarding experience with the packages in this monorepo, we recommend starting with the Computer documentation to cover the core functionality of the Computer sandbox, then exploring the Agent documentation to understand Cua's AI agent capabilities, and finally working through the Notebook examples.

Demos

Demos of the Computer-Use Agent in action. Share your most impressive demos in Cua's Discord community!

AI-Gradio: multi-app workflow requiring browser, VS Code and terminal access
Notebook: Fix GitHub issue in Cursor

Accessory Libraries

LibraryDescriptionInstallationVersion
CoreCore functionality and utilities used by other Cua packagespip install cua-corePyPI
PyLumePython bindings for Lumepip install pylumePyPI
Computer ServerServer component for the Computer-Use Interface (CUI) frameworkpip install cua-computer-serverPyPI
SOMSelf-of-Mark library for Agentpip install cua-somPyPI

Contributing

We welcome and greatly appreciate contributions to Cua! Whether you're improving documentation, adding new features, fixing bugs, or adding new VM images, your efforts help make lume better for everyone. For detailed instructions on how to contribute, please refer to our Contributing Guidelines.

Join our Discord community to discuss ideas or get assistance.

License

Cua is open-sourced under the MIT License - see the LICENSE file for details.

Trademarks

Apple, macOS, and Apple Silicon are trademarks of Apple Inc. Ubuntu and Canonical are registered trademarks of Canonical Ltd. This project is not affiliated with, endorsed by, or sponsored by Apple Inc. or Canonical Ltd.

Stargazers over time

Stargazers over time

Contributors

f-trycua
f-trycua

💻
Pedro Piñera Buendía
Pedro Piñera Buendía

💻
Amit Kumar
Amit Kumar

💻
Dung Duc Huynh (Kaka)
Dung Duc Huynh (Kaka)

💻
Zayd Krunz
Zayd Krunz

💻
Prashant Raj
Prashant Raj

💻
Leland Takamine
Leland Takamine

💻
ddupont
ddupont

💻
Ethan Gutierrez
Ethan Gutierrez

💻

Server Config

{
  "mcpServers": {
    "cua-agent": {
      "command": "/bin/bash",
      "args": [
        "/Users/francescobonacci/.cua/start_mcp_server.sh"
      ],
      "env": {
        "CUA_AGENT_LOOP": "OMNI",
        "CUA_MODEL_PROVIDER": "ANTHROPIC",
        "CUA_MODEL_NAME": "claude-3-7-sonnet-20250219",
        "ANTHROPIC_API_KEY": "your-api-key"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Tavily Mcp
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.