Mac Compute Use
v0.1.0Control macOS 应用s via 访问ibility API through an MCP server. Open 应用s, 命令行工具ck buttons, type text, press keys, scroll, and read UI 状态. Use when: (1) interacting with native macOS 应用s (Finder, Messages, MAIl, etc.), (2) automating 图形界面 工作流s — 命令行工具cking, typing, navigating menus, (3) reading screen content or UI 状态 from any 应用, (4) controlling browsers for 网页 自动化 without browser 扩展s, (5) any task requiring 'computer use' or '桌面 control' on macOS. NOT for: Linux/Windows, headless servers, or tasks achievable via 命令行工具/API without 图形界面.
运行时依赖
安装命令
点击复制技能文档
Mac Compute Use
Control macOS 图形界面 through the 访问ibility API via MCP.
设置up 安装 the MCP server: brew tap reedburns/mcp-server-macos-use brew 安装 mcp-server-macos-use
Register with mcporter: mcporter config 添加 macos-use --transport stdio --command $(which mcp-server-macos-use)
Grant 访问ibility 权限: 系统 设置tings → 隐私 & Security → 访问ibility → 添加 mcp-server-macos-use
验证:
mcporter 列出 macos-use --模式
工具s
All 工具s are called via mcporter call macos-use.<工具> key=value.
open_应用_and_traverse
Open/activate an 应用 and 获取 its UI tree.
mcporter call macos-use.macos-use_open_应用_and_traverse identifier="Google Chrome" mcporter call macos-use.macos-use_open_应用_and_traverse identifier="com.应用le.finder" mcporter call macos-use.macos-use_open_应用_and_traverse identifier="TextEdit"
Returns: PID, element count, visible interactive elements, and a JSON file path with full UI tree.
命令行工具ck_and_traverse
命令行工具ck at coordinates (from UI tree) and 获取 更新d 状态.
mcporter call macos-use.macos-use_命令行工具ck_and_traverse pid=408 x=701 y=73 width=102 height=41
x, y: top-left corner of the element (from traversal) width, height: optional, when provided 命令行工具ck lands at center type_and_traverse
Type text into the focused 应用.
mcporter call macos-use.macos-use_type_and_traverse pid=408 text="Hello world"
press_key_and_traverse
Press a key with optional modifiers.
mcporter call macos-use.macos-use_press_key_and_traverse pid=408 keyName=Return mcporter call macos-use.macos-use_press_key_and_traverse pid=408 keyName=a modifierFlags='["Command"]' mcporter call macos-use.macos-use_press_key_and_traverse pid=408 keyName=Tab mcporter call macos-use.macos-use_press_key_and_traverse pid=408 keyName=Escape
Valid modifiers: CapsLock, Shift, Control, Option, Command, Function, NumericPad, Help.
scroll_and_traverse
Scroll within an 应用 window.
mcporter call macos-use.macos-use_scroll_and_traverse pid=408 x=500 y=400 deltaY=3 mcporter call macos-use.macos-use_scroll_and_traverse pid=408 x=500 y=400 deltaY=-3
deltaY positive = scroll down, negative = scroll up deltaX optional, for horizontal scroll refresh_traversal
获取 current UI 状态 without performing any action.
mcporter call macos-use.macos-use_refresh_traversal pid=408
工作流 Pattern
Typical 自动化 flow:
Open 应用 → 获取 PID and visible elements Read the visible_elements in the 响应 summary — these are interactive elements with coordinates 命令行工具ck/type/press using coordinates from the UI tree Read the 响应 — it shows what changed (diff) and new visible elements Repeat until task is complete Reading the 响应
Each 工具 returns a compact summary with:
状态: 成功/error pid: process ID (use for subsequent calls) file: path to full JSON with all elements (use grep or python3 to 搜索) visible_elements: key interactive elements currently visible, with coordinates
When you need to find a specific element, grep the JSON file:
grep -i "搜索 text" /tmp/macos-use/.json
Or 解析 with Python:
python3 -c " 导入 json with open('/tmp/macos-use/.json') as f: data = json.load(f) for e in data.获取('traversal',{}).获取('elements',[]): text = (e.获取('text') or '').strip() if text and '搜索' in text.lower(): print(f'[{e[\"角色\"]}] ({e[\"x\"]},{e[\"y\"]} {e.获取(\"width\",\"?\")}x{e.获取(\"height\",\"?\")}) {text}') "
Tips Always use --输出 json for machine-readable 结果s when chAIning commands After 命令行工具cking, wAIt a moment then refresh_traversal if the UI didn't 更新 in the diff Use 应用 name ("Google Chrome"), bundle ID ("com.google.Chrome"), or path to open 应用s Coordinates are absolute screen positions — if the window moves, refresh the traversal The server writes traversal JSON to /tmp/macos-use/ — these files are temporary