Computer Control MCP is a server implementing Model Context Protocol (MCP) that provides computer control capabilities through Python. It allows automated control of mouse movements, keyboard input, OCR text recognition, window management, and screenshot functions - similar to Anthropic's 'computer-use' functionality but with zero external dependencies.
The quickest way to set up the Computer Control MCP server is using uvx
:
{
"mcpServers": {
"computer-control-mcp": {
"command": "uvx",
"args": ["computer-control-mcp@latest"]
}
}
}
Note: Running
uvx computer-control-mcp@latest
for the first time will download Python dependencies (approximately 70MB), which may take some time. It's recommended to run this in a terminal before using it as an MCP server.
Alternatively, you can install it globally using pip:
pip install computer-control-mcp
Then run the server with:
computer-control-mcp
click_screen(x: int, y: int) # Click at specified screen coordinates
move_mouse(x: int, y: int) # Move mouse cursor to specified coordinates
drag_mouse(from_x: int, from_y: int, to_x: int, to_y: int, duration: float = 0.5) # Drag mouse from one position to another
mouse_down(button: str = "left") # Hold down a mouse button ('left', 'right', 'middle')
mouse_up(button: str = "left") # Release a mouse button ('left', 'right', 'middle')
type_text(text: str) # Type the specified text at current cursor position
press_key(key: str) # Press a specified keyboard key
key_down(key: str) # Hold down a specific keyboard key until released
key_up(key: str) # Release a specific keyboard key
press_keys(keys: Union[str, List[Union[str, List[str]]]]) # Press keyboard keys (supports single keys, sequences, and combinations)
take_screenshot(title_pattern: str = None, use_regex: bool = False, threshold: int = 60, scale_percent_for_ocr: int = None, save_to_downloads: bool = False) # Capture screen or window
take_screenshot_with_ocr(title_pattern: str = None, use_regex: bool = False, threshold: int = 10, scale_percent_for_ocr: int = None, save_to_downloads: bool = False) # Extract and return text with coordinates using OCR
get_screen_size() # Get current screen resolution
list_windows() # List all open windows
activate_window(title_pattern: str, use_regex: bool = False, threshold: int = 60) # Bring specified window to foreground
If you need assistance with the Computer Control MCP server, you can contact:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "computer-control-mcp" '{"command":"uvx","args":["computer-control-mcp@latest"]}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"computer-control-mcp": {
"command": "uvx",
"args": [
"computer-control-mcp@latest"
]
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"computer-control-mcp": {
"command": "uvx",
"args": [
"computer-control-mcp@latest"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect