Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Update to install script

f-trycua887546a6694e
diff --git a/libs/mcp-server/README.md b/libs/mcp-server/README.md
index 6459931df5..e531270060 100644
--- a/libs/mcp-server/README.md
+++ b/libs/mcp-server/README.md
@@ -33,20 +33,26 @@ This will install:
## Easy Setup Script
-If you want to simplify installation, you can use this one-liner to download and run a setup script:
+If you want to simplify installation, you can use this one-liner to download and run the installation script:
```bash
-curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/mcp-server/scripts/run_mcp_server.sh | bash
+curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/mcp-server/scripts/install_mcp_server.sh | bash
```
-Or use the script directly in your MCP configuration like this:
+This script will:
+- Create the ~/.cua directory if it doesn't exist
+- Generate a startup script at ~/.cua/start_mcp_server.sh
+- Make the script executable
+- The startup script automatically manages Python virtual environments and installs/updates the cua-mcp-server package
+
+You can then use the script in your MCP configuration like this:
```json
{
"mcpServers": {
"cua-agent": {
"command": "/bin/bash",
- "args": ["-c", "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/mcp-server/scripts/run_mcp_server.sh | bash"],
+ "args": ["~/.cua/start_mcp_server.sh"],
"env": {
"CUA_AGENT_LOOP": "OMNI",
"CUA_MODEL_PROVIDER": "ANTHROPIC",
@@ -58,8 +64,6 @@ Or use the script directly in your MCP configuration like this:
}
```
-This script will automatically check if cua-mcp-server is installed, install it if needed, and run it.
-
## Claude Desktop Integration
To use with Claude Desktop, add an entry to your Claude Desktop configuration (`claude_desktop_config.json`, typically found in `~/.config/claude-desktop/`):
diff --git a/libs/mcp-server/scripts/run_mcp_server.sh b/libs/mcp-server/scripts/install_mcp_server.sh
similarity index 76%
rename from libs/mcp-server/scripts/run_mcp_server.sh
rename to libs/mcp-server/scripts/install_mcp_server.sh
index 3db9e3cfde..30e844b9fb 100755
--- a/libs/mcp-server/scripts/run_mcp_server.sh
+++ b/libs/mcp-server/scripts/install_mcp_server.sh
@@ -2,6 +2,15 @@
set -e
+# Create the ~/.cua directory if it doesn't exist
+mkdir -p "$HOME/.cua"
+
+# Create start_mcp_server.sh script in ~/.cua directory
+cat > "$HOME/.cua/start_mcp_server.sh" << 'EOF'
+#!/bin/bash
+
+set -e
+
# Function to check if a directory is writable
is_writable() {
[ -w "$1" ]
@@ -30,11 +39,13 @@ fi
# Check if Python is installed
if ! command_exists python3; then
+ echo "Error: Python 3 is not installed." >&2
exit 1
fi
# Check if pip is installed
if ! command_exists pip3; then
+ echo "Error: pip3 is not installed." >&2
exit 1
fi
@@ -54,3 +65,9 @@ pip install --upgrade "cua-mcp-server" >/dev/null 2>&1
cd "$VENV_DIR" # Change to venv directory to avoid current directory in path
python3 -c "from mcp_server.server import main; main()"
+EOF
+
+# Make the script executable
+chmod +x "$HOME/.cua/start_mcp_server.sh"
+
+echo "MCP server startup script created at $HOME/.cua/start_mcp_server.sh"