Repository navigation
Releases: erwinzhang7/macMCP
Release list
macMCP v0.2.0 — drag, windows, flows; never steals focus
New capabilities + a stronger "never interrupts you" guarantee. 19 tools now.
New tools
mac_drag— press-drag-release between two screen points: sliders, canvas drawing, reordering, resize handles, drag-and-drop. (A drag uses a real mouse-down, so it's the one action that raises the window.)mac_window— Accessibility window management:move/resize/minimize/unminimize/close/raise/list, targeted by window title or the focused window. move/resize/minimize are attribute writes that don't raise or steal focus; onlyraisebrings a window forward.mac_wait_for— wait until an element (by label/role) appears — or, withabsent, disappears — before acting. No more screenshot-polling by hand.mac_do— run a whole sequence in one call:click/type/key/scroll/wait/delay, stopping at the first failure. Fewer round-trips = fewer model turns.mac_clickbyquery— find-and-click a control by its label in one call, no prior read.
Never steals focus
Control clicks now invoke the element via Accessibility (AXPress) instead of synthesizing a mouse-down, so driving an app no longer raises it or pulls your focus. Screenshots never activate the app either (ScreenCaptureKit captures occluded windows). The only things that raise a window are an explicit mac_window raise, or a mac_drag (which needs a real mouse-down).
Fixes
- Empty
bundleIdno longer shadows a providedpidwhen targeting an app. windowMappinguses the backing scale of the display a window actually sits on — accurate clicks/screenshots on multi-monitor mixed-DPI setups.
Project
- CI (GitHub Actions):
swift build+ protocol self-test on every push. - A prebuilt
macMCP.app.zipis attached to this release by CI. It's ad-hoc signed and not notarized, so clear quarantine first:For regular use, building from source (xattr -dr com.apple.quarantine macMCP.app && mv macMCP.app /Applications/make install) with your own signing identity is recommended so TCC grants persist.
macMCP v0.1.1 — never steals focus
Patch release focused on not interrupting you while it drives an app.
Fixed: driving an app no longer brings it to the front
- Clicks now invoke controls via Accessibility (
AXPress) at the target point instead of synthesizing a mouse-down. A synthetic mouse-down makes a window key and raises it;AXPressinvokes the control without raising or focusing the app — so the app stays exactly where it is in your window stack. Falls back to a real click only when there's nothing actionable under the point (blank space, a canvas, text-cursor placement), which inherently needs a real click. Applies tomac_clickandmac_computer. mac_screenshotnever activates the app — thebringToFrontoption is gone. ScreenCaptureKit captures occluded/background windows, so a capture never needs to raise the window.
Net effect: reads, accessibility-tree snapshots, control clicks, typing, and screenshots all leave your focus and window order untouched. (Verified live: pressing a control leaves the previously-frontmost window in place; a synthetic click on blank space is the only thing that still raises a window.)
Also in this line since v0.1.0: faster AX reads (batched attribute fetches), downscaled + JPEG screenshots, window-enumeration caching, and mac_menu for controlling backgrounded (incl. Electron) apps via the menu bar.
macMCP v0.1.0
macMCP lets Claude (or any MCP client) control any macOS app — enumerate apps, screenshot a window, read its accessibility tree, click / type / scroll / press keys, drive menus, and watch per-app network connections. Sister project to safari-mcp; same idea, for native apps (Lark, Slack, Spotify, …) instead of Safari.
Zero third-party dependencies, hand-rolled JSON-RPC, no paid Apple Developer account required.
Permission model
Per-app, two tiers (keyed on bundle id), managed from a menu-bar app:
- Default — Claude only learns an app exists/is running, plus window titles + frontmost state.
- Full — screenshot, accessibility read/drive, input, and network metadata for that app.
Granting is a one-click native prompt (or a menu-bar toggle); revoking is one click. Claude can never self-grant. The gate fails closed on signing-identity mismatch, and an app can only screenshot its own windows.
Tools (15)
- Default:
mac_list_apps,mac_app_info,mac_list_windows,mac_permissions,mac_network_status - See:
mac_screenshot(ScreenCaptureKit, downscale + JPEG),mac_read_ui,mac_find_element - Act:
mac_click,mac_type,mac_scroll,mac_key,mac_computer(coordinate fallback),mac_menu(menu-bar control — works on backgrounded apps without stealing focus) - Network:
mac_read_network(per-app connection metadata vialsof; works on every app including cert-pinned ones — bodies are out of scope)
Background & focus
Input is delivered via CGEventPostToPid and AX presses, and captures via ScreenCaptureKit — so macMCP never moves your cursor or steals focus. Native apps drive fully in the background; Electron apps (Chromium) only expose their in-window tree while focused, but mac_menu controls them backgrounded.
Install
make install # builds + installs /Applications/macMCP.app, registers the `macmcp` MCP serverThen grant Accessibility + Screen Recording to macMCP in System Settings, and restart your MCP client. Set MACMCP_SIGN_IDENTITY to a stable code-signing identity so the permission grants persist across rebuilds.
Requirements
macOS 14+.