Universal interface for controlling desktop applications through AI agents.
core/— wrapper loader and confirmation layerwrappers/— per-application wrappers (starting with Blender)tests/— wrapper testsdeskbridge.py— main CLI entry point
python deskbridge.py blender render --file scene.blend --output out.png --confirmWithout --confirm, a confirmation prompt is displayed for risky actions.
python deskbridge.py install <app_name>Creates a scaffold under wrappers/<app_name>/ with manifest.json, actions.py, and cli.py.
Development:
python hub/app.pyThen open http://127.0.0.1:5000/.
Production (waitress WSGI server):
python hub/run_production.pypython deskbridge.py log [limit]Displays recent activity log entries (newest first). Optional limit restricts the number of entries.
python deskbridge.py chartGenerates an SVG bar chart of activity statistics (success vs. failure per wrapper) and saves it to reports/activity_chart.svg.
python deskbridge.py desktop <action> [options]Controls any desktop application through screenshots, mouse clicks, keyboard input, scrolling, and dragging via the Hermes computer_use tool. Available actions:
capture— Take a screenshot (--app,--mode som|vision|ax)click— Click an element (--element,--coordinate X Y,--app,--button,--delivery-mode background|foreground,--confirm)type— Type text (text,--app,--delivery-mode,--confirm)key— Press key combo (keys, e.g.ctrl+s,return,--app,--delivery-mode,--confirm)scroll— Scroll (direction up|down|left|right,--amount,--app,--delivery-mode)drag— Drag between elements (--from-element,--from-coordinate X Y,--to-element,--to-coordinate X Y,--app,--delivery-mode,--confirm)list-apps— List running applicationslist-windows— List open windowsfocus-app— Focus an application (app,--raise-window)
Risky actions (click, type, key, drag) require confirmation (y/n) unless --confirm is passed. All desktop actions are recorded in the activity log.
Note: Desktop control works with any registered backend. By default, DeskBridge tries the Hermes computer_use backend (when running inside the Hermes agent) and falls back to the PyAutoGUI backend (if pip install pyautogui has been done). If no backend is available, commands return a clear error explaining how to install one.
core.desktop_control uses a pluggable backend architecture so DeskBridge is
not locked to a single desktop automation vendor:
DesktopBackend— abstract base class; subclass it to add a new backend.HermesComputerUseBackend— wraps the Hermescomputer_usetool (cua-driver).PyAutoGUIBackend— wraps PyAutoGUI for cross-platform desktop control without the Hermes agent.DesktopController— auto-detects available backends and routes calls to the first one.
To add a non-Hermes backend (MCP, Claude Desktop, pyautogui, etc.):
from core.desktop_control import DesktopBackend, register_backend
class MCPDesktopBackend(DesktopBackend):
name = "mcp"
def capture(self, app=None, mode="som"): ...
def click(self, element=None, coordinate=None, app=None, ...): ...
# implement all abstract methods
register_backend(MCPDesktopBackend())Register backends before calling any desktop function. The controller tries backends in registration order and uses the first available one.
DeskBridge includes an MCP server so AI agents like Claude Desktop, Cursor, and other MCP-compatible agents can connect directly without custom code.
python mcp_server.pyThe server communicates over stdio and exposes 15 tools:
| Tool | Description |
|---|---|
desktop_capture |
Capture screenshot |
desktop_click |
Click element/coordinate |
desktop_type |
Type text |
desktop_key |
Press key combination |
desktop_scroll |
Scroll |
desktop_drag |
Drag between points |
desktop_list_apps |
List running applications |
desktop_list_windows |
List open windows |
desktop_focus_app |
Focus an application |
desktop_list_backends |
List desktop backends |
wrapper_call |
Call a wrapper action |
wrapper_install |
Install a new wrapper |
wrapper_list |
List installed wrappers |
activity_log_read |
Read activity log |
activity_chart_generate |
Generate activity chart |
Add to ~/.hermes/config.yaml:
mcp_servers:
deskbridge:
command: "python"
args: ["path/to/DeskBridge/mcp_server.py"]Replace path/to/DeskBridge/mcp_server.py with the actual path to your DeskBridge installation. Restart Hermes Agent. The MCP tools become available as mcp_deskbridge_* in every conversation.
Add to claude_desktop_config.json:
{
"mcpServers": {
"deskbridge": {
"command": "python",
"args": ["path/to/DeskBridge/mcp_server.py"]
}
}
}Replace path/to/DeskBridge/mcp_server.py with the actual path to your DeskBridge installation.
DeskBridge is designed to be safe, auditable, and transparent. Every action passes through centralized security checks before execution.
| Risk level | Behavior |
|---|---|
| low | Auto-approved, no prompt |
| medium | Requires explicit y/n confirmation (or --confirm flag) |
| high | Requires explicit y/n confirmation (or --confirm flag) |
How confirmation works:
- User runs a medium/high-risk action (e.g.
click,type,key,drag). - DeskBridge prints the action description and asks
Proceed? (y/n):. - Only
yapproves; anything else cancels. - The
--confirmflag skips the prompt (for automation/CI). - In non-interactive sessions (no TTY, e.g. CI/CD, MCP server), medium/high-risk actions are rejected unless
--confirmis passed. - Every decision (approved/rejected/cancelled) is recorded to
logs/activity.log.
Only apps with an installed wrapper under wrappers/<app>/manifest.json can be executed.
Only actions declared in that manifest's actions field are permitted.
Unknown apps and unknown actions are rejected before execution with a clear error.
All parameters are validated for type and range before being passed to a wrapper:
- Integer parameters must be integers (string coercion attempted).
- Numeric parameters can have
min/maxbounds. - Coordinate parameters must be
[x, y]pairs within valid bounds. - Invalid parameters raise a clear error and block execution.
Applications on the security block list (BLOCKED_APPS in core.confirm) are
rejected even if a wrapper is installed. Add dangerous system processes here.
Every action and confirmation decision is recorded to logs/activity.log as
one JSON record per line (JSON Lines / NDJSON):
{"timestamp": "2026-11-26T10:30:00.123456", "version": 1, "app": "blender", "action": "render", "args": {"file": "[REDACTED]", "output": "[REDACTED]"}, "status": "success", "message": "Render completed"}| Field | Description |
|---|---|
timestamp |
ISO 8601 timestamp when the action occurred |
version |
Log record schema version (currently 1) |
app |
Wrapper/application name |
action |
Action performed |
args |
Input arguments (sensitive values redacted) |
status |
success, failed, rejected, or cancelled |
message |
Detail message (sensitive content redacted) |
Sensitive data sanitization: File paths, text content, passwords, tokens,
and other potentially sensitive values are automatically replaced with
"[REDACTED]" before being written. The key is preserved for audit purposes.
Log rotation: When logs/activity.log exceeds 10 MB, it is rotated to
activity.log.1, activity.log.2, etc., up to 5 rotations. Oldest rotations
are deleted automatically.
Retention: Log records older than 30 days are automatically removed on each
write. Set RETENTION_DAYS = 0 in core.activity_log.py to disable.
No API keys, tokens, passwords, or credentials are stored in code or logs.
Read logs:
python deskbridge.py log [limit]Get log statistics:
from core.activity_log import get_log_stats
stats = get_log_stats()
# Returns total_entries, status_counts, app_counts, action_counts,
# oldest_timestamp, newest_timestamp, log_file_exists, log_file_size_bytesClear all logs (including rotated files):
# Programmatically:
from core.activity_log import clear_logs
clear_logs()All security checks (allowlist, parameter validation, confirmation) happen locally before any desktop action or wrapper code is executed. Nothing is sent to a remote server.
- Blender render wrapper
- Core loader + confirmation
- Activity log tracking
- Chart generation (SVG)
- Desktop control (computer_use + PyAutoGUI backends)
- MCP server (15 tools for Claude Desktop, Cursor, etc.)
- Simple CLI-Hub registry
- Second application wrapper (GIMP)
- Install command (
deskbridge install <app>) - Web install via CLI-Hub (
POST /install/<app>) - Production CLI-Hub (waitress)