Communitygithub.com

macOS 控制 — AI Mac 自动化

MCP 服务器,用于 AI 驱动的 macOS 控制 — 应用、显示、音频、文件、截图、剪贴板

macOS 控制 — AI Mac 自动化 是什么?

该技能使 Claude(或其他 AI 代理)能够通过 15 个 MCP 工具直接控制 macOS。它允许用户通过自然语言命令打开/关闭应用、切换深色模式、调整音量、发送通知、执行 Spotlight 搜索、管理剪贴板、截屏以及打开 Finder 文件夹。所有工具通过本地 macOS 命令和 AppleScript 运行,无需任何外部 API 或凭据。内置的安全措施包括屏蔽危险命令(如 rm、sudo)、对应用名进行白名单验证以及 AppleScript 字符串转义,防止 shell 注入。该技能可与其他工具组合,例如将截图发送给浏览器自动化工具,或将剪贴板内容用于电子邮件模板。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiagentwithdhruv/skills/tree/HEAD/mac-control

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

macOS 控制 — AI Mac 自动化 是做什么的?

通过 15 个 MCP 工具让 Claude 直接控制你的 Mac。打开应用、切换深色模式、搜索文件、截屏、管理剪贴板——全部通过自然语言完成。

位置

项目: /Users/apple/Aiwithdhruv/AI Development/Claude/Mac-Automation/ MCP 服务器: Mac-Automation/macos_mcp.py

工具参考

系统(只读)

get_system_info()                    # macOS 版本、芯片、内存、运行时间
get_running_apps()                   # 所有可见的正在运行的应用
get_disk_usage()                     # 每个卷的存储空间

应用控制

open_app(app_name="Safari")          # 启动应用(已针对 /Applications/ 验证)
close_app(app_name="Notes")          # 通过 AppleScript 优雅退出
switch_to_app(app_name="Terminal")   # 将应用置于前台

显示与音频

toggle_dark_mode()                   # 在亮色与暗色之间切换(视觉即时生效)
set_volume(level=50)                 # 0-100,自动取消静音

通知

send_notification(title="嘿", message="课程开始!", sound="Glass")
play_sound(sound_name="Ping")        # 提供 14 种系统音效

文件与搜索

spotlight_search(query="发票.pdf", folder="~/Documents", limit=20)
open_folder(folder_path="~/Desktop") # 在 Finder 中打开

剪贴板

get_clipboard()                      # 读取当前剪贴板
set_clipboard(text="你好世界")        # 写入剪贴板

截图

take_screenshot(region="full")       # 保存 PNG 到桌面
take_screenshot(region="window")     # 仅前窗口

模式

输入

名称类型必需描述
app_namestr视情况而定不带 .app 的应用名(例如 'Safari')
levelint视情况而定音量 0-100
titlestr视情况而定通知标题
messagestr视情况而定通知正文
soundstr否声音名称(default/Glass/Ping/Pop 等)
querystr视情况而定Spotlight 搜索查询
folderstr否限定搜索范围的文件夹
textstr视情况而定剪贴板文本
regionstr否截图区域(full/window)

输出

名称类型描述
resultstr人类可读的结果或错误消息

凭据

名称类型必需描述
(无)——无需凭据——使用本地 macOS 命令

可组合工具

  • ghost-browser — 截图 → 分析 → 自动化浏览器
  • google-mcp — 搜索文件 → 电子邮件附件
  • instantly-campaigns — 剪贴板 → 电子邮件模板

成本

免费 — 仅使用标准库,无 API 调用。

安全性

  • 屏蔽的关键词:rm, sudo, shutdown, format, erase, passwd, kill
  • 应用名已针对 /Applications/ 验证
  • AppleScript 字符串已转义
  • 所有命令超时 10 秒
  • 任何地方均未使用 shell=True

Individual skills in this repo

This repo contains 10 individual skills — each has its own dedicated page.

aiagentwithdhruv/skills

Add new Modal webhooks for event-driven execution. Use when user asks to create a webhook, add an endpoint, or set up event triggers.

aiagentwithdhruv/skills

Answer Euron Gen AI Bootcamp doubts instantly. Covers Euri API setup across all frameworks (Python, LangChain, OpenAI SDK, TypeScript, n8n, curl), MCP server setup, common errors, model recommendations, and token limits. Use when someone in the bootcamp asks a question.

aiagentwithdhruv/skills

Manage emails across multiple Gmail accounts with unified tooling. Use when user asks to check email, read inbox, label emails, archive messages, or manage Gmail across accounts.

aiagentwithdhruv/skills

Auto-label Gmail emails into Action Required, Waiting On, and Reference categories. Use when user asks to label emails, triage inbox, categorize emails, or organize Gmail.

aiagentwithdhruv/skills

Scrape Google Maps for B2B leads with deep website enrichment and contact extraction. Use when user asks to find local businesses, scrape Google Maps, generate contractor lists, or build local service business databases.

aiagentwithdhruv/skills

Run Claude orchestrator locally with Cloudflare tunneling. Use when user asks to run locally, start local server, or test webhooks locally.

aiagentwithdhruv/skills

Deploy execution scripts to Modal cloud. Use when user asks to deploy to Modal, push code to cloud, or update Modal functions.

aiagentwithdhruv/skills

Scrape and verify business leads using Apify, classify with LLM, enrich emails, and save to Google Sheets. Use when user asks to find leads, scrape businesses, generate prospect lists, or build lead databases for any industry or location.

aiagentwithdhruv/skills

Query Skool community content using RAG pipeline with vector search. Use when user asks to search Skool knowledge, find community answers, or query Skool content.

aiagentwithdhruv/skills

Scrape Upwork jobs and generate personalized proposals with cover letters. Use when user asks to find Upwork jobs, create Upwork proposals, or apply to Upwork listings.

相关技能