SuperAPI AI Directory

mcp-mac-control

Full Mac control: shell, AppleScript, files, processes and human-like GUI input with a screenshot loop, plus an optional safe mode with read-only, gated access.

Open website

About this tool

Purpose

mcp-mac-control is a Model Context Protocol (MCP) server whose goal is to let an AI agent operate an entire computer the way a person sitting in front of a Mac would. It uniformly exposes shell, AppleScript, files, processes, and human-like GUI control to the agent, and together with a screenshot and window/screen size awareness loop, forms the classic closed loop of "screenshot → decide → click/type/drag/scroll → screenshot again."

Main capabilities (26 tools)

Perception: 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 click), drag, scroll, type_text, key_press (supports ⌘/⌥/⌃/⇧ key combinations), activate_app, quit_app, open, set_clipboard, notify, write_file.

Full permissions: run_command (can run any program, and unless explicitly requested does not go through the shell), run_applescript (AppleScript/JXA, can drive any app that supports scripting), delete_path (move to Trash), kill_process.

How to use

Only macOS is supported. The first time each capability is used, macOS permissions need to be granted to the host application (Terminal, IDE, Claude Desktop, etc.):

  • 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 depends on cliclick, which must be installed first:

brew install cliclick

After configuring it in Claude Code, it is ready to use, and by default it is in full control mode. To restrict permissions, you can add environment variables (see below). For configuration of Claude Desktop / Cursor / Codex / VS Code / Windsurf, see docs/CLIENTS.md; for all variables, see .env.example.

Safe mode and policy

The server starts in admin mode by default, with command execution, deletion, and GUI input all enabled. The official documentation explicitly warns: this is both powerful and dangerous—anything the agent reads (web pages, emails, files) may contain prompt injection, thereby running arbitrary code on your Mac. You should only connect agents and content you trust. Setting MACCTL_SAFE_MODE=true switches the whole thing to default safe mode; if you want default safety as the baseline, you can use the same-series @dockndevai/mcp-macos.

The policy engine (src/security.ts) uses the same tiered model as other servers in the same series, except that this server is fully open by default; see SECURITY.md for details.

Optional AI risk protection

On top of static rules, this server can consult the local laya-guard daemon before running high-risk tools (run_command, run_applescript, delete_path). This protection classifies the actual command (deterministic patterns plus a local decision model) and gives one of three results: allow / confirm / block. It runs after the deterministic policy and can only tighten (add confirm or block), not loosen.

Start the daemon:

pipx install laya-guard && laya-guard

It is recommended to first observe its interception behavior in monitor mode, then switch to enforce mode.

Applicable scenarios and limitations

It is suitable for scenarios that require an AI agent to perform real desktop operations on macOS, such as automation operations, script-driven apps, file and process management, GUI interaction tasks, etc. In terms of limitations: only macOS is supported; system permissions need to be granted; the default full control mode carries risks of prompt injection and arbitrary code execution, and the official recommendation is to connect only trusted agents and content, or switch to safe mode/the same-series safe version.