Mcp Mac Control

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.3.1更新于 Nov 3, 2026

Full macOS control — drive a Mac like a human: shell, AppleScript, files, and human-like GUI.

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手完全控制 Mac:执行 shell 命令、AppleScript、操作文件与进程,并像人一样用鼠标键盘操作图形界面。

可以做什么
  • 感知机器状态:截屏、读取屏幕尺寸、列出窗口、应用与进程、查看前台应用、读取文件与目录、获取系统信息和剪贴板。
  • 像人一样操作桌面:移动、单击、双击、右键、拖拽、滚动、输入文字、按组合键、激活或退出应用、打开项目、设置剪贴板、发送通知。
  • 执行高权限操作:运行任意命令、运行 AppleScript/JXA、将路径删除到废纸篓、结束进程。
  • 写入文件,并按截屏、操作、再截屏的循环完成图形界面自动化。
适用场景
适合让助手端到端地操作一台 Mac,例如自动化只有图形界面的应用、复现桌面工作流程,或在你掌控的机器上组合 shell、AppleScript 与鼠标键盘操作。若只需要只读查看或更安全的默认设置,则不太合适。
运行要求
仅支持 macOS,通过 npx 从 npm 包在本地运行。宿主应用需授予屏幕录制(截屏)、辅助功能(图形界面输入、列出窗口)和自动化(AppleScript/应用控制)权限。鼠标控制需通过 Homebrew 安装 cliclick。AI 风险防护需可选的 laya-guard 守护进程。
安装前请注意
默认即为完全控制:admin 模式下命令执行、删除和图形界面输入全部开启,未设置 MACCTL_CONFIRM 时不会请求确认。助手读取的任何内容都可能夹带提示注入,从而在你的 Mac 上执行任意代码。可用 MACCTL_SAFE_MODE、MACCTL_MODE、路径与命令白名单、受保护路径及试运行来收紧权限;审计日志默认输出到 stderr。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Mac Control,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-mac-control

[npm] [CI] [licence]

A Model Context Protocol server that gives an AI agent full control of a Mac — like a person sitting at it. Shell, AppleScript, files, processes, and human-like GUI control: move, click, double/right-click, drag, scroll, type, and press key combos — with a screenshot + window/screen-size perception loop.

⚠️ This server is full-control by default. It starts in admin mode with command execution, deletes, and GUI input all enabled. That is powerful and dangerous: anything the agent reads (a web page, an email, a file) could contain a prompt injection that then runs arbitrary code on your Mac. Only connect it to an agent and content you trust. Set MACCTL_SAFE_MODE=true to flip the whole thing to safe-by-default. If you want safe-by-default as the baseline, use the sibling @dockndevai/mcp-macos instead.

Part of the dockndevai MCP server suite.

What it gives an agent (26 tools)

Perceive — screenshot, get_screen_size, list_windows, get_frontmost_app, list_apps, system_info, list_directory, read_file, list_processes, get_clipboard

Operate the desktop like a human — move_mouse, click (left/right/double), drag, scroll, type_text, key_press (with ⌘/⌥/⌃/⇧), activate_app, quit_app, open, set_clipboard, notify, write_file

Full power — run_command (any program, no shell unless you ask for one), run_applescript (AppleScript/JXA — drive any scriptable app), delete_path (→ Trash), kill_process

The classic loop: screenshot → decide → click/type/drag/scroll → screenshot again.

Install

bash
npx -y @dockndevai/mcp-mac-control

macOS only. You'll need to grant the host app (Terminal, your IDE, Claude Desktop, …) macOS permissions the first time each capability is used:

  • Screen Recording → for screenshot
  • Accessibility → for GUI input (click, type_text, drag, scroll, key_press) and list_windows
  • Automation → for AppleScript / app control
  • Mouse control uses cliclick: brew install cliclick

Configure (Claude Code)

bash
claude mcp add mac-control -- npx -y @dockndevai/mcp-mac-control

That's it — it's full-control by default. To scope it down, add env flags (see below). See docs/CLIENTS.md for Claude Desktop / Cursor / Codex / VS Code / Windsurf, and .env.example for every variable.

Dialing the control up or down

Full control needs no configuration. Everything below is about restricting it:

VariableDefaultEffect
MACCTL_SAFE_MODEfalsetrue → read-only, every power gated, confirmations on (safe-by-default)
MACCTL_MODEadminread-only / read-write / admin — caps which tools are registered
MACCTL_ALLOW_EXECtrueshell / AppleScript / kill
MACCTL_ALLOW_DELETEtruedelete to Trash
MACCTL_ALLOW_INPUTtrueGUI input (mouse/keyboard)
MACCTL_CONFIRMfalsetrue → destructive ops pause for human approval via MCP elicitation
MACCTL_PATH_ALLOWLIST(empty = anywhere)confine file ops to these roots
MACCTL_PROTECTED_PATHS(empty)roots readable but never modified/deleted
MACCTL_COMMAND_ALLOWLIST(empty = any)restrict run_command to these programs
MACCTL_DRY_RUNfalsevalidate + log writes without executing
MACCTL_AUDIT_LOGtrueJSON audit line per guarded op, to stderr

The policy engine (src/security.ts) is the same graduated model as the rest of the suite — this server just ships it wide open by default. See SECURITY.md.

AI risk guard (optional)

For an extra layer on top of the static rules, this server can consult a local laya-guard daemon before running a high-risk tool (run_command, run_applescript, delete_path). The guard classifies the actual command — deterministic patterns plus a local decision model — as allow / confirm / block. It runs after the deterministic policy and can only tighten (add a confirm or block), never grant.

VariableDefaultEffect
MACCTL_GUARD_MODEoffmonitor (log what it would do) / enforce (block or require confirm)
MACCTL_GUARD_URLhttp://127.0.0.1:8799the local laya-guard daemon
MACCTL_GUARD_TIMEOUT_MS2000per-check timeout
MACCTL_GUARD_FAIL_CLOSEDconfirmwhen the daemon is unreachable in enforce mode: confirm or allow

Run the daemon with pipx install laya-guard && laya-guard. Start in monitor to see what it catches, then switch to enforce.

Developing

bash
npm installnpm run buildecho '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.js   # list toolsnpm test

Licence

MIT

来源:README.md,提交 ff6e364

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v0.3.1最新Sep 26, 2026
  2. v0.2.1Sep 19, 2026
  3. v0.1.0Sep 17, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分