desk-mcp
A desktop automation MCP server that enables AI agents to interact with Linux environments through screenshots, window inspection, and input simulation. It provides tools for mouse control, keyboard input, and screen capture using xdotool and XDG Desktop Portals.
README
desk-mcp
0 Trust – 100% Control | 0 Magic – 100% Transparency
Desktop automation MCP for AI agents — screenshot, mouse, keyboard, window inspection. Lets any MCP-capable agent (Claude, Gemini, Codex, Copilot, Vibe) see and interact with the KpihX-Ubuntu desktop.
The Problem
AI agents are blind to the desktop by default. They can read files and call APIs, but
they cannot see what is on screen, click buttons, type in forms, or react to GUI state.
desk-mcp bridges that gap — it exposes the desktop as a set of simple MCP tools that
any agent can call over the standard stdio transport.
Agent CLI ──stdio──► desk-mcp ──XDG Portal──► Screenshot
└───────xdotool───────► Click / Type / Key / Scroll
└───────xdotool───────► Window list & geometry
Architecture
desk-mcp serve (FastMCP, stdio transport)
│
├── screenshot() XDG Desktop Portal → /usr/bin/python3 + dbus + GLib
│ Full screen → optional crop (window name or {x,y,w,h})
│
├── get_windows() xdotool search + getwindowgeometry
├── get_screen() xdotool getdisplaygeometry + env vars
│
├── click() xdotool mousemove + click
├── double_click() xdotool click --repeat 2
├── right_click() xdotool click 3
├── move_mouse() xdotool mousemove
├── type_text() xdotool type --delay <ms>
├── key() xdotool key --clearmodifiers <combo>
└── scroll() xdotool click (button 4/5/6/7)
Screenshot backend: XDG Desktop Portal via dbus-python + GLib. Works natively
on GNOME Wayland without any dialog or user interaction. Does NOT depend on
gnome-screenshot or grim.
Input backend: xdotool via XWayland. Covers all X11 and XWayland apps.
For pure Wayland-native apps (e.g. WaveTerm in native mode), mouse coordinates are
correct but window auto-detection via get_windows() may not see them.
Install
Prerequisites
sudo apt install xdotool python3-gi python3-dbus
From PyPI
uv tool install desk-mcp
Editable (development)
git clone git@github.com:KpihX/desk-mcp.git ~/Work/AI/MCPs/desk_mcp
cd ~/Work/AI/MCPs/desk_mcp
uv tool install --editable .
Usage
Claude Code (~/.claude.json)
"desk-mcp": {
"command": "/home/kpihx/.local/bin/desk-mcp",
"args": ["serve"],
"env": {
"DISPLAY": ":0",
"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
"XDG_RUNTIME_DIR": "/run/user/1000",
"WAYLAND_DISPLAY": "wayland-0"
}
}
Note: The display env vars must be injected explicitly because Claude Code does not inherit the user's graphical session environment.
Gemini (~/.gemini/extensions/desk-mcp/gemini-extension.json)
{
"name": "desk-mcp",
"version": "0.2.0",
"description": "Desktop automation MCP for Gemini — screenshot, mouse, keyboard via xdotool.",
"mcpServers": {
"desk-mcp": {
"command": "/home/kpihx/.local/bin/desk-mcp",
"args": ["serve"],
"env": {}
}
}
}
CLI test
desk-mcp status # check environment and tool availability
desk-mcp screenshot # take a test screenshot and print the path
desk-mcp serve # start the MCP server (stdio)
Tools
| Tool | Description |
|---|---|
screenshot |
Full screen or cropped to window name / region {x,y,w,h} |
get_windows |
List all XWayland-visible windows with IDs and geometry |
get_screen |
Screen resolution, session type, display vars |
click |
Left / right / middle click at (x, y) |
double_click |
Double-click at (x, y) |
right_click |
Right-click at (x, y) — opens context menu |
move_mouse |
Move mouse without clicking |
type_text |
Type text at current keyboard focus |
key |
Press key combo: "ctrl+c", "Return", "super", "alt+F4" |
scroll |
Scroll up/down/left/right at (x, y) |
Repos
- GitHub: https://github.com/KpihX/desk-mcp
- GitLab: https://gitlab.com/kpihx/desk-mcp
- PyPI: https://pypi.org/project/desk-mcp/
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。