mac_find_ui
Retrieve UI element details (role, title, position, size) from macOS apps via Accessibility, with an optional Electron CDP fallback for apps with shallow accessibility trees.
Instructions
Find UI elements (role, title, position, size) in an app via Accessibility, with optional Electron CDP fallback.
Examples:
All buttons in Safari: { app: "Safari", role: "AXButton" }
Element by title: { app: "Mail", title: "Send" }
Fuzzy search: { app: "Finder", searchText: "Documents" }
Electron AX (VSCode with --remote-debugging-port=9222): { app: "Visual Studio Code", useElectronFallback: true }
Auto-fallback for known Electron apps: { app: "Cursor", useElectronFallback: "auto" }
Limitations:
Requires Accessibility permission for the client app.
Electron apps (VSCode, Cursor, Slack, Discord) expose a thin AX tree; use useElectronFallback when AX returns empty.
CDP fallback needs the user to relaunch the app with --remote-debugging-port=.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | Application name | |
| role | No | AX role filter (e.g., AXButton, AXTextField) | |
| title | No | Exact element title to search for | |
| maxResults | No | Max results (1-50, default: 10) | |
| searchText | No | Fuzzy text search across all visible elements | |
| electronCdpPort | No | Explicit CDP port (skips auto-detect). Range 1-65535. | |
| useElectronFallback | No | Use Chrome DevTools Protocol fallback for Electron apps. `true` = always try; `"auto"` = only for known Electron apps when AX returns empty. |