mirror of
https://github.com/trycua/computer.git
synced 2026-01-03 20:10:04 -06:00
Fix script for pypi
This commit is contained in:
@@ -42,15 +42,17 @@ curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/mcp-server/scr
|
||||
Or use the script directly 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"],
|
||||
"env": {
|
||||
"CUA_AGENT_LOOP": "OMNI",
|
||||
"CUA_MODEL_PROVIDER": "ANTHROPIC",
|
||||
"CUA_MODEL_NAME": "claude-3-opus-20240229",
|
||||
"ANTHROPIC_API_KEY": "your-api-key"
|
||||
{
|
||||
"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"],
|
||||
"env": {
|
||||
"CUA_AGENT_LOOP": "OMNI",
|
||||
"CUA_MODEL_PROVIDER": "ANTHROPIC",
|
||||
"CUA_MODEL_NAME": "claude-3-7-sonnet-20250219",
|
||||
"ANTHROPIC_API_KEY": "your-api-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,22 +64,6 @@ This script will automatically check if cua-mcp-server is installed, install it
|
||||
|
||||
To use with Claude Desktop, add an entry to your Claude Desktop configuration (`claude_desktop_config.json`, typically found in `~/.config/claude-desktop/`):
|
||||
|
||||
```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"],
|
||||
"env": {
|
||||
"CUA_AGENT_LOOP": "OMNI",
|
||||
"CUA_MODEL_PROVIDER": "ANTHROPIC",
|
||||
"CUA_MODEL_NAME": "claude-3-opus-20240229",
|
||||
"ANTHROPIC_API_KEY": "your-api-key",
|
||||
"PYTHONIOENCODING": "utf-8"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more information on MCP with Claude Desktop, see the [official MCP User Guide](https://modelcontextprotocol.io/quickstart/user).
|
||||
|
||||
## Cursor Integration
|
||||
@@ -87,26 +73,6 @@ To use with Cursor, add an MCP configuration file in one of these locations:
|
||||
- **Project-specific**: Create `.cursor/mcp.json` in your project directory
|
||||
- **Global**: Create `~/.cursor/mcp.json` in your home directory
|
||||
|
||||
The configuration format is similar to Claude Desktop's:
|
||||
|
||||
```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"],
|
||||
"env": {
|
||||
"CUA_AGENT_LOOP": "OMNI",
|
||||
"CUA_MODEL_PROVIDER": "ANTHROPIC",
|
||||
"CUA_MODEL_NAME": "claude-3-7-sonnet-20250219",
|
||||
"ANTHROPIC_API_KEY": "your-api-key",
|
||||
"PYTHONPATH": "/path/to/your/cua/installation"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After configuration, you can simply tell Cursor's Agent to perform computer tasks by explicitly mentioning the CUA agent, such as "Use the computer control tools to open Safari."
|
||||
|
||||
For more information on MCP with Cursor, see the [official Cursor MCP documentation](https://docs.cursor.com/context/model-context-protocol).
|
||||
|
||||
@@ -22,23 +22,11 @@ if ! command_exists pip3; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the directory of this script
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
||||
|
||||
# Add the necessary paths to PYTHONPATH
|
||||
export PYTHONPATH="$PROJECT_ROOT:$PYTHONPATH"
|
||||
|
||||
# Change to project directory
|
||||
cd "$PROJECT_ROOT" 2>/dev/null
|
||||
|
||||
# Check if mcp_server package is installed
|
||||
if ! package_installed mcp_server; then
|
||||
# Check if setup.py or pyproject.toml exists
|
||||
if [ -f "setup.py" ] || [ -f "pyproject.toml" ]; then
|
||||
pip3 install --quiet --user -e . >/dev/null 2>&1
|
||||
fi
|
||||
pip3 install cua-mcp-server >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Run the server module directly - this is the only thing that should produce output
|
||||
exec python3 -m mcp_server.server
|
||||
exec python3 -c "from mcp_server.server import main; main()"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user