Computer Control MCP server

Enables desktop automation through mouse control, keyboard input, screenshots, OCR, and window management for direct interaction with graphical user interfaces
Back to servers
Setup instructions
Provider
AB498
Release date
Apr 10, 2025
Language
Python
Package
Stats
15.8K downloads
65 stars

The Computer Control MCP server provides an interface for automated computer control, allowing you to programmatically control mouse movements, keyboard input, perform OCR, and manage windows. It's designed to work with the Model Context Protocol (MCP) specification.

Installation

You can install and run the Computer Control MCP server in two ways:

Using UVX

Add the following configuration to your MCP configuration file:

{
  "mcpServers": {
    "computer-control-mcp": {
      "command": "uvx",
      "args": ["computer-control-mcp@latest"]
    }
  }
}

Note: When running for the first time, this method will download Python dependencies (around 70MB) which may take some time. It's recommended to run this in a terminal before using it with MCP.

Using Pip

Alternatively, you can install the package globally using pip:

pip install computer-control-mcp

Then run the server with:

computer-control-mcp

Features

The Computer Control MCP server provides the following capabilities:

  • Mouse movement and click control
  • Text input at current cursor position
  • Screen and window screenshots
  • OCR text extraction from screen content
  • Window management (listing and activation)
  • Keyboard control
  • Drag and drop operations

Available Tools

Mouse Control

Control the mouse cursor position and actions:

# Click at specific screen coordinates
click_screen(100, 200)

# Move mouse cursor to specific coordinates
move_mouse(300, 400)

# Drag the mouse from one position to another
drag_mouse(100, 100, 300, 300, duration=0.5)

# Hold down a mouse button
mouse_down("left")

# Release a mouse button
mouse_up("left")

Keyboard Control

Control keyboard input:

# Type text at current cursor position
type_text("Hello, world!")

# Press a specific keyboard key
press_key("enter")

# Hold down a key
key_down("shift")

# Release a key
key_up("shift")

# Press key combinations
press_keys(["ctrl", "c"])  # Copy

Screen and Window Management

Capture and interact with the screen and windows:

# Take a screenshot of the entire screen
screenshot = take_screenshot()

# Take a screenshot of a specific window
screenshot = take_screenshot(title_pattern="Chrome")

# Extract text from screen using OCR
text_data = take_screenshot_with_ocr()

# Get screen resolution
screen_size = get_screen_size()

# List all open windows
windows = list_windows()

# Activate a specific window
activate_window("Notepad")

# Wait for a specified duration
wait_milliseconds(500)  # Wait for 500ms

Advanced Usage

OCR Text Extraction

Extract text from the screen with position information:

# Get text with coordinates from the current screen
text_with_coords = take_screenshot_with_ocr()

# Extract text from a specific window with custom settings
text_with_coords = take_screenshot_with_ocr(
    title_pattern="Chrome",
    use_regex=False,
    threshold=10,
    scale_percent_for_ocr=150,
    save_to_downloads=True
)

Window Management

Work with multiple windows:

# List all open windows
windows = list_windows()
print(windows)

# Activate a specific window using pattern matching
activate_window("Chrome")

# Use regex for more flexible window matching
activate_window(".*Google.*", use_regex=True)

Key Combinations

Perform complex keyboard operations:

# Press Ctrl+Alt+Delete
press_keys(["ctrl", "alt", "delete"])

# Perform a sequence of key presses
press_keys(["alt", "tab", "tab"])

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later