Production-Ready Model Context Protocol (MCP) server with enterprise-grade features: robust screenshot capture (DXGI + MSS), real-time health monitoring, automatic retry logic, multi-monitor support, and comprehensive error recovery. For Claude Desktop, OpenFang, and custom agent loops.
healthy / degraded / unhealthymss.mss() with mss.MSS()llama.cpp (Gemma-4-12B, Qwen2-VL)# Clone the repository
git clone https://github.com/RhushabhVaghela/Computer-Use.git
cd Computer-Use
# Install dependencies (creates .venv automatically)
.venv\Scripts\activate
pip install -r requirements.txt
# Optional: Install DirectX capture for best screenshot performance
pip install dxcam numpy
# Optional: Install system monitoring
pip install psutil
# Configure environment
copy .env.example .env
.env# REQUIRED: Path to Open Interpreter
OI_PATH="D:/Agents-and-other-repos/open-interpreter"
# Screenshot capture (NEW!)
SCREENSHOT_BACKEND=auto # auto, dxgi, mss_gdi, pil_grab
SCREENSHOT_CACHE_ENABLED=true
SCREENSHOT_CACHE_TTL=0.1 # seconds
# Retry configuration (NEW!)
SCREENSHOT_MAX_RETRIES=3
SCREENSHOT_RETRY_BASE_DELAY=0.1
SCREENSHOT_RETRY_MAX_DELAY=2.0
# Health monitoring (NEW!)
HEALTH_MONITOR_ENABLED=true
HEALTH_MONITOR_INTERVAL=60 # seconds
# Mouse/keyboard tuning
MCP_MOVE_DURATION_MS=150
MCP_TYPE_INTERVAL_SEC=0.02
# UI scanning
MCP_AUTO_SCAN_ON_CHANGE=1
MCP_AUTO_SCAN_MAX_ELEMENTS=60
# Security
ALLOW_UNSAFE_COMMANDS=false
RISKY_ACTION_ENABLED=true
COMPUTER_ACTION_RATE_LIMIT=60
Windows:
start_agent.bat
Linux/macOS:
./start_agent.sh
Menu Options:
| Mode | Entry Point | Tools | Best For |
|---|---|---|---|
| Standard MCP | src/server.py | 8 tools | Claude Desktop, OpenFang |
| Hybrid MCP | src/hybrid_server.py | 20 tools | Deep browser automation |
| Voice Agent | src/voice_server.py | Voice + computer | Real-time voice interaction |
| Text Agent | src/run_agent.py | Computer only | Terminal execution |
| Tool | Description |
|---|---|
computer | Mouse/keyboard: move, click, type, scroll, drag, screenshot |
read_screen_ui | Hierarchical UI tree (Windows UIAutomation) |
bash | Safe shell execution with command sandboxing |
browser_action | Launch/control browser with isolated profiles |
browser_use_dom | Deep DOM extraction via Browser-Use |
terminate_task | Signal task completion |
rename_file | File operations (move/rename) |
update_thought | Live thought overlay updates |
bu_browser_navigate, bu_browser_click, bu_browser_typebu_browser_scroll, bu_browser_extract_contentbu_browser_go_back, bu_browser_list_tabsbu_browser_switch_tab, bu_browser_close_tabbu_retry_with_browser_use_agentbu_browser_list_sessions, bu_browser_close_session, bu_browser_close_allPython API:
from health_monitor import health_check_endpoint
health = health_check_endpoint()
print(f"Status: {health['status']}")
print(f"CPU: {health['system']['cpu_percent']:.1f}%")
print(f"Memory: {health['system']['memory_percent']:.1f}%")
print(f"Tool success rate: {health['tools']['success_rate']*100:.1f}%")
print(f"Screenshot backend: {health['screenshots']['backend']}")
print(f"Recommendations: {health['recommendations']}")
Example Response:
{
"status": "healthy",
"uptime_seconds": 3600.5,
"system": {
"cpu_percent": 15.2,
"memory_percent": 45.8,
"memory_used_mb": 512.3
},
"process": {
"cpu_percent": 8.5,
"memory_mb": 256.7,
"threads": 12
},
"tools": {
"total_calls": 1523,
"success_rate": 0.987,
"errors_last_hour": 3
},
"screenshots": {
"backend": "dxgi",
"success_rate": 0.995,
"avg_time_ms": 45.2
},
"recommendations": []
}
The robust capture system automatically selects the best backend:
Automatic retry with exponential backoff ensures reliability.
# Install DirectX capture (recommended)
pip install dxcam numpy
# Verify installation
python -c "import dxcam; print('DXGI ready')"
| Backend | Avg Time | Success Rate | RDP/VM |
|---|---|---|---|
| DXGI | 45ms | 99.9% | β |
| MSS GDI | 60ms | 85-95% | β |
| PIL | 120ms | 99% | β οΈ |
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"computer-use": {
"command": "D:/Agents-and-other-repos/Computer-Use/.venv/Scripts/python.exe",
"args": ["src/server.py", "--stdio"],
"cwd": "D:/Agents-and-other-repos/Computer-Use",
"env": {
"OI_PATH": "D:/Agents-and-other-repos/open-interpreter",
"SCREENSHOT_BACKEND": "auto"
}
}
}
}
npx @modelcontextprotocol/inspector python src/server.py --stdio
# Windows
platforms\openfang\bridge.ps1
# Linux/macOS
platforms\openfang\bridge.sh
rm -rf /, format, shutdown)ALLOW_UNSAFE_COMMANDS=true for trusted environments onlylogs/computer_actions.logRISKY_ACTION_ENABLED=false requires user confirmationCOMPUTER_ACTION_RATE_LIMIT=60 actions per minutelogs/computer_actions.log regularlyRISKY_ACTION_ENABLED=false for shared systems# Activate venv
.venv\Scripts\activate
# Run pytest
pytest tests/ -v
# Expected output: 10/10 tests passing
# Full integration test
.venv\Scripts\python.exe tests/test_mcp_full_smoke.py
# Expected: 22-23/23 steps passing
# (Screenshot may fail in some Windows sessions - known BitBlt issue)
.venv\Scripts\python.exe tests/test_mcp_coordinates.py
# Expected: PASS (delta=0,0)
from health_monitor import get_health_monitor
monitor = get_health_monitor()
metrics = monitor.get_metrics()
assert metrics.status == "healthy"
assert metrics.tool_success_rate > 0.95
assert metrics.screenshot_success_rate > 0.90
Symptom: Windows graphics function failed: BitBlt
Solutions:
pip install dxcam numpySCREENSHOT_BACKEND=dxgi in .envSymptom: Memory > 75%, status = "degraded"
Solutions:
MCP_AUTO_SCAN_MAX_ELEMENTSSCREENSHOT_CACHE_ENABLED=trueSymptom: Tool success rate < 80%
Solutions:
logs/mcp_server.logOI_PATH is correctpytest tests/ to verify setupWe welcome contributions! Please:
pytest tests/ -vAreas we'd love help:
MIT License - See LICENSE file.
Status: Production Ready β
Last Updated: 2026-07-13
Version: 2.0.0 (Ultimate)
19 commits
Python
79.2%
HTML
12.9%
PowerShell
3.6%
Shell
2.3%
Batchfile
1.5%
Production-Ready Model Context Protocol (MCP) server with enterprise-grade features: robust screenshot capture (DXGI + MSS), real-time health monitoring, automatic retry logic, multi-monitor support, and comprehensive error recovery. For Claude Desktop, OpenFang, and custom agent loops.
healthy / degraded / unhealthymss.mss() with mss.MSS()llama.cpp (Gemma-4-12B, Qwen2-VL)# Clone the repository
git clone https://github.com/RhushabhVaghela/Computer-Use.git
cd Computer-Use
# Install dependencies (creates .venv automatically)
.venv\Scripts\activate
pip install -r requirements.txt
# Optional: Install DirectX capture for best screenshot performance
pip install dxcam numpy
# Optional: Install system monitoring
pip install psutil
# Configure environment
copy .env.example .env
.env# REQUIRED: Path to Open Interpreter
OI_PATH="D:/Agents-and-other-repos/open-interpreter"
# Screenshot capture (NEW!)
SCREENSHOT_BACKEND=auto # auto, dxgi, mss_gdi, pil_grab
SCREENSHOT_CACHE_ENABLED=true
SCREENSHOT_CACHE_TTL=0.1 # seconds
# Retry configuration (NEW!)
SCREENSHOT_MAX_RETRIES=3
SCREENSHOT_RETRY_BASE_DELAY=0.1
SCREENSHOT_RETRY_MAX_DELAY=2.0
# Health monitoring (NEW!)
HEALTH_MONITOR_ENABLED=true
HEALTH_MONITOR_INTERVAL=60 # seconds
# Mouse/keyboard tuning
MCP_MOVE_DURATION_MS=150
MCP_TYPE_INTERVAL_SEC=0.02
# UI scanning
MCP_AUTO_SCAN_ON_CHANGE=1
MCP_AUTO_SCAN_MAX_ELEMENTS=60
# Security
ALLOW_UNSAFE_COMMANDS=false
RISKY_ACTION_ENABLED=true
COMPUTER_ACTION_RATE_LIMIT=60
Windows:
start_agent.bat
Linux/macOS:
./start_agent.sh
Menu Options:
| Mode | Entry Point | Tools | Best For |
|---|---|---|---|
| Standard MCP | src/server.py | 8 tools | Claude Desktop, OpenFang |
| Hybrid MCP | src/hybrid_server.py | 20 tools | Deep browser automation |
| Voice Agent | src/voice_server.py | Voice + computer | Real-time voice interaction |
| Text Agent | src/run_agent.py | Computer only | Terminal execution |
| Tool | Description |
|---|---|
computer | Mouse/keyboard: move, click, type, scroll, drag, screenshot |
read_screen_ui | Hierarchical UI tree (Windows UIAutomation) |
bash | Safe shell execution with command sandboxing |
browser_action | Launch/control browser with isolated profiles |
browser_use_dom | Deep DOM extraction via Browser-Use |
terminate_task | Signal task completion |
rename_file | File operations (move/rename) |
update_thought | Live thought overlay updates |
bu_browser_navigate, bu_browser_click, bu_browser_typebu_browser_scroll, bu_browser_extract_contentbu_browser_go_back, bu_browser_list_tabsbu_browser_switch_tab, bu_browser_close_tabbu_retry_with_browser_use_agentbu_browser_list_sessions, bu_browser_close_session, bu_browser_close_allPython API:
from health_monitor import health_check_endpoint
health = health_check_endpoint()
print(f"Status: {health['status']}")
print(f"CPU: {health['system']['cpu_percent']:.1f}%")
print(f"Memory: {health['system']['memory_percent']:.1f}%")
print(f"Tool success rate: {health['tools']['success_rate']*100:.1f}%")
print(f"Screenshot backend: {health['screenshots']['backend']}")
print(f"Recommendations: {health['recommendations']}")
Example Response:
{
"status": "healthy",
"uptime_seconds": 3600.5,
"system": {
"cpu_percent": 15.2,
"memory_percent": 45.8,
"memory_used_mb": 512.3
},
"process": {
"cpu_percent": 8.5,
"memory_mb": 256.7,
"threads": 12
},
"tools": {
"total_calls": 1523,
"success_rate": 0.987,
"errors_last_hour": 3
},
"screenshots": {
"backend": "dxgi",
"success_rate": 0.995,
"avg_time_ms": 45.2
},
"recommendations": []
}
The robust capture system automatically selects the best backend:
Automatic retry with exponential backoff ensures reliability.
# Install DirectX capture (recommended)
pip install dxcam numpy
# Verify installation
python -c "import dxcam; print('DXGI ready')"
| Backend | Avg Time | Success Rate | RDP/VM |
|---|---|---|---|
| DXGI | 45ms | 99.9% | β |
| MSS GDI | 60ms | 85-95% | β |
| PIL | 120ms | 99% | β οΈ |
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"computer-use": {
"command": "D:/Agents-and-other-repos/Computer-Use/.venv/Scripts/python.exe",
"args": ["src/server.py", "--stdio"],
"cwd": "D:/Agents-and-other-repos/Computer-Use",
"env": {
"OI_PATH": "D:/Agents-and-other-repos/open-interpreter",
"SCREENSHOT_BACKEND": "auto"
}
}
}
}
npx @modelcontextprotocol/inspector python src/server.py --stdio
# Windows
platforms\openfang\bridge.ps1
# Linux/macOS
platforms\openfang\bridge.sh
rm -rf /, format, shutdown)ALLOW_UNSAFE_COMMANDS=true for trusted environments onlylogs/computer_actions.logRISKY_ACTION_ENABLED=false requires user confirmationCOMPUTER_ACTION_RATE_LIMIT=60 actions per minutelogs/computer_actions.log regularlyRISKY_ACTION_ENABLED=false for shared systems# Activate venv
.venv\Scripts\activate
# Run pytest
pytest tests/ -v
# Expected output: 10/10 tests passing
# Full integration test
.venv\Scripts\python.exe tests/test_mcp_full_smoke.py
# Expected: 22-23/23 steps passing
# (Screenshot may fail in some Windows sessions - known BitBlt issue)
.venv\Scripts\python.exe tests/test_mcp_coordinates.py
# Expected: PASS (delta=0,0)
from health_monitor import get_health_monitor
monitor = get_health_monitor()
metrics = monitor.get_metrics()
assert metrics.status == "healthy"
assert metrics.tool_success_rate > 0.95
assert metrics.screenshot_success_rate > 0.90
Symptom: Windows graphics function failed: BitBlt
Solutions:
pip install dxcam numpySCREENSHOT_BACKEND=dxgi in .envSymptom: Memory > 75%, status = "degraded"
Solutions:
MCP_AUTO_SCAN_MAX_ELEMENTSSCREENSHOT_CACHE_ENABLED=trueSymptom: Tool success rate < 80%
Solutions:
logs/mcp_server.logOI_PATH is correctpytest tests/ to verify setupWe welcome contributions! Please:
pytest tests/ -vAreas we'd love help:
MIT License - See LICENSE file.
Status: Production Ready β
Last Updated: 2026-07-13
Version: 2.0.0 (Ultimate)
19 commits
Python
79.2%
HTML
12.9%
PowerShell
3.6%
Shell
2.3%
Batchfile
1.5%