
mac-control-mcp
io.github.AdelElo13由 GitHub 帳號 AdelElo13 發布v0.10.3更新於 Oct 30, 2026
Native Swift macOS automation — 153 tools: AX, EventKit, voice, browser DOM, undo.
概覽
以原生 Swift 撰寫的 macOS 自動化伺服器,為助理提供 153 個工具,用來檢視並操控應用程式、視窗、瀏覽器、螢幕與系統設定。
- 可以做什麼
- 讀取並修改執行中應用程式的輔助使用樹,尋找元素並對其執行操作
- 點擊、輸入、捲動、拖曳、送出按鍵事件以及點選選單路徑
- 控制視窗與應用程式生命週期:列出、啟動、啟用、結束、移動、調整大小、聚焦
- 操作 Safari 與 Chrome 的分頁、導覽、DOM 檢視與 JavaScript 執行
- 擷取螢幕、視窗與顯示器,對螢幕做 OCR,錄製音訊與螢幕,語音轉文字與文字轉語音
- 使用剪貼簿、Spotlight 搜尋、檔案對話框、系統開關、Apple 應用程式(郵件、訊息、行事曆、提醒事項、聯絡人)以及復原
- 適用情境
- 適合需要助理直接操作 Mac 的情境:自動化沒有 API 的圖形介面應用程式、測試或檢視桌面與瀏覽器介面、截圖與 OCR,或在聊天用戶端中處理郵件、訊息、行事曆與提醒事項。
- 執行需求
- 需要 macOS 14.0 以上版本,透過 stdio 在本機執行。可透過 Claude Desktop 的 .mcpb 套件安裝、以 npx 執行 npm 啟動器(首次執行會下載已簽署的應用程式)、使用預先建置的應用程式,或以 Swift 6 / Xcode 16+ 從原始碼建置。第一次呼叫工具會觸發螢幕錄製、輔助使用與 Apple 事件的 macOS 授權提示,權限會授予啟動它的宿主應用程式。未宣告 API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 mac-control-mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mac-control-mcp
[CI] [License: MIT] [Platform] [Notarized] [MCP Registry]
Native Swift MCP server for full macOS automation. 153 tools in one signed .app bundle — no Python, no Node runtime, no Electron. Full list with parameters: docs/TOOLS.md.
Gives any MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.) the ability to:
- Read and mutate the Accessibility tree of any running app
- Drive Safari and Chrome (tabs, navigation, JS eval)
- Capture the screen, a display, or a specific window (ScreenCaptureKit)
- OCR what's on screen
- Click, type, scroll, drag, send key events
- Control windows (move / resize / fullscreen / minimize / main)
- Manage the clipboard
- Launch / activate / quit apps
- Search Spotlight's index (NSMetadataQuery) and launch results
- Toggle dark mode, volume, list displays, inspect menus
Install
Requires macOS 14.0+. Four options, in order of simplicity:
1. One-click install (Claude Desktop, recommended)
The server is published as an MCP Bundle — a zip with a manifest.json that Claude Desktop reads directly:
- Download mac-control-mcp-v<version>.mcpb from the latest release.
- Double-click the
.mcpbfile. Claude Desktop opens an install dialog. - Click Install. The server is registered under the name
mac-control-mcpand available immediately in new chats. - First tool call triggers the macOS TCC consent prompts (Screen Recording, Accessibility, Apple Events). Grant all three once — the bundle is Developer-ID signed and notarized, so grants persist across updates.
It's also listed on the official MCP Registry as io.github.AdelElo13/mac-control-mcp, so any MCP client that supports the registry will find it by searching for "mac-control".
2. Install via npm / npx
For clients that are configured with a command line rather than a file path. The npm package mac-control-mcp is a thin launcher: it has no runtime dependencies, and on install it downloads the notarized MacControlMCP.app for that exact version from this repo's GitHub release, verifies it against the published .sha256, refuses any archive entry that escapes the install directory, and re-checks the bundle with codesign --verify --deep --strict, spctl --assess --type execute and a pinned Team ID (A3W973JZ49). The first run therefore pulls ~3 MB; later runs are local.
Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json:
Claude Code:
Cursor — ~/.cursor/mcp.json:
ChatGPT (developer mode, local MCP connector) — mcp.json:
Two flags are handled by the launcher itself instead of being forwarded to the binary:
--app-path is what you need when granting macOS permissions by hand. Note that TCC grants go to the MCP host application that launches this process (Claude Desktop, Cursor, your terminal), not to npx or to the script — run the permissions_status tool once from your client to see which grants are missing and which app they belong to.
MAC_CONTROL_MCP_SKIP_DOWNLOAD=1 skips the download (CI, sandboxed builds); HTTPS_PROXY and NO_PROXY are honoured.
3. Download the prebuilt app
If you don't use Claude Desktop or want manual control:
- Download MacControlMCP-v<version>-macos-universal.tar.gz from the latest release.
- Extract and move
MacControlMCP.appto~/Applications/. - Point your MCP client at the binary inside:
Add that block to ~/Library/Application Support/Claude/claude_desktop_config.json (Claude Desktop) or ~/.claude.json → mcpServers (Claude Code).
Verify the download with the published SHA-256:
4. Build from source
For contributors or if you want to tweak the code. Requires Swift 6 / Xcode 16+:
Produces ~/Applications/MacControlMCP.app/Contents/MacOS/MacControlMCP. Without a Developer ID cert in your keychain it'll fall back to ad-hoc signing (works for local use, TCC grants reset on every rebuild).
To re-sign + re-notarise an existing Apple Developer account:
Tool surface
Selected categories — this table is a curated subset, not the full list. For the complete, auto-generated tool reference (every tool, its description, and its required/optional parameters, regenerated straight from the tool registry so it can't drift), see docs/TOOLS.md.
153 tools total — see [docs/TOOLS.md](docs/TOOLS.md) for the complete, generated list.Which tool when
Several tools overlap in purpose. Based on their actual implementations:
Screen capture — capture_screen vs capture_screen_v2 vs capture_window vs capture_display
capture_screen— main display (or a rectangular region within it) to a PNG file, returns the file path + width/height. Simple, synchronous, no size limits applied.capture_screen_v2— main display only, but stores the PNG as a content-addressed artifact under~/.mac-control-mcp/artifacts/<sha256>.pngand returns{content_ref, bytes, sha256}. Defaults toinline=falseand downscales tomax_dimension/max_bytes(4000px / 4MB by default) specifically to avoid blowing up an MCP client's context window with a huge inline image (referenced in its own description as a fix for claude-code issues #13383/#45785). Prefer this one when the image is going back through an LLM context rather than straight to disk.capture_window— screenshots one specific window by PID (optionally filtered bytitle_contains), not the whole display.capture_display— screenshots one specific physical display by its index fromlist_displays, for multi-monitor setups.
Accessibility tree / element lookup — find_element vs find_elements vs query_elements vs list_elements vs get_ui_tree vs ax_tree_augmented
list_elements— lists actionable elements for a PID (a flat, practical "what can I click" view).find_element— returns the first element matching a role/title filter for a PID.find_elements— same matching asfind_element, but returns all matches, not just the first.query_elements— regex search over role/title/value (falls back to case-insensitive substring on invalid regex); use when a plain role/title filter isn't precise enough.get_ui_tree— walks the full accessibility tree of a process, including containers, and assigns stable element IDs for follow-up calls. Heavier thanlist_elements/find_element(s), but the only one that gives you structure/hierarchy.ax_tree_augmented— likeget_ui_tree, but does one OCR pass and geometrically joins OCR-derived labels onto AX nodes that have no native label. Use it specifically for Electron/Chromium/Canvas apps where the native AX tree is sparse and unlabeled; it's the expensive option (an OCR pass), so reach forget_ui_treefirst and fall back to this when nodes come back unlabeled.
Security model
- Tools that write files (
capture_*,ocr_screen) validateoutput_pathvia a strict allow-list — only the user-scoped temp dir (NSTemporaryDirectory()) and~/Desktop,~/Documents,~/Downloads,~/Picturesare accepted. Symlinks at the target path are rejected to prevent redirection./tmpis deliberately excluded because it's shared across users and opens a TOCTOU window. - AppleScript string interpolation for
browser_eval_jswraps user code in(0, eval)(…)viaJSON.stringify, so quotes/newlines/unicode can't break out of the wrapper. - No network calls. Everything is local system integration.
- Password fields are off limits in code, not by instruction. A field with role or subrole
AXSecureTextFieldnever returns its value or length, and every write route is refused withreason: secure_field: element writes,text_*edits,act, untargetedtype_text, and text keys or Cmd+V viapress_key,press_key_sequenceandkey_downwhile such a field has focus. While such a field has focus, menu-bar and context-menu items (Paste, Start Dictation, Emoji & Symbols) cannot be pressed either; pop-up and combo-box option menus stay usable. Navigation keys (Tab, Return, Escape, arrows) still work, so the agent can hand the field to the user.browser_eval_jsruns arbitrary page JavaScript and is not covered by this guard.
Status (verified in the current release)
If you run into an untested path, please open an issue with the reproduction — happy to fix fast.
Caveats
- Cross-origin iframes block
browser_eval_js— same-origin policy, not a limitation of the tool. Use AX coords or synthetic CGEvents for content inside embedded iframes from other origins. - First-run TCC prompts are unavoidable. macOS requires the user to grant Screen Recording, Accessibility and Apple Events the first time. The usage-description strings in
Info.plistmake the consent dialogs show up with a clear reason, but you still need to click Allow in System Settings once.
Development
License
MIT — see LICENSE.
Contributing
Issues and pull requests welcome. Adversarial reviews especially — prior releases went through 11 rounds of external review before shipping.
來源:README.md,提交 949403a
工具
0版本歷史
3- v0.10.3最新Oct 16, 2026
- v0.10.2Oct 14, 2026
- v0.10.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分