chore: import upstream snapshot with attribution
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
# 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`
|
||||
4. Set custom file icon (platform-specific):
|
||||
- macOS: Uses `fileicon` (install with `brew install fileicon`)
|
||||
- Windows/Linux: Not yet supported
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
desktop-extension/
|
||||
├── README.md # This file
|
||||
├── manifest.json # Extension manifest
|
||||
├── desktop_extension.png # Extension icon
|
||||
├── requirements.txt # Python dependencies
|
||||
├── run_server.sh # Server launcher script
|
||||
├── setup.py # Dependency installer
|
||||
└── cua-extension.mcpb # Generated extension archive
|
||||
```
|
||||
|
||||
## 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
|
||||
- `desktop_extension.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).
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"manifest_version": "0.2",
|
||||
"name": "cua-mcp-server",
|
||||
"display_name": "Cua Computer-Use Agent",
|
||||
"version": "1.0.0",
|
||||
"description": "Computer-Use Agent (Cua) MCP server for desktop automation and interaction",
|
||||
"long_description": "The Cua Computer-Use Agent extension provides powerful desktop automation capabilities through Claude Desktop. It can take screenshots, interact with applications, and execute complex computer tasks using AI agents. Perfect for automating repetitive desktop workflows, testing applications, and performing computer-based tasks through natural language instructions.",
|
||||
"author": {
|
||||
"name": "Cua",
|
||||
"email": "hello@trycua.com",
|
||||
"url": "https://trycua.com"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/trycua/cua"
|
||||
},
|
||||
"homepage": "https://trycua.com",
|
||||
"documentation": "https://docs.trycua.com",
|
||||
"support": "https://github.com/trycua/cua/issues",
|
||||
"icon": "desktop_extension.png",
|
||||
"server": {
|
||||
"type": "python",
|
||||
"entry_point": "server.py",
|
||||
"mcp_config": {
|
||||
"command": "${__dirname}/run_server.sh",
|
||||
"args": ["${__dirname}/server.py"],
|
||||
"env": {
|
||||
"PYTHONPATH": "${__dirname}",
|
||||
"API_KEY": "${user_config.api_key}",
|
||||
"CUA_MODEL_NAME": "${user_config.model_name}",
|
||||
"CUA_MAX_IMAGES": "${user_config.max_images}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tools": [
|
||||
{
|
||||
"name": "screenshot_cua",
|
||||
"description": "Take a screenshot of the current desktop screen and return the image"
|
||||
},
|
||||
{
|
||||
"name": "run_cua_task",
|
||||
"description": "Run a Computer-Use Agent task on the desktop and return the result with screenshot"
|
||||
},
|
||||
{
|
||||
"name": "run_multi_cua_tasks",
|
||||
"description": "Run multiple Computer-Use Agent tasks sequentially or concurrently"
|
||||
},
|
||||
{
|
||||
"name": "get_session_stats",
|
||||
"description": "Get statistics about active sessions and resource usage"
|
||||
},
|
||||
{
|
||||
"name": "cleanup_session",
|
||||
"description": "Cleanup a specific session and release its resources"
|
||||
}
|
||||
],
|
||||
"keywords": ["automation", "computer-use", "desktop", "ai-agent", "productivity"],
|
||||
"license": "MIT",
|
||||
"user_config": {
|
||||
"api_key": {
|
||||
"type": "string",
|
||||
"title": "API Key",
|
||||
"description": "Your API key for the AI model (Anthropic, OpenAI, etc.)",
|
||||
"sensitive": true,
|
||||
"required": true
|
||||
},
|
||||
"model_name": {
|
||||
"type": "string",
|
||||
"title": "Model Name",
|
||||
"description": "The AI model to use for computer tasks (e.g., anthropic/claude-sonnet-4-20250514, openai/gpt-4o)",
|
||||
"default": "anthropic/claude-sonnet-4-20250514",
|
||||
"required": false
|
||||
},
|
||||
"max_images": {
|
||||
"type": "number",
|
||||
"title": "Maximum Images",
|
||||
"description": "Maximum number of recent images to keep in context (default: 3)",
|
||||
"default": 3,
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# Core MCP dependencies
|
||||
mcp>=1.6.0,<2.0.0
|
||||
|
||||
# Cua Agent dependencies
|
||||
cua-agent[all]>=0.4.0,<0.5.0
|
||||
cua-computer>=0.4.0,<0.5.0
|
||||
|
||||
# Additional dependencies for async operations
|
||||
anyio>=4.0.0
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Wrapper script to ensure we use the correct Python with dependencies
|
||||
|
||||
# Try different Python paths in order of preference
|
||||
PYTHON_PATHS=(
|
||||
"/Users/yellcw/Documents/GitHub/cua/.venv/bin/python"
|
||||
"/opt/homebrew/bin/python3"
|
||||
"/usr/local/bin/python3"
|
||||
"python3"
|
||||
)
|
||||
|
||||
# Find the first Python that has the required packages
|
||||
for python_path in "${PYTHON_PATHS[@]}"; do
|
||||
if command -v "$python_path" >/dev/null 2>&1; then
|
||||
# Check if it has the required packages
|
||||
if "$python_path" -c "import mcp, anyio" >/dev/null 2>&1; then
|
||||
echo "Using Python: $python_path" >&2
|
||||
exec "$python_path" "$@"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# If no Python with packages found, try to install them
|
||||
echo "No Python with required packages found. Attempting to install..." >&2
|
||||
for python_path in "${PYTHON_PATHS[@]}"; do
|
||||
if command -v "$python_path" >/dev/null 2>&1; then
|
||||
echo "Installing packages with: $python_path" >&2
|
||||
if "$python_path" -m pip install mcp anyio cua-agent[all] cua-computer >/dev/null 2>&1; then
|
||||
echo "Packages installed successfully with: $python_path" >&2
|
||||
exec "$python_path" "$@"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Failed to find or install Python with required packages" >&2
|
||||
exit 1
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Setup script for Cua Desktop Extension
|
||||
Installs required dependencies if not available
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def check_and_install_package(package_name, import_name=None):
|
||||
"""Check if a package is available, install if not."""
|
||||
if import_name is None:
|
||||
import_name = package_name
|
||||
|
||||
try:
|
||||
__import__(import_name)
|
||||
print(f"✓ {package_name} is available")
|
||||
return True
|
||||
except ImportError:
|
||||
print(f"⚠ {package_name} not found, installing...")
|
||||
try:
|
||||
subprocess.check_call([sys.executable, "-m", "pip", "install", package_name])
|
||||
print(f"✓ {package_name} installed successfully")
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"✗ Failed to install {package_name}: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def main():
|
||||
"""Install required packages."""
|
||||
print("Setting up Cua Desktop Extension dependencies...")
|
||||
|
||||
# Required packages
|
||||
packages = [
|
||||
("mcp", "mcp"),
|
||||
("anyio", "anyio"),
|
||||
("cua-agent[all]", "agent"),
|
||||
("cua-computer", "computer"),
|
||||
]
|
||||
|
||||
all_installed = True
|
||||
for package, import_name in packages:
|
||||
if not check_and_install_package(package, import_name):
|
||||
all_installed = False
|
||||
|
||||
if all_installed:
|
||||
print("✓ All dependencies are ready!")
|
||||
return 0
|
||||
else:
|
||||
print("✗ Some dependencies failed to install")
|
||||
return 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user