闲社服务运行正常AI智能体自动化平台
m

macOS桌面控制

技能标识:mac-compute-use

Control macOS applications via Accessibility API through an MCP server. Open apps, click buttons, type text, press keys, scroll, and read UI state. Use when: (1) interacting with native macOS apps (Finder, Messages, Mail, etc.), (2) automating GUI workflows — clicking, typing, navigating menus, (3) reading screen content or UI state from any app, (4) controlling browsers for web automation without browser extensions, (5) any task requiring 'computer use' or 'desktop control' on macOS. NOT for: L

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.1.0
检测标记
后台标记通过
免费
免费获取
1
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

macOS桌面控制

Mac Compute Use

通过MCP使用辅助功能API控制macOS图形用户界面。

设置

  1. 1. 安装MCP服务器:
bash brew tap reedburns/mcp-server-macos-use brew install mcp-server-macos-use
  1. 2. 注册到mcporter:
bash mcporter config add macos-use --transport stdio --command $(which mcp-server-macos-use)
  1. 3. 授予辅助功能权限:
系统设置 → 隐私与安全性 → 辅助功能 → 添加 mcp-server-macos-use
  1. 4. 验证:
bash mcporter list macos-use --schema

工具

所有工具均通过 mcporter call macos-use.<工具名> key=value 调用。

openapplicationand_traverse

打开/激活应用并获取其UI树。 bash mcporter call macos-use.macos-useopenapplicationandtraverse identifier=Google Chrome mcporter call macos-use.macos-useopenapplicationandtraverse identifier=com.apple.finder mcporter call macos-use.macos-useopenapplicationandtraverse identifier=TextEdit

返回:PID、元素数量、可见交互元素,以及包含完整UI树的JSON文件路径。

clickandtraverse

点击指定坐标(来自UI树)并获取更新后的状态。 bash mcporter call macos-use.macos-useclickand_traverse pid=408 x=701 y=73 width=102 height=41
  • - x, y:元素左上角坐标(来自遍历结果)
  • width, height:可选参数,提供时点击位置为元素中心

typeandtraverse

在焦点应用中输入文本。 bash mcporter call macos-use.macos-usetypeand_traverse pid=408 text=Hello world

presskeyand_traverse

按下按键(可附带修饰键)。 bash mcporter call macos-use.macos-usepresskeyandtraverse pid=408 keyName=Return mcporter call macos-use.macos-usepresskeyandtraverse pid=408 keyName=a modifierFlags=[Command] mcporter call macos-use.macos-usepresskeyandtraverse pid=408 keyName=Tab mcporter call macos-use.macos-usepresskeyandtraverse pid=408 keyName=Escape

有效修饰键:CapsLock、Shift、Control、Option、Command、Function、NumericPad、Help。

scrollandtraverse

在应用窗口内滚动。 bash mcporter call macos-use.macos-usescrolland_traverse pid=408 x=500 y=400 deltaY=3 mcporter call macos-use.macos-usescrolland_traverse pid=408 x=500 y=400 deltaY=-3
  • - deltaY 正数 = 向下滚动,负数 = 向上滚动
  • deltaX 可选,用于水平滚动

refresh_traversal

获取当前UI状态而不执行任何操作。 bash mcporter call macos-use.macos-userefreshtraversal pid=408

工作流模式

典型的自动化流程:

  1. 1. 打开应用 → 获取PID和可见元素
  2. 读取响应摘要中的visible_elements — 这些是带有坐标的交互元素
  3. 使用UI树中的坐标进行点击/输入/按键操作
  4. 读取响应 — 显示变化内容(差异)和新的可见元素
  5. 重复操作 直到任务完成

读取响应

每个工具返回一个简洁的摘要,包含:

  • - status:成功/错误
  • pid:进程ID(用于后续调用)
  • file:包含所有元素的完整JSON文件路径(可使用grep或python3搜索)
  • visible_elements:当前可见的关键交互元素及其坐标

当需要查找特定元素时,使用grep搜索JSON文件:
bash
grep -i 搜索文本 /tmp/macos-use/<文件名>.json

或使用Python解析:
bash
python3 -c
import json
with open(/tmp/macos-use/<文件名>.json) as f:
data = json.load(f)
for e in data.get(traversal,{}).get(elements,[]):
text = (e.get(text) or ).strip()
if text and 搜索 in text.lower():
print(f[{e[\role\]}] ({e[\x\]},{e[\y\]} {e.get(\width\,\?\)}x{e.get(\height\,\?\)}) {text})

提示

  • - 在链式命令中始终使用 --output json 获取机器可读的结果
  • 点击后,如果UI在差异中没有更新,请稍等片刻再执行 refresh_traversal
  • 使用应用名称(Google Chrome)、包ID(com.google.Chrome)或路径来打开应用
  • 坐标是绝对屏幕位置 — 如果窗口移动,请刷新遍历结果
  • 服务器将遍历JSON写入 /tmp/macos-use/ — 这些文件是临时文件

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mac-compute-use-1776284202 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mac-compute-use-1776284202 技能

通过命令行安装

skillhub install mac-compute-use-1776284202

下载

⬇ 下载 mac-compute-use v0.1.0(免费)

文件大小: 3.57 KB | 发布时间: 2026-4-16 16:46

v0.1.0 最新 2026-4-16 16:46
Initial release: control macOS apps via Accessibility API through MCP server. Install via Homebrew, connect with mcporter. 6 tools: open apps, click, type, press keys, scroll, read UI tree.
返回顶部