它弥合了AI模型与macOS应用之间的鸿沟,通过视觉检查、界面解读和对原生应用的精准控制实现智能自动化。
概览
它弥合了AI模型与macOS应用之间的鸿沟,通过视觉检查、界面解读和对原生应用的精准控制实现智能自动化。 - : 使用 ScreenCaptureKit 捕捉高分辨率应用窗口 - : 使用苹果 Vision Framework 从截图中提取文本 - : 提取详细的无障碍层级结构以实现精准元素定位 - : 同时识别并监控多个运行中的应用程序 - : 鼠标点击、键盘输入和手势自动化 - : 智能延迟和基于条件的等待机制 - : 可靠的自动化后备策略 - : 无缝的 TCC(透明度、同意与控制)集成 - : 基于 STDIO 的 JSON-RPC 支持结构化错误处理 - : 验证应用目标以增强安全性 AppMCP 需要以下 macOS 权限: 1. : 系统偏好 →隐私与安全→无障碍 2.
概述(AI 翻译)
通过模型上下文协议实现AI驱动的macOS应用自动化
AppMCP 弥合了 AI 模型与 macOS 应用之间的鸿沟,通过可视化检查、界面解读和对原生应用的精准控制实现智能自动化。
✨ 特色
🎯 视觉智能
- 智能截图:使用 ScreenCaptureKit 捕捉高分辨率应用窗口
- OCR 文本识别:使用苹果的 Vision Framework 从截图中提取文本
- UI 树分析:提取详细的无障碍层级结构,以实现精准的元素定位
- 多应用发现:同时识别和监控多个运行中的应用程序
🛠 自动化工具包
- 精准交互:鼠标点击、键盘输入和手势自动化
- 智能等待:智能延迟和基于条件的等待机制
- 错误恢复:可靠自动化的稳健后备策略
🔒 隐私与安全
- 权限管理:无缝的TCC(透明度、同意与控制)集成
- 安全通信:基于STDIO的JSON-RPC带结构化错误处理
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
🤖 AppMCP
AI-Powered macOS Application Automation via Model Context Protocol
AppMCP bridges the gap between AI models and macOS applications, enabling intelligent automation through visual inspection, UI interpretation, and precise control of native applications.
✨ Features
🎯 Visual Intelligence
- Smart Screenshots: Capture high-resolution app windows using ScreenCaptureKit
- OCR Text Recognition: Extract text from screenshots using Apple’s Vision Framework
- UI Tree Analysis: Extract detailed accessibility hierarchies for precise element targeting
- Multi-App Discovery: Identify and monitor multiple running applications simultaneously
🛠 Automation Toolkit
- Precise Interactions: Mouse clicks, keyboard input, and gesture automation
- Smart Waiting: Intelligent delays and condition-based waiting mechanisms
- Error Recovery: Robust fallback strategies for reliable automation
🔒 Privacy & Security
- Permission Management: Seamless TCC (Transparency, Consent, and Control) integration
- Secure Communication: JSON-RPC over STDIO with structured error handling
- Bundle ID Validation: Verified application targeting for enhanced security
🚀 Quick Start
Prerequisites
- macOS 15.0+ (Sequoia or later)
- Swift 6.1+
- Xcode 16.0+
Installation
# Clone the repository
git clone https://github.com/your-username/AppMCP.git
cd AppMCP
# Build the project
swift build -c release
# Run the daemon
./.build/release/appmcpd --stdio
Permissions Setup
AppMCP requires the following macOS permissions:
- 🔓 Accessibility: System Preferences → Privacy & Security → Accessibility
- 📺 Screen Recording: System Preferences → Privacy & Security → Screen Recording
The application will guide you through the permission setup process.
🎮 Usage Examples
Weather App Automation
import json
import subprocess
# Start AppMCP server
process = subprocess.Popen(['./appmcpd', '--stdio'])
# Take screenshot of Weather app
request = {
"jsonrpc": "2.0",
"id": 1,
"method": "resources/read",
"params": {"uri": "app://app_screenshot"}
}
# Send request and get response
response = send_mcp_request(request)
print(f"📸 Screenshot captured: {response['result']['contents'][0]['text']}")
UI Element Discovery
# Get accessibility tree
request = {
"jsonrpc": "2.0",
"id": 2,
"method": "resources/read",
"params": {"uri": "app://app_accessibility_tree"}
}
tree = send_mcp_request(request)
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →