claude-linux-mcp
Linux Desktop — Claude Desktop 扩展
这是一个 Claude Desktop 扩展,为 Linux/X11 上的 Claude 提供完整的桌面控制能力:截图、鼠标、键盘、窗口管理、剪贴板和应用启动。
它填补了与 Windows-MCP 相同的生态位,但专为 Linux 设计。旨在与 claude-terminal-mcp 配合使用 —— Terminal 处理 shell 命令,而此扩展处理 GUI 操作。
⚠️ 安全提示 — 请先阅读
安装此扩展即赋予 Claude 对您桌面的完全控制权。 任何您可以通过键盘和鼠标执行的操作,Claude 都可以通过此工具完成:
将鼠标移动到任何位置并点击任何内容(包括对话框、“是”按钮、打开的聊天窗口中的发送按钮)
在当前获得焦点的任何窗口中输入内容(包括密码字段)
读取和写入您的剪贴板(因此您最近复制的任何内容都是可见的)
启动应用程序
关闭窗口(包括未保存的工作)
请将安装此扩展视为允许某人坐在您的桌前物理操作您的键盘和鼠标。如果机器上有您不希望 Claude 交互的敏感数据、在共享系统上,或者如果您打算让聊天窗口处于无人看管状态,请勿安装此扩展。
claude-terminal-mcp 使用的黑名单式保护在这里并不适用 —— 鼠标点击就是鼠标点击;您无法通过模式匹配来判断意图。v0.1 版本中的安全防护措施包括:(1) 本 README 中的诚实说明,(2) 每个更改系统状态的工具都带有 destructiveHint: true 注解,以便 Claude 自身的推理层能够感知,(3) 安装流程需要显式开启“扩展开发者模式”(显示红色的“未验证”警告)。
Related MCP server: desktop-mcp
功能介绍
包含十四个工具:
工具 | 用途 |
| 截取全屏(如果 |
| 枚举可见窗口及其 id/pid/几何位置/标题。 |
| 将窗口置于前台。 |
| 移动/调整窗口大小。 |
| 请求优雅地关闭窗口。 |
| 将指针移动到绝对屏幕坐标。 |
| 点击左/中/右键;可选坐标。 |
| 从一点拖动到另一点。 |
| 向指定方向滚动 N 次。 |
| 在获得焦点的窗口中输入字符串。 |
| 按下组合键,如 |
| 读取 CLIPBOARD 选择区作为文本。 |
| 将字符串写入 CLIPBOARD。 |
| 分离式启动应用程序(例如 |
所有工具均调用小型、知名的 X11 CLI 工具 —— 无需 npm 依赖。
要求
显示服务器: X11。v0.1 版本不支持 Wayland,因为 Wayland 的安全模型刻意阻止了跨进程输入注入。要检查您当前使用的会话:
echo $XDG_SESSION_TYPE如果显示 wayland,请注销并在登录界面选择“Ubuntu on Xorg”(或您发行版对应的选项)。
系统工具(一次性安装):
sudo apt install xdotool wmctrl xclipgnome-screenshot 随 Ubuntu GNOME 提供;如果您使用其他桌面环境,请安装截图工具:
# One of:
sudo apt install gnome-screenshot # GNOME, works everywhere
sudo apt install scrot # Minimal CLI
sudo apt install maim # Modern replacement for scrotOCR(可选,用于 screenshot_text — v0.2 新增):
sudo apt install tesseract-ocr tesseract-ocr-eng
# Add tesseract-ocr-<lang> for other languages (fra, deu, nld, …).如果未安装 tesseract,仅 screenshot_text 不可用 —— 其他 14 个工具可正常工作。
Claude Desktop: Linux 版 ≥ 0.10.0(内置了较新的 Node;无需系统 Node)。
安装
从 最新发布页面 下载
LinuxDesktop.mcpb。Claude Desktop → Settings → Extensions → Extension Developer 部分 → Install Extension → 选择
.mcpb文件。查看红色的“开发者信息未被 Anthropic 验证”警告。如果您信任该来源,请点击 Install。
回到 All extensions,确保 Linux Desktop 已开启。
在聊天中,打开连接器/工具选择器,并为该对话启用 Linux Desktop。
在首次调用工具时,如果服务器检测到缺少 X11 实用程序,会返回清晰的“使用 sudo apt install … 安装”错误提示 —— 您无需阅读完整的 README 即可知道缺少什么。
使用示例
尝试询问 Claude:
“截个图,告诉我屏幕上有什么。”
“列出我打开的窗口。”
“聚焦 Firefox 窗口。”
“打开 gnome-terminal,然后在里面输入
nvtop。”“将 'hello world' 复制到我的剪贴板。”
“将 Claude Desktop 窗口拖到屏幕左上角,调整大小为 800×600。”
“在活动窗口中向下滚动三次。”
已知限制 (v0.1)
仅限 X11。 Wayland 需要完全不同的方法(
ydotool+ 特权守护进程,用于截图的门户 API)。添加 Wayland 支持在路线图中,但并不简单。无 AT-SPI UI 检查。 v0.1 使用坐标 + 窗口标题工作。语义化目标定位(例如“点击发送按钮”)需要 AT-SPI 检查,这在 Electron/Chromium 应用上很麻烦,值得在 v0.2 中专门处理。
无 OCR。 截图是 PNG;Claude 使用其视觉能力读取它们。这在大多数用例中效果很好,但没有内置的“在屏幕上找到单词 'Cancel' 并点击它”的原语。
黄色“工具结果无法提交”横幅。 这是外观问题;在动态加载工具步骤时触发。同样影响官方的文件系统扩展。这不是本扩展的 Bug。
隐私政策
没有任何数据离开您的机器。 此扩展完全在本地运行:
数据收集: 无。该扩展不会向外发送数据、发出遥测信息或进行任何自身的网络请求。
数据使用与存储: 截图保存在
/tmp/claude-linux-mcp/shots/中,以便 Claude 可以在同一对话中稍后引用它们。扩展本身不会持久化存储其他任何内容。剪贴板:
clipboard_get()读取您当前 X11 CLIPBOARD 选择区的内容,并将其作为工具结果传回给 Claude Desktop。请像对待粘贴到聊天窗口一样对待它 —— 如果剪贴板上有敏感数据,请勿请求读取。第三方共享: 无。此扩展不会向 Anthropic、扩展作者或任何第三方传输任何内容。(Claude Desktop 本身作为正常聊天流程的一部分,会单独将工具输入/输出发送给 Anthropic —— 这是 Anthropic 与您之间的关系,而非此扩展的关系。)
保留期限:
/tmp/claude-linux-mcp/在每次重启时都会被清除。手动清除:rm -rf /tmp/claude-linux-mcp。权限范围: 所有工具均以您自己的用户权限运行 —— 与您在终端中输入或使用鼠标执行的操作相同。
联系/问题: 请在 https://github.com/LukeLamb/claude-linux-mcp/issues 提交 Issue。
许可证
MIT。自由使用,感谢署名,不提供任何担保。
Available Tools
15 toolsclipboard_getARead-only
Read the current X11 CLIPBOARD selection as text.
Inputs: no named parameters.
clipboard_setADestructive
Write a string to the X11 CLIPBOARD selection.
Inputs: text (required).
close_windowADestructive
Request a window matching the given title pattern to close (gracefully, via the WM close hint).
Inputs: title_pattern (required).
focus_windowADestructive
Bring a window matching the given title pattern (substring, case-insensitive per wmctrl) to the foreground.
Inputs: title_pattern (required).
key_pressADestructive
Press a keyboard combination using xdotool's keysym notation. Examples: 'ctrl+c', 'alt+Tab', 'super', 'Return', 'Escape', 'Page_Down'.
Inputs: combo (required).
launch_appADestructive
Launch an application via a shell command (e.g. "firefox", "gnome-terminal", "code /path/to/project"). The process is detached from this server.
Inputs: command (required).
list_windowsARead-only
List all visible windows with id, pid, desktop, geometry (x/y/width/height), hostname, and title.
Inputs: no named parameters.
mouse_clickADestructive
Click a mouse button. If x and y are provided, the pointer moves there first; otherwise clicks at the current pointer location.
Inputs: button, x, y.
mouse_dragBDestructive
Drag from (x1, y1) to (x2, y2) while holding the given button (default left).
Inputs: x1 (required), y1 (required), x2 (required), y2 (required), +1 more.
mouse_moveADestructive
Move the mouse pointer to absolute screen coordinates (x, y).
Inputs: x (required), y (required).
mouse_scrollADestructive
Scroll in a direction (up/down/left/right) by N clicks (default 3).
Inputs: direction (required), amount.
move_windowADestructive
Move and/or resize a window matching the given title pattern. Any of x, y, width, height omitted leaves that dimension unchanged.
Inputs: title_pattern (required), x, y, width, +1 more.
screenshotARead-only
Capture a screenshot of the full screen (or the active window if active_window=true). Saves a PNG under /tmp/claude-linux-mcp/shots/ and returns the path.
Inputs: path, active_window.
screenshot_textARead-only
Take a screenshot and OCR it with tesseract. Returns the recognized text plus the path to the underlying PNG. Use when Claude needs to READ what is on screen (log windows, error dialogs, terminal output in non-focused windows) rather than just see the image. Requires tesseract-ocr installed.
Inputs: active_window, path, lang.
type_textADestructive
Type a string into the currently-focused window (emits keystrokes). Use key_press for special/modifier combos.
Inputs: text (required), delay.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct purpose covering clipboard operations, window management, keyboard input, mouse actions, app launching, and screenshot capture. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., clipboard_get, close_window, mouse_click). The naming scheme is predictable and easy to parse.
15 tools is perfectly scoped for a desktop automation MCP server. Each tool addresses a distinct action without unnecessary redundancy, covering the essential operations for window management, input, and clipboard.
The tool surface covers the full lifecycle of desktop automation: window discovery and manipulation, input simulation (keyboard, mouse, clipboard), app launching, and screenshot capture with optional OCR. No obvious gaps are present for typical use cases.
Maintenance
Related MCP Connectors
Lets Claude, ChatGPT and other AI chats work on your Linux computers: terminal, files and browser.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Remote desktop MCP: let AI see, click, type and run terminal commands on your own Windows or Mac.
Related MCP Servers
- AlicenseAqualityCmaintenanceGive Claude Desktop terminal, filesystem, and background-job access on your local Linux machine. Zero-dependency MCP extension, MIT-licensed.85MIT
- AlicenseAqualityDmaintenanceEnables LLMs to capture desktop screenshots and control the mouse and keyboard on Linux, including Wayland, through MCP.111MIT
- AlicenseAqualityBmaintenanceEnables Claude Code and Codex to see and drive an X11 desktop through screenshots, mouse, keyboard, and accessibility-tree actions while keeping the user's own pointer and focus separate.18Apache 2.0
- AlicenseNot gradedqualityBmaintenanceGrants Claude Code desktop-control capabilities on Linux, including screenshots, mouse movement and clicks, keyboard input, window listing and focusing, and clipboard access.3MIT