
macOS-MCP
io.github.Jeomon由 GitHub 账号 Jeomon 发布v0.3.6更新于 Nov 10, 2026
MCP server for macOS desktop automation via the Accessibility API.
概览
一个本地 MCP 服务器,让 AI 助手通过辅助功能 API 控制 Mac:点击、输入、启动应用、执行 shell 命令和抓取网页。
- 可以做什么
- 控制鼠标和键盘:点击、输入、滚动、移动或拖拽,按下 Cmd+C、Cmd+Tab 等快捷键,并可等待界面变化完成。管理应用与窗口:按名称或 bundle ID 启动应用,切换、移动和调整窗口大小,创建新的调度中心空间。查看桌面状态:捕获当前界面状态并从辅助功能树中提取可交互元素,辅助功能数据不足时可用截图。执行命令与脚本:通过 Shell 工具运行 shell 命令或 AppleScript。获取网页内容:抓取页面并转换为 Markdown。
- 适用场景
- 适合让助手在自己的 Mac 上直接操作应用和桌面,例如自动化重复的界面操作、在文件和应用中导航,或在不依赖计算机视觉的情况下执行窗口和键盘操作。它面向本地、隔离或可丢弃的环境,而非生产或共享机器。
- 运行要求
- 在 macOS 12 或更高版本上本地运行,需要 Python 3.11+ 和 UV 包管理器(uvx macos-mcp)。界面交互需要辅助功能权限,Snapshot 工具需要屏幕录制权限,均需在系统设置中手动授予。使用网络传输时可配置认证密钥、可选的 IP 白名单、TLS 证书与私钥,或 OAuth 客户端凭据。
安装
在 SourceWeft 中
- 打开 控制台中的 macOS-MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Overview
macOS-MCP is a lightweight, open-source Model Context Protocol server that bridges AI agents and the macOS operating system. It enables seamless automation of macOS through LLMs via tasks such as file navigation, application control, UI interaction, browser automation, and system operations.
Supported Operating Systems
- macOS 12 (Monterey)
- macOS 13 (Ventura)
- macOS 14 (Sonoma)
- macOS 15 (Sequoia)
- macOS 26 (Tahoe)
Key Features
-
Works with Any LLM (Vision Optional)
Unlike traditional automation tools, macOS-MCP doesn't require computer vision, fine-tuned models, or specialized setup. Works seamlessly with any LLM—Claude, GPT, Gemini, or others. -
Native macOS Integration
Interacts natively with macOS UI elements using the Accessibility API. Opens apps, controls windows, simulates user input, and captures desktop state without workarounds. -
Rich Toolset for Automation
Complete toolkit for keyboard/mouse operations, window management, UI state capture, interactive element extraction from the accessibility tree, and AppleScript execution. -
Lightweight and Open-Source
Minimal dependencies with full source code available under MIT license. Easy setup and deployment. -
Smart Context Awareness
Automatically detects application state (Launchpad, Control Center, Spotlight). Scans menu bar, dock, desktop, and system UI elements intelligently. -
Customizable and Extensible
Easily extend with custom tools or modify behavior to suit your specific automation needs.
Installation
Prerequisites
- Python: 3.11 or later
- UV Package Manager: Install with
pip install uvorcurl -LsSf https://astral.sh/uv/install.sh | sh - macOS: 12 (Monterey) or later
- Accessibility Permissions: Required for UI element interaction
Quick Start
Run the server directly:
Run it as a background service that starts now and at every login:
This installs a launchd Launch Agent at ~/Library/LaunchAgents/com.macos-mcp.server.plist.
Use macos-mcp uninstall to remove it. Logs are written to ~/.macos-mcp/server.log
and ~/.macos-mcp/server.error.log.
Transport Options
Grant Required Permissions
macOS-MCP requires Accessibility and Screen Recording permissions to function properly.
Accessibility Permissions
- Open System Settings → Privacy & Security → Accessibility
- Click the lock icon and authenticate
- Add the following applications:
- Your terminal application (Terminal, iTerm2, VS Code, etc.)
- Python (typically
/usr/bin/python3or the Python version managed by UV) - UV (
~/.local/bin/uvif installed locally, or the Python environment UV manages)
- Restart the terminal after granting permissions
For uvx users: Grant permissions to your terminal application and Python, as uvx runs Python packages from UV's cache.
If the interpreter binary is greyed out / unselectable in the "+" picker (a known issue with UV-managed Python symlinks, e.g. .venv/bin/python3.12 → ~/.local/share/uv/python/...): don't try to add it manually. Instead, just start the server — since v0.3.10 it calls AXIsProcessTrustedWithOptions with the prompt option on startup, which asks macOS to show its native consent dialog and auto-register the running process for you. Approve that dialog and restart the server.
If you're launched as a subprocess by a parent that already holds Accessibility access (e.g. certain Claude Desktop configurations), and permission checks still fail spuriously, set MACOS_MCP_SKIP_PERMISSION_CHECK=1 to downgrade the check to a warning instead of exiting.
Screen Recording Permissions
The Snapshot tool requires Screen Recording permissions to capture screenshots:
- Open System Settings → Privacy & Security → Screen Recording
- Click the lock icon and authenticate
- Add the same applications as above (terminal, Python, UV)
- Restart the terminal after granting permissions
Note: If the Snapshot tool fails, verify both permissions are granted in System Settings.
Integration Options
Claude Desktop
-
Install Claude Desktop
-
Edit
~/Library/Application Support/Claude/claude_desktop_config.json:
- Restart Claude Desktop
Claude Desktop (connecting to an HTTP server)
Claude Desktop's claude_desktop_config.json only supports stdio-based server
entries. To connect to a running macOS-MCP HTTP server (e.g. one started with
macos-mcp install --transport streamable-http), use
mcp-remote as a stdio-to-HTTP
bridge.
This is especially useful when running multiple Claude Desktop instances
(e.g. via Parall) — a single persistent HTTP server
handles all of them, avoiding the overhead of spawning a separate macos-mcp
process per session.
1. Start the HTTP server (one-time setup):
2. Configure Claude Desktop to connect via mcp-remote:
3. Restart Claude Desktop.
If you have multiple Claude Desktop instances (e.g. Parall clones), add the
same mcpServers entry to each instance's claude_desktop_config.json. All
instances will share the single background server.
A migration script is included for bulk reconfiguration — see
scripts/stdio-to-http-reconfig.sh.
With authentication (recommended when binding to 0.0.0.0):
Gemini CLI
- Install Gemini CLI:
-
Navigate to
~/.geminiand opensettings.json -
Add the server config:
- Restart Gemini CLI
Claude Code
-
Install Claude Code
-
Add to your project configuration or use the MCP marketplace integration
Pi Agent
Pi does not ship with built-in MCP support, but macOS-MCP can be installed as a Pi package. The package starts this MCP server over stdio and exposes convenient Pi tools that wrap the existing macOS-MCP tools.
One-line global setup:
After install, restart Pi or run:
Try without installing:
Local checkout setup:
If you copied only the extension into another Pi project, run Pi from the macOS-MCP checkout or set:
The extension exposes these Pi tools:
Recommended agent workflow:
- Call
mac_snapshotfirst. - Use the coordinates returned by Snapshot with
mac_click,mac_type, andmac_scroll. - Use screenshots/vision only when Accessibility data is missing or ambiguous.
The extension auto-detects the macOS-MCP checkout when installed as a Pi package. If you use a manually copied extension, set MACOS_MCP_ROOT=/path/to/MacOS-MCP.
Tau Coding Agent
Tau does not ship with built-in MCP support. This repo includes a project-local Tau extension at .tau/extensions/macos-mcp/ that starts the macOS-MCP server over stdio and exposes Tau-native tools that wrap the existing macOS-MCP tools.
Local checkout setup:
Tau auto-discovers project extensions under .tau/extensions/*/ when run from the checkout, and installs the extension's own dependencies (declared in manifest.json) automatically on first load. If Tau is already running, use /reload.
If you copied only the extension into another Tau project, run Tau from the macOS-MCP checkout or set:
The extension exposes these Tau tools:
Recommended agent workflow:
- Call
mac_snapshotfirst. - Use the coordinates returned by Snapshot with
mac_click,mac_type, andmac_scroll. - Use screenshots/vision only when Accessibility data is missing or ambiguous.
The extension auto-detects the macOS-MCP checkout. If you use a manually copied extension, set MACOS_MCP_ROOT=/path/to/MacOS-MCP.
Other Integrations
Any client supporting the Model Context Protocol can integrate macOS-MCP by configuring the uvx macos-mcp serve command in their MCP server settings.
MCP Tools
macOS-MCP provides a comprehensive toolset for desktop automation:
Limitations
- Accessibility Requirements: Manual permission grant required in System Preferences
- App Compatibility: Some applications have limited or no Accessibility API support
- Performance Variance: Complex UIs with many elements may have slower traversal
- Text Input: Some specialized input fields may not properly receive keystrokes
- Authentication: Cannot interact with system authentication dialogs
Security & Access Control
Authentication
Requires Authorization: Bearer your_token header on all requests.
IP Allowlist
Restricts connections to specified CIDR ranges.
TLS/HTTPS
OAuth 2.0 + PKCE
For MCP clients that use OAuth (e.g. Claude Desktop) instead of a static API key:
Claude Desktop config (via mcp-remote bridge — see Integration Options):
Note: Claude Desktop's
claude_desktop_config.jsondoes not support"type": "http"or"url"entries directly. Usemcp-remoteas shown above, or add the server via Settings → Connectors → Add custom connector in the Claude Desktop UI.
The OAuth server exposes:
GET /.well-known/oauth-authorization-server— server metadata (RFC 8414)GET /oauth/authorize— Authorization Code + PKCE (S256required)POST /oauth/token— token exchange (client secret required)POST /oauth/register— disabled; clients must be pre-provisioned
Dynamic client registration is disabled. Redirect URIs must be loopback http(s) only.
Auth key and OAuth can coexist — both are accepted as valid Bearer tokens.
SSRF Protection
The Scrape tool blocks: private IPs, loopback, link-local, credentials-in-URLs, non-HTTP schemes.
Config File (~/.macos-mcp/config.toml)
Instead of passing flags every time, store your configuration in ~/.macos-mcp/config.toml. CLI flags always override config file values.
Search order:
--config /path/to/config.toml~/.macos-mcp/config.toml
stdio — local only, no security needed:
SSE — network access with auth and IP restriction:
Streamable HTTP — network access with auth and TLS (recommended for production):
Available tool names: App, Shell, Snapshot, Click, Type, Scroll, Move, Shortcut, Wait, Scrape, Notification
Place your cert and key files in the same directory:
Generate a self-signed cert directly into that directory:
Environment Variables
All variables are optional. Set them via the env key in claude_desktop_config.json.
Example claude_desktop_config.json (remote with auth + TLS):
Telemetry
macOS-MCP collects anonymous usage data to help improve the server. No personal information, tool arguments, or outputs are tracked.
To disable telemetry, set ANONYMIZED_TELEMETRY to false:
Security
⚠️ Important Security Notice: macOS-MCP operates with full Accessibility API permissions and executes real system operations without sandboxing. It can perform permanent, irreversible actions.
Before using macOS-MCP:
- ✅ Grant Accessibility permissions only to trusted applications
- ✅ Understand that Shell commands execute with full user privileges
- ✅ Review AI-generated action plans before execution
- ✅ Use only in virtual machines or isolated environments with valueless data
- ✅ Create backups before testing in production-like scenarios
⛔ Do NOT use on:
- Systems with irreplaceable data
- Production machines or shared systems
- Compliance-regulated environments (HIPAA, PCI, etc.)
For detailed security guidance, see SECURITY.md.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for:
- Development setup and code standards
- Testing requirements
- Pull request process
- Coding conventions (Ruff formatting, 100 char line length)
License
macOS-MCP is licensed under the MIT License - see LICENSE for details.
Acknowledgements
macOS-MCP is built with excellent open-source projects:
- PyObjC - Python to Objective-C bridge
- Pillow - Python Imaging Library
- FastMCP - MCP framework
- macOS Accessibility API (ApplicationServices)
Citation
If you use macOS-MCP in your research or project, please cite:
Questions or Issues? Open an issue or check SECURITY.md for security concerns.
来源:README.md,提交 ddac1c6
工具
0版本历史
1- v0.3.6最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分