Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
add claude desktop extension build script
Adam8da83f6f0a43
diff --git a/.gitignore b/.gitignoreindex 8cae22ceec..aaedc221b6 100644--- a/.gitignore+++ b/.gitignore@@ -2,14 +2,11 @@__pycache__/*.py[cod]*$py.class-# C extensions*.so-node_modules/**/node_modules**/node_modules-# Distribution / packaging.Pythonbuild/@@ -31,17 +28,14 @@ share/python-wheels/.installed.cfg*.eggMANIFEST-# PyInstaller# Usually these files are written by a python script from a template# before PyInstaller builds the exe, so as to inject date/other infos into it.*.manifest*.spec-# Installer logspip-log.txtpip-delete-this-directory.txt-# Unit test / coverage reportshtmlcov/.tox/@@ -56,52 +50,39 @@ coverage.xml.hypothesis/.pytest_cache/cover/-# Translations*.mo*.pot-# Django stuff:*.loglocal_settings.pydb.sqlite3db.sqlite3-journal-# Flask stuff:instance/.webassets-cache-# Scrapy stuff:.scrapy-# Sphinx documentationdocs/_build/-# PyBuilder.pybuilder/target/-# Jupyter Notebook.ipynb_checkpoints-# IPythonprofile_default/ipython_config.py-.pdm.toml.pdm-python.pdm-build/-# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm__pypackages__/-# Celery stuffcelerybeat-schedulecelerybeat.pid-# SageMath parsed files*.sage.py-# Environments.env.venv@@ -110,89 +91,63 @@ venv/ENV/env.bak/venv.bak/-# Git worktrees.worktrees/-# Spyder project settings.spyderproject.spyproject-# Rope project settings.ropeproject-# mkdocs documentation/site-# mypy.mypy_cache/.dmypy.jsondmypy.json-# Scriptsserver/scripts/-# Pyre type checker.pyre/-# pytype static type analyzer.pytype/-# Cython debug symbolscython_debug/-# Ruff stuff:.ruff_cache/-# PyPI configuration file.pypirc-# Conda.conda/-# Local environment.env.local-# macOS DS_Store.DS_Store-weights/weights/icon_detect/weights/icon_detect/model.ptweights/icon_detect/model.pt.zipweights/icon_detect/model.pt.zip.part*-libs/python/omniparser/weights/icon_detect/model.pt-# Example test data and outputexamples/test_data/examples/output/-/screenshots/-/experiments/-/logs/-# Xcode## gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore-## User settingsxcuserdata/-## Obj-C/Swift specific*.hmap-## App packaging*.ipa*.dSYM.zip*.dSYM-## Playgroundstimeline.xctimelineplayground.xcworkspace-# Swift Package Manager## Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.@@ -205,7 +160,6 @@ playground.xcworkspace# hence it is not needed unless you have added a package configuration file to your project.swiftpm/.build/-# CocoaPods## We recommend against adding the Pods directory to your .gitignore. However@@ -216,13 +170,11 @@ playground.xcworkspace## Add this line if you want to avoid checking in source code from the Xcode workspace# *.xcworkspace-# Carthage## Add this line if you want to avoid checking in source code from Carthage dependencies.# Carthage/CheckoutsCarthage/Build/-# fastlane## It is recommended to not store the screenshots in the git repo.@@ -233,30 +185,21 @@ fastlane/report.xmlfastlane/Preview.htmlfastlane/screenshots/**/*.pngfastlane/test_output-# Ignore folderignore-# .release.release/-# Shared foldershared-# Trajectoriestrajectories/-# Installation ID Storage.storage/-# Gradio settings.gradio_settings.json-# Lumier Storagestorage/-# Trashes.Trashes.Trash-1000/-post-provision\ No newline at end of filediff --git a/libs/python/mcp-server/README.md b/libs/python/mcp-server/README.mdindex 7eddf4b725..d1e59dca44 100644--- a/libs/python/mcp-server/README.md+++ b/libs/python/mcp-server/README.md@@ -102,6 +102,31 @@ Expected results:- Assistant messages streamed during execution- A final screenshot image+## Desktop Extension++CUA also provides a Claude Desktop Extension (`.mcpb` file) for easy one-click installation.++### Building the Desktop Extension++To build the desktop extension from source:++```bash+cd libs/python/mcp-server+python3 build-extension.py+```++This creates `desktop-extension/cua-extension.mcpb` which can be installed directly in Claude Desktop.++### Installing the Desktop Extension++1. Build the extension (see above)+2. Open Claude Desktop Settings+3. Go to Extensions+4. Drop the `cua-extension.mcpb` file into the window+5. Follow the installation prompts++See [desktop-extension/README.md](desktop-extension/README.md) for more details.+## Documentation- Installation: https://trycua.com/docs/libraries/mcp-server/installationdiff --git a/libs/python/mcp-server/build-extension.py b/libs/python/mcp-server/build-extension.pynew file mode 100755index 0000000000..10c0064625--- /dev/null+++ b/libs/python/mcp-server/build-extension.py@@ -0,0 +1,111 @@+#!/usr/bin/env python3+"""+Build script for CUA Desktop Extension (.mcpb file)++This script:+1. Creates a temporary build directory+2. Copies necessary files from mcp_server/ to the build directory+3. Copies manifest and other static files+4. Creates a .mcpb (zip) file+5. Cleans up the temporary directory++Usage:+ python build-extension.py+"""++import os+import shutil+import sys+import tempfile+import zipfile+from pathlib import Path+++def main():+ """Build the desktop extension."""+ # Get the script directory (libs/python/mcp-server)+ script_dir = Path(__file__).parent+ repo_root = script_dir.parent.parent.parent++ # Define paths+ output_dir = script_dir / "desktop-extension"+ output_file = output_dir / "cua-extension.mcpb"++ # Source directories+ mcp_server_dir = script_dir / "mcp_server"++ # Required files to copy+ files_to_copy = {+ "manifest.json": output_dir / "manifest.json",+ "logo_black.png": output_dir / "logo_black.png",+ "requirements.txt": output_dir / "requirements.txt",+ "run_server.sh": output_dir / "run_server.sh",+ "setup.py": output_dir / "setup.py",+ }++ # MCP server files to copy+ mcp_server_files = [+ "server.py",+ "session_manager.py",+ ]++ print("Building CUA Desktop Extension...")+ print(f" Output: {output_file}")++ # Create temporary build directory+ with tempfile.TemporaryDirectory(prefix="cua-extension-build-") as build_dir:+ build_path = Path(build_dir)++ # Copy MCP server files+ print(" Copying MCP server files...")+ for filename in mcp_server_files:+ src = mcp_server_dir / filename+ dst = build_path / filename+ if src.exists():+ shutil.copy2(src, dst)+ print(f" ✓ {filename}")+ else:+ print(f" ✗ {filename} (not found)")+ sys.exit(1)++ # Copy static files from desktop-extension directory+ print(" Copying static files...")+ for src_name, src_path in files_to_copy.items():+ if src_path.exists():+ dst = build_path / src_name+ # Special handling for shell script - ensure executable+ shutil.copy2(src_path, dst)+ if src_name.endswith(".sh"):+ os.chmod(dst, 0o755)+ print(f" ✓ {src_name}")+ else:+ print(f" ✗ {src_name} (not found)")+ sys.exit(1)++ # Validate manifest.json exists+ manifest_path = build_path / "manifest.json"+ if not manifest_path.exists():+ print(" ✗ manifest.json not found in build directory")+ sys.exit(1)++ # Create the .mcpb file (zip archive)+ print(" Creating .mcpb archive...")+ with zipfile.ZipFile(output_file, "w", zipfile.ZIP_DEFLATED) as zipf:+ # Add all files from build directory to the zip+ for root, dirs, files in os.walk(build_path):+ # Skip __pycache__ and other unwanted directories+ dirs[:] = [d for d in dirs if d not in ["__pycache__", ".git"]]++ for file in files:+ file_path = Path(root) / file+ # Use relative path from build directory as archive name+ arcname = file_path.relative_to(build_path)+ zipf.write(file_path, arcname)+ print(f" ✓ Added {arcname}")++ print(f"✓ Build complete: {output_file}")+ print(f" Archive size: {output_file.stat().st_size / 1024:.1f} KB")+++if __name__ == "__main__":+ main()diff --git a/libs/python/mcp-server/desktop-extension/README.md b/libs/python/mcp-server/desktop-extension/README.mdnew file mode 100644index 0000000000..42b1f92b1d--- /dev/null+++ b/libs/python/mcp-server/desktop-extension/README.md@@ -0,0 +1,63 @@+# CUA Desktop Extension++This directory contains the build artifacts for the CUA Desktop Extension (`.mcpb` file).++## Building the Extension++To build the extension, run the build script from the parent directory:++```bash+cd /path/to/libs/python/mcp-server+python3 build-extension.py+```++This will:++1. Copy the MCP server code from `mcp_server/` directory+2. Copy static files (manifest, icons, scripts)+3. Create a `.mcpb` zip archive in `desktop-extension/cua-extension.mcpb`++## Directory Structure++```+desktop-extension/+├── README.md # This file+├── manifest.json # Extension manifest+├── logo_black.png # Extension icon+├── requirements.txt # Python dependencies+├── run_server.sh # Server launcher script+├── setup.py # Dependency installer+└── cua-extension.mcpb # Generated extension archive (gitignored)+```++## Source Files++The actual MCP server code lives in `../mcp_server/`:++- `server.py` - Main MCP server implementation+- `session_manager.py` - Session management and resource pooling++## Static Files++These files are maintained in this directory:++- `manifest.json` - Extension metadata and configuration+- `logo_black.png` - Extension icon+- `requirements.txt` - Python package dependencies+- `run_server.sh` - Shell script to launch the server+- `setup.py` - Python script to install dependencies++## Generated Files++The `.mcpb` file is generated by the build script and is gitignored.++## Installing the Extension++Once built, you can install the extension in Claude Desktop by:++1. Opening Claude Desktop Settings+2. Going to the Extensions section+3. Dropping the `cua-extension.mcpb` file into the window+4. Following the installation prompts++For more information, see the [Anthropic Desktop Extensions documentation](https://www.anthropic.com/engineering/desktop-extensions).diff --git a/libs/python/mcp-server/desktop-extension/cua-extension.mcpb b/libs/python/mcp-server/desktop-extension/cua-extension.mcpbnew file mode 100644index 0000000000..5ff52e5a78Binary files /dev/null and b/libs/python/mcp-server/desktop-extension/cua-extension.mcpb differdiff --git a/libs/python/mcp-server/desktop-extension/desktop-extension.mcpb b/libs/python/mcp-server/desktop-extension/desktop-extension.mcpbdeleted file mode 100644index 1337b778c2..0000000000Binary files a/libs/python/mcp-server/desktop-extension/desktop-extension.mcpb and /dev/null differ