macOS-MCP

io.github.Jeomon由 GitHub 帳號 Jeomon 發布v0.3.6更新於 Oct 24, 2026

MCP server for macOS desktop automation via the Accessibility API.

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理透過輔助使用 API 控制 Mac:點擊、輸入、啟動應用程式、執行 shell 指令與擷取網頁。

可以做什麼
控制滑鼠與鍵盤:點擊、輸入、捲動、移動或拖曳,按下 Cmd+C、Cmd+Tab 等快速鍵,並可等待介面變化完成。管理應用程式與視窗:依名稱或 bundle ID 啟動應用程式,切換、移動與調整視窗大小,建立新的 Mission Control 空間。檢視桌面狀態:擷取目前介面狀態並從輔助使用樹中取出可互動元素,輔助使用資料不足時可用截圖。執行指令與腳本:透過 Shell 工具執行 shell 指令或 AppleScript。取得網頁內容:擷取頁面並轉換為 Markdown。
適用情境
適合讓助理在自己的 Mac 上直接操作應用程式與桌面,例如自動化重複的介面操作、在檔案與應用程式間瀏覽,或在不依賴電腦視覺的情況下執行視窗與鍵盤操作。它適用於本機、隔離或可丟棄的環境,而非正式或共用機器。
執行需求
在 macOS 12 或更新版本上以本機方式執行,需要 Python 3.11+ 與 UV 套件管理員(uvx macos-mcp)。介面互動需要輔助使用權限,Snapshot 工具需要螢幕錄製權限,兩者都需在系統設定中手動授予。使用網路傳輸時可設定驗證金鑰、選用的 IP 允許清單、TLS 憑證與私鑰,或 OAuth 用戶端憑證。
安裝前請注意
它以完整輔助使用權限執行且沒有沙箱,可能進行永久、不可逆的操作;README 建議不要用於存有不可取代資料的系統、正式或共用機器,以及受法規監管的環境。Shell 指令以完整使用者權限執行。匿名遙測預設開啟,可用 ANONYMIZED_TELEMETRY 關閉。若透過 HTTP 對外提供,應設定 MACOS_MCP_AUTH_KEY 與 IP 允許清單,避免在未設定時綁定到 0.0.0.0。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 macOS-MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[MCP Toplist]

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 uv or curl -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:

shell
uvx macos-mcp serve
# Or with SSE/Streamable HTTP for network accessuvx macos-mcp serve --transport sse --host localhost --port 8000uvx macos-mcp serve --transport streamable-http --host localhost --port 8000

Run it as a background service that starts now and at every login:

shell
macos-mcp install
# Or choose the HTTP transport and bind address explicitlymacos-mcp install --transport sse --host 127.0.0.1 --port 8000

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

TransportFlagUse Case
stdio (default)--transport stdioDirect connection from MCP clients like Claude Desktop, Cursor, etc.
sse--transport sse --host HOST --port PORTNetwork-accessible via Server-Sent Events
streamable-http--transport streamable-http --host HOST --port PORTNetwork-accessible via HTTP streaming (recommended for production)

Grant Required Permissions

macOS-MCP requires Accessibility and Screen Recording permissions to function properly.

Accessibility Permissions
  1. Open System Settings → Privacy & Security → Accessibility
  2. Click the lock icon and authenticate
  3. Add the following applications:
    • Your terminal application (Terminal, iTerm2, VS Code, etc.)
    • Python (typically /usr/bin/python3 or the Python version managed by UV)
    • UV (~/.local/bin/uv if installed locally, or the Python environment UV manages)
  4. 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:

  1. Open System Settings → Privacy & Security → Screen Recording
  2. Click the lock icon and authenticate
  3. Add the same applications as above (terminal, Python, UV)
  4. Restart the terminal after granting permissions

Note: If the Snapshot tool fails, verify both permissions are granted in System Settings.

Integration Options

Claude Desktop
  1. Install Claude Desktop

  2. Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "macos-mcp": {      "command": "uvx",      "args": ["macos-mcp", "serve"]    }  }}
  1. 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):

shell
macos-mcp install --transport streamable-http --host 127.0.0.1 --port 8000

2. Configure Claude Desktop to connect via mcp-remote:

json
{  "mcpServers": {    "macos-mcp": {      "command": "npx",      "args": [        "-y",        "mcp-remote",        "http://127.0.0.1:8000/mcp",        "--transport",        "http-only"      ]    }  }}

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):

shell
# Start server with an auth keymacos-mcp install --transport streamable-http --host 0.0.0.0 --port 8000 \  --auth-key "your-secret-token"
json
{  "mcpServers": {    "macos-mcp": {      "command": "npx",      "args": [        "-y",        "mcp-remote",        "http://127.0.0.1:8000/mcp",        "--transport",        "http-only",        "--header",        "Authorization: Bearer your-secret-token"      ]    }  }}
Gemini CLI
  1. Install Gemini CLI:
shell
npm install -g @google/gemini-cli
  1. Navigate to ~/.gemini and open settings.json

  2. Add the server config:

json
{  "theme": "Default",  "mcpServers": {    "macos-mcp": {      "command": "uvx",      "args": ["macos-mcp", "serve"]    }  }}
  1. Restart Gemini CLI
Claude Code
  1. Install Claude Code

  2. 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:

shell
pi install git:github.com/CursorTouch/MacOS-MCP

After install, restart Pi or run:

text
/reload

Try without installing:

shell
pi -e git:github.com/CursorTouch/MacOS-MCP

Local checkout setup:

shell
git clone https://github.com/CursorTouch/MacOS-MCP.gitcd MacOS-MCPuv syncnpm installpi

If you copied only the extension into another Pi project, run Pi from the macOS-MCP checkout or set:

shell
export MACOS_MCP_ROOT=/path/to/MacOS-MCP

The extension exposes these Pi tools:

Pi ToolPurpose
mac_snapshotRead current macOS UI state through the existing Snapshot tool.
mac_appLaunch, switch, move, or resize macOS applications/windows.
mac_clickClick coordinates returned by mac_snapshot.
mac_typeType text at coordinates returned by mac_snapshot.
mac_shortcutRun keyboard shortcuts such as command+c or command+space.
mac_scrollScroll at the current pointer or coordinates.
mac_waitWait for UI changes/loading.

Recommended agent workflow:

  • Call mac_snapshot first.
  • Use the coordinates returned by Snapshot with mac_click, mac_type, and mac_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:

shell
git clone https://github.com/CursorTouch/MacOS-MCP.gitcd MacOS-MCPuv synctau

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:

shell
export MACOS_MCP_ROOT=/path/to/MacOS-MCP

The extension exposes these Tau tools:

Tau ToolPurpose
mac_snapshotRead current macOS UI state through the existing Snapshot tool.
mac_appLaunch, switch, or resize macOS applications/windows.
mac_clickClick coordinates returned by mac_snapshot.
mac_typeType text at coordinates returned by mac_snapshot.
mac_shortcutRun keyboard shortcuts such as command+c or command+space.
mac_scrollScroll at the current pointer or coordinates.
mac_waitWait for UI changes/loading.

Recommended agent workflow:

  • Call mac_snapshot first.
  • Use the coordinates returned by Snapshot with mac_click, mac_type, and mac_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:

ToolPurpose
ClickClick at coordinates with support for left, right, and double-click
TypeType text at cursor position, optionally clearing existing text
ScrollScroll vertically or horizontally in focused window or regions
MoveMove mouse pointer or drag to coordinates
ShortcutPress keyboard shortcuts (Cmd+C, Cmd+Tab, etc.)
AppLaunch applications, manage windows (resize/move), switch between apps. Supports app names and bundle IDs
DesktopCreate a new Mission Control Space (virtual desktop) via Accessibility, verifying the space count increased
ShellExecute commands or AppleScript. Use mode='osascript' for AppleScript
ScrapeExtract and convert webpage content to Markdown format
WaitPause execution for a defined duration

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

shell
macos-mcp serve --transport sse --host 0.0.0.0 --auth-key "your_token"

Requires Authorization: Bearer your_token header on all requests.

IP Allowlist

shell
macos-mcp serve --auth-key "token" --ip-allowlist "203.0.113.0/24,198.51.100.5"

Restricts connections to specified CIDR ranges.

TLS/HTTPS

shell
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
macos-mcp serve --ssl-certfile cert.pem --ssl-keyfile key.pem

OAuth 2.0 + PKCE

For MCP clients that use OAuth (e.g. Claude Desktop) instead of a static API key:

shell
macos-mcp serve --transport streamable-http --host 0.0.0.0 \  --ssl-certfile ~/.macos-mcp/cert.pem \  --ssl-keyfile  ~/.macos-mcp/key.pem \  --oauth-client-id my-client \  --oauth-client-secret my-secret

Claude Desktop config (via mcp-remote bridge — see Integration Options):

json
{  "mcpServers": {    "macos-mcp": {      "command": "npx",      "args": [        "-y",        "mcp-remote",        "https://<host>:8000/mcp",        "--transport",        "http-only"      ]    }  }}

Note: Claude Desktop's claude_desktop_config.json does not support "type": "http" or "url" entries directly. Use mcp-remote as 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 (S256 required)
  • 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:

  1. --config /path/to/config.toml
  2. ~/.macos-mcp/config.toml

stdio — local only, no security needed:

toml
[server]transport = "stdio"

SSE — network access with auth and IP restriction:

toml
[server]transport = "sse"host      = "0.0.0.0"port      = 8000auth_key  = "your-secret-key"
[security]ip_allowlist = ["192.168.1.0/24"]

Streamable HTTP — network access with auth and TLS (recommended for production):

toml
[server]transport    = "streamable-http"host         = "0.0.0.0"port         = 8000auth_key     = "your-secret-key"ssl_certfile = "cert.pem"   # resolved relative to ~/.macos-mcp/ssl_keyfile  = "key.pem"
[security]ip_allowlist        = ["192.168.1.0/24"]oauth_client_id     = "my-client"      # optional — enables OAuth 2.0 + PKCEoauth_client_secret = "my-secret"
[tools]exclude = ["Shell", "Scrape"]   # disable specific tools

Available tool names: App, Shell, Snapshot, Click, Type, Scroll, Move, Shortcut, Wait, Scrape, Notification

Place your cert and key files in the same directory:

~/.macos-mcp/├── config.toml├── cert.pem└── key.pem

Generate a self-signed cert directly into that directory:

shell
mkdir -p ~/.macos-mcpopenssl req -x509 -newkey rsa:4096 \  -keyout ~/.macos-mcp/key.pem \  -out ~/.macos-mcp/cert.pem \  -days 365 -nodes

Environment Variables

All variables are optional. Set them via the env key in claude_desktop_config.json.

VariableDefaultDescription
ANONYMIZED_TELEMETRYtrueSet to false to disable anonymous usage telemetry. No personal data, tool arguments, or outputs are ever collected.
MACOS_MCP_AUTH_KEY(none)Bearer token required on all HTTP requests. Alternative to --auth-key CLI flag.
MACOS_MCP_IP_ALLOWLIST(none)Comma-separated list of allowed client IPs or CIDR ranges. Alternative to --ip-allowlist CLI flag.
MACOS_MCP_SSL_CERTFILE(none)Path to TLS certificate file (.pem). Must be provided with MACOS_MCP_SSL_KEYFILE.
MACOS_MCP_SSL_KEYFILE(none)Path to TLS private key file (.pem). Must be provided with MACOS_MCP_SSL_CERTFILE.

Example claude_desktop_config.json (remote with auth + TLS):

json
{  "mcpServers": {    "macos-mcp": {      "command": "uvx",      "args": ["macos-mcp", "serve", "--transport", "sse", "--host", "0.0.0.0"],      "env": {        "MACOS_MCP_AUTH_KEY": "your_token",        "MACOS_MCP_IP_ALLOWLIST": "203.0.113.0/24",        "MACOS_MCP_SSL_CERTFILE": "/path/to/cert.pem",        "MACOS_MCP_SSL_KEYFILE": "/path/to/key.pem"      }    }  }}

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:

json
{  "mcpServers": {    "macos-mcp": {      "command": "uvx",      "args": ["macos-mcp", "serve"],      "env": { "ANONYMIZED_TELEMETRY": "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:

bibtex
@software{macos-mcp,  author       = {Jeomon George},  title        = {macOS-MCP: Lightweight MCP Server for macOS Automation},  year         = {2025},  publisher    = {GitHub},  url          = {https://github.com/Jeomon/macos-mcp}}

Questions or Issues? Open an issue or check SECURITY.md for security concerns.

來源:README.md,提交 ddac1c6

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.6最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分