Computer Control MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Computer Control MCP
MCP server that provides computer control capabilities using PyAutoGUI.
Expecting Issues
Most Models are too slow with MCP server + PyAutoGUI
Screenshot consumes a lot of tokens
It is diffcult for the model to click at the right position
Potential
By using this generic mcp server, model can take all the actions locally
The actuation layer is extremely thin
Quick Usage (MCP Setup)
Option 1: Using Local Development Version
{
"mcpServers": {
"computer-control-mcp": {
"command": "python3",
"args": ["-m", "computer_use_mcp"],
"cwd": "/path/to/your/computer-control-mcp"
}
}
}Option 2: Using Global Installation
First install globally:
pip3 install -e . --break-system-packagesThen use this configuration:
{
"mcpServers": {
"computer-control-mcp": {
"command": "python3",
"args": ["-m", "computer_use_mcp"]
}
}
}Option 3: Using uvx (Remote Version)
{
"mcpServers": {
"computer-control-mcp": {
"command": "uvx",
"args": ["computer-control-mcp@latest"]
}
}
}Related MCP server: computer-control-mcp
Features
Control mouse movements and clicks (left and right click)
Type text at the current cursor position
Take screenshots of the entire screen or specific windows with optional saving to downloads directory
Extract text from screenshots using OCR (Optical Character Recognition)
List and activate windows (adapted to newer pygetwindow API)
Press keyboard keys
Drag and drop operations
Image compression to handle large screenshots
Automatic cleanup of temporary files
Available Tools
Mouse Control
click_screen(x: int, y: int): Left click at specified screen coordinatesright_click(x: int, y: int): Right click at specified screen coordinatesmove_mouse(x: int, y: int): Move mouse cursor to specified coordinatesdrag_mouse(from_x: int, from_y: int, to_x: int, to_y: int, duration: float = 0.5): Drag mouse from one position to another
Keyboard Control
type_text(text: str): Type the specified text at current cursor positionpress_key(key: str): Press a specified keyboard key
Screen and Window Management
take_screenshot(title_pattern: str = None, use_regex: bool = False, threshold: int = 60, with_ocr_text_and_coords: bool = False, scale_percent_for_ocr: int = 100, save_to_downloads: bool = False): Capture screen or window with optional OCRget_screen_size(): Get current screen resolutionlist_windows(): List all open windows with active window detectionactivate_window(title_pattern: str, use_regex: bool = False, threshold: int = 60): Find and report matching windows
Recent Improvements
✅ API Compatibility
Fixed pygetwindow API issues - Updated to work with newer version that returns strings instead of window objects
Removed deprecated functions - Eliminated
getAllWindows()andVisResusageImproved error handling - Better exception handling for API limitations
✅ New Features
Right-click functionality - Added
right_click()function for right mouse button clicksImage compression - Automatic resizing and compression to stay within Claude Desktop's 1MB limit
Temporary file cleanup - Automatic cleanup of test files and temporary screenshots
✅ Testing & Quality
Comprehensive test suite - 10/10 tests passing with full coverage
Proper test organization - Moved development files to tests directory
Performance optimization - Removed screenshots from window listing to reduce response size
Current Limitations
Due to changes in the pygetwindow API:
Window activation is limited (can detect but not fully control windows)
Window properties (position, size) are not available in newer API
Window manipulation is restricted to detection and reporting
Development
Setting up the Development Environment
# Clone the repository
git clone https://github.com/zhouyuf6741/computer-use-mcp.git
cd computer-control-mcp
# Install dependencies with dev tools
uv sync --extra dev
# Start server
python3 -m computer_use_mcp.coreRunning Tests
# Run all tests
uv run pytest tests/ -v
# Run specific test categories
uv run pytest tests/test_basic.py -v
uv run pytest tests/test_screenshot.py -v
uv run pytest tests/test_window_functions.py -v
uv run pytest tests/test_ocr_standalone.py -vTest Coverage
✅ Basic Functionality (4 tests)
Screen size detection
Tool version information
Mouse control functions
Keyboard control functions
✅ Screenshot & OCR (3 tests)
Basic screenshot functionality
Screenshot with download saving
OCR text extraction (89+ text elements detected)
✅ Window Management (3 tests)
Window listing (52+ windows detected)
Window activation detection
API compatibility verification
Troubleshooting
Common Issues
"No module named 'pyautogui'": Install the package globally with
pip3 install -e . --break-system-packages"module 'pygetwindow' has no attribute 'getAllWindows'": This is expected with newer versions. The code has been updated to handle this limitation.
"result exceeds maximum length": Screenshots are automatically compressed. If you still get this error, try using
scale_percent_for_ocr=50when taking screenshots.Permission issues on macOS: You may need to grant accessibility permissions to your terminal/IDE in System Preferences > Security & Privacy > Privacy > Accessibility.
Performance Tips
Use
scale_percent_for_ocr=50for faster OCR processingAvoid taking screenshots with OCR unless necessary
The
list_windows()function no longer includes screenshots to reduce response sizeTemporary files are automatically cleaned up after processing
API Reference
See the API Reference for detailed information about the available functions and classes.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Reach your own computers from any AI app: files, commands, screen and mouse, approvals and alerts.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables full desktop automation on macOS through natural language, including mouse control, keyboard input, screen capture, and GUI interaction using PyAutoGUI.5-
- AlicenseNot gradedqualityDmaintenanceEnables computer control via mouse, keyboard, OCR, and screen/window management, similar to Anthropic's computer-use.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI to capture screenshots and control mouse and keyboard for automated desktop interaction.-
- FlicenseNot gradedqualityBmaintenanceExposes GUI automation tools to control mouse, keyboard, and screen of the local machine via PyAutoGUI.-