The Computer Control MCP server enables computer automation and interaction through an API-driven interface. It provides capabilities for mouse and keyboard control, OCR text recognition, screenshot capture, and window management using PyAutoGUI, RapidOCR, and ONNXRuntime with zero external dependencies.
Set up the MCP server in your configuration file:
{
"mcpServers": {
"computer-control-mcp": {
"command": "uvx",
"args": ["computer-control-mcp@latest"]
}
}
}
Note: The first time you run uvx computer-control-mcp@latest
, it will download Python dependencies (approximately 70MB) which may take some time. Running this command in a terminal before using it as an MCP server is recommended.
Install globally with pip:
pip install computer-control-mcp
Then run the server:
computer-control-mcp
click_screen(x=500, y=300)
move_mouse(x=500, y=300)
drag_mouse(from_x=100, from_y=100, to_x=300, to_y=300, duration=0.5)
type_text(text="Hello, world!")
press_key(key="enter")
Basic screenshot:
take_screenshot()
Screenshot with OCR text extraction:
take_screenshot(with_ocr_text_and_coords=True)
Screenshot of specific window:
take_screenshot(title_pattern="Notepad")
Save screenshot to downloads folder:
take_screenshot(save_to_downloads=True)
get_screen_size()
List all open windows:
list_windows()
Activate a specific window:
activate_window(title_pattern="Chrome", threshold=60)
The server has been tested primarily on Windows but should work on other platforms as well.
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