The MCP server for Computer-Use Agent (CUA) allows you to run CUA through Claude Desktop or other MCP clients, enabling AI assistants to perform tasks on your computer through a standardized interface.
Before installing the MCP server, you need to set up the full Computer-Use Agent capabilities, which includes:
Make sure these prerequisites are completed and working before proceeding.
Install the package from PyPI:
pip install cua-mcp-server
This will install:
cua-mcp-server
script in your PATHFor a simplified installation, use this one-liner:
curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/mcp-server/scripts/install_mcp_server.sh | bash
This script will:
The server is configured using environment variables:
Variable | Description | Default |
---|---|---|
CUA_AGENT_LOOP |
Agent loop to use (OPENAI, ANTHROPIC, UITARS, OMNI) | OMNI |
CUA_MODEL_PROVIDER |
Model provider (ANTHROPIC, OPENAI, OLLAMA, OAICOMPAT) | ANTHROPIC |
CUA_MODEL_NAME |
Model name to use | None (provider default) |
CUA_PROVIDER_BASE_URL |
Base URL for provider API | None |
CUA_MAX_IMAGES |
Maximum number of images to keep in context | 3 |
To use with Claude Desktop, add an entry to your Claude Desktop configuration (claude_desktop_config.json
, typically found in ~/.config/claude-desktop/
):
{
"mcpServers": {
"cua-agent": {
"command": "/bin/bash",
"args": ["~/.cua/start_mcp_server.sh"],
"env": {
"CUA_AGENT_LOOP": "OMNI",
"CUA_MODEL_PROVIDER": "ANTHROPIC",
"CUA_MODEL_NAME": "claude-3-7-sonnet-20250219",
"CUA_PROVIDER_API_KEY": "your-api-key"
}
}
}
}
For more information on MCP with Claude Desktop, see the official MCP User Guide.
To use with Cursor, add an MCP configuration file in one of these locations:
.cursor/mcp.json
in your project directory~/.cursor/mcp.json
in your home directoryFor more information on MCP with Cursor, see the official Cursor MCP documentation.
Once configured, you can simply ask Claude to perform computer tasks:
The MCP server exposes the following tools to Claude:
run_cua_task
- Run a single Computer-Use Agent task with the given instructionrun_multi_cua_tasks
- Run multiple tasks in sequenceIf you get a path error, try changing the path to the script to be absolute instead of relative.
To see the logs:
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
API Keys: Ensure you have valid API keys:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.