Integrates with the GNOME desktop environment to facilitate automated UI interactions and screen state monitoring using native tools and protocols.
Provides programmatic access to Linux desktops, allowing AI assistants to perform visual tasks such as clicking, typing, and capturing screen content.
Enables AI models to control Ubuntu desktop environments through screenshot analysis, UI element detection via AT-SPI, and simulated mouse and keyboard input.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Ubuntu Desktop Control MCPOpen the terminal and run system updates"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ubuntu Desktop Control MCP Server
An MCP (Model Context Protocol) server that enables LLMs to control your Ubuntu desktop by taking screenshots and sending mouse clicks. This allows AI assistants to visually interact with your desktop applications.
ā” NEW: Optimized Production Workflow
5x faster, 5x more accurate! Now using the same optimization techniques as Anthropic's Computer Use API:
šø Smart Screenshots: Auto-downsampled to 1280x720 (5x smaller)
šÆ Numbered Elements: See what's clickable at a glance with overlaid IDs
š¤ AT-SPI Integration: Automatic UI element detection using accessibility API
š Percentage Coords: Resolution-agnostic positioning (no more pixel hunting!)
ā” Workflow Batching: Execute multiple actions in one MCP call
šŖ Element Cache: Direct element interaction - "click element #5"
Example - Old way (8+ calls, ~15s):
Example - New way (1 call, ~3s):
See README.md for full details.
Features
šø Screenshot Capture: Annotated screenshots with automatic element detection
š¢ Element Detection: AT-SPI + CV fallback for robust UI element identification
š±ļø Smart Clicking: Click by element ID or percentage coordinates
āØļø Keyboard Control: Type text and press keys/hotkeys
šÆ Mouse Movement: Smooth cursor positioning with animation
š Workflow Batching: Execute multi-step tasks in single MCP call
š Diagnostics: Display scaling detection, warnings, and recommendations
Quick Start
1. Prerequisites
Ubuntu Linux (X11 required, Wayland not fully supported)
Python 3.9+
2. Installation
From PyPI (Recommended)
From Source
Configuration
Claude Code
Method 1: CLI (Recommended)
Method 2: Manual Config
Edit ~/.claude/claude_desktop_config.json:
VS Code Insiders
Method 1: MCP Command
Open Command Palette (
Ctrl+Shift+P)Run
MCP: Open Workspace Folder ConfigurationAdd the server configuration below.
Method 2: Manual Config
Create .vscode/mcp.json in your workspace:
Codex CLI
Method 1: CLI
Method 2: Manual Config
Edit ~/.config/codex/config.toml:
Tools
Core Capabilities
Tool | Description |
| Capture the desktop (optionally per-monitor) with annotated elements. |
| Click by element ID or percentage coordinates (supports per-monitor). |
| Move the cursor by element ID or percentage coordinates (supports per-monitor). |
| Drag the cursor to coordinates while holding a mouse button. |
| Type text using the keyboard. |
| Press a specific key (e.g., 'enter', 'esc'). |
| Press a combination of keys simultaneously (e.g., Ctrl+Shift+C). |
| Get screen dimensions and display server type (X11/Wayland). |
| Troubleshoot scaling and coordinate mismatches. |
| Detect and map UI elements (hitboxes) using Computer Vision. |
| Convert pixels from a screenshot to logical click coordinates. |
| List available prompt templates (for clients without native prompt support). |
| Execute a batch of actions (screenshot/click/move/type/wait). |
Prompt Rendering Tools
These tools allow clients without native prompt support (like Codex CLI) to render prompt templates as text.
Tool | Description |
| Render the baseline display check prompt. |
| Render the full desktop capture prompt. |
| Render the region capture prompt. |
| Render the coordinate conversion prompt. |
| Render the safe click prompt. |
| Render the hover and capture prompt. |
| Render the mismatch recovery prompt. |
| Render the end-to-end workflow prompt. |
Prompts
Prompt | Description |
| Check display settings and scaling before starting tasks. |
| Capture and summarize the full desktop state. |
| Capture a specific region for detailed inspection. |
| Perform a click with safety checks and scaling awareness. |
| Hover to reveal UI elements, then capture. |
| Diagnose and fix missed clicks. |
| Plan and execute a full interaction loop. |
Configuration & Customization
Environment Variables
The server relies on standard Linux/X11 environment variables to locate and interact with the desktop session.
Variable | Description | Default |
| X11 display identifier. Required for the server to know which screen to control. |
|
| Used to detect if running on X11 or Wayland. |
|
| Path to X11 authority file. Required if running from a different user context (e.g., sudo, docker) or over SSH. |
|
| Force coordinate clicks (disable AT-SPI action clicks). | unset |
Passing Environment Variables
You can customize these variables in your MCP client configuration.
Claude Desktop (claude_desktop_config.json)
VS Code (.vscode/mcp.json)
Display Scaling & Coordinates
If clicks land in the wrong place, you likely have a HiDPI display scaling mismatch (e.g., logical 1920x1080 vs physical 3840x2160).
Solutions:
Auto-scale: Use
click_screen(..., auto_scale=True)to let the server handle it.Diagnostics: Run
get_display_diagnostics()to see the scaling factor.Element IDs: Use
take_screenshot(detect_elements=True)and click viaelement_idor percentage coordinates.
Troubleshooting
"Screenshot failed": Ensure
gnome-screenshotorscrotis installed (sudo apt install gnome-screenshot)."PyAutoGUI not installed": Ensure you are using the
.venvpython.Wayland Issues: This server requires X11. Check with
echo $XDG_SESSION_TYPE. If "wayland", switch to "GNOME on Xorg" at login.Permission Denied: Run
xhost +local:if you have X11 permission issues.
Security
ā ļø Warning: This server gives LLMs full control over your mouse and visibility of your screen.
Only use with trusted clients.
Be aware screenshots may capture sensitive data.
Automated clicks can be destructive.
License
MIT License