mac-pilot-mcp
Interacts with Discord using Electron fallback with Chrome DevTools Protocol for UI automation.
Provides optional Chrome DevTools Protocol fallback for deeper UI inspection of Electron apps (e.g., VSCode, Slack, Discord).
Automates Figma actions such as exporting frames as PNG via UI automation and AppleScript.
Automates macOS system tasks including AppleScript, JXA, shell commands, window management, clipboard, notifications, and more.
Retrieves current URL and title, and performs other browser automation tasks.
Interacts with Slack using Electron fallback with Chrome DevTools Protocol for UI automation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mac-pilot-mcp toggle dark mode"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
The Problem
There are 7+ macOS automation MCP servers. None of them remember anything. Every session starts from zero — same trial and error, same failures, same wasted tokens.
Related MCP server: openowl
The Solution
Mac-Pilot is different. It learns from every interaction:
Success? The pattern is auto-saved as app-specific knowledge
Failure? The error is recorded so it won't repeat the same mistake
Multi-step workflow? Save it as a recipe — replay it in one call next time
Ships with 21 built-in recipes so you're productive from the first run.
Quick Start
Install
npm install -g mac-pilot-mcpConnect to your AI client
claude mcp add mac-pilot -- mac-pilot-mcpOr manually add to ~/.claude.json:
{
"mcpServers": {
"mac-pilot": {
"command": "mac-pilot-mcp"
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"mac-pilot": {
"command": "npx",
"args": ["-y", "mac-pilot-mcp"]
}
}
}Add to your MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"mac-pilot": {
"command": "npx",
"args": ["-y", "mac-pilot-mcp"]
}
}
}Add to your MCP config:
{
"mcpServers": {
"mac-pilot": {
"command": "npx",
"args": ["-y", "mac-pilot-mcp"]
}
}
}Grant Permissions
Mac-Pilot needs Accessibility access for UI automation:
System Settings → Privacy & Security → Accessibility
Toggle ON for your terminal app (Terminal, iTerm2, VS Code, Cursor, etc.)
Restart the terminal
How It Works
You: "Export the current Figma frame as PNG"
┌─ First time ─────────────────────────────────────────┐
│ │
│ 1. mac_recipe_search("Figma export") → No matches │
│ 2. mac_state() → Figma is frontmost │
│ 3. mac_run(applescript) → File > Export > PNG │
│ 4. mac_recipe_save("export-figma-png", steps=[...]) │
│ │
│ ✓ Worked! Pattern saved automatically. │
└───────────────────────────────────────────────────────┘
┌─ Next time ───────────────────────────────────────────┐
│ │
│ 1. mac_recipe_search("Figma export") │
│ → Found: export-figma-png (100% success rate) │
│ 2. mac_recipe_run("export-figma-png") │
│ → Done instantly │
│ │
│ ⚡ 4 steps → 2 steps. No trial and error. │
└───────────────────────────────────────────────────────┘Tools
Tool | What it does |
| Execute AppleScript, JXA, shell commands, open apps/URLs, click, type, keypress |
| Query system state — frontmost app, windows, clipboard, running apps |
| Find UI elements via Accessibility API (buttons, fields, menus) |
| Capture screen/window/region as base64 PNG |
| Save a working action sequence as a reusable recipe |
| Replay a saved recipe with parameter substitution |
| Full-text search across recipes and action history |
Built-in Recipes
21 recipes ship out of the box — no setup needed:
Category | Recipes | Example |
System |
|
|
Finder |
|
|
Safari |
|
|
Clipboard |
|
|
Notifications |
|
|
Terminal |
|
|
Windows |
|
|
Music |
|
|
Examples
AppleScript
{ "actionType": "applescript", "script": "tell application \"Finder\" to get name of every window" }JXA (JavaScript for Automation)
{ "actionType": "jxa", "script": "Application('Safari').documents[0].url()" }Shell command
{ "actionType": "shell", "command": "ls -la ~/Desktop" }Open an app or URL
{ "actionType": "open", "target": "Safari" }
{ "actionType": "open", "target": "https://github.com" }Type text
{ "actionType": "type", "text": "Hello World" }Keyboard shortcut
{ "actionType": "keypress", "text": "cmd+c" }
{ "actionType": "keypress", "text": "cmd+shift+4" }Find UI elements
mac_find_ui { "app": "Safari", "role": "AXButton" }
mac_find_ui { "app": "Finder", "searchText": "Downloads" }Electron apps (VSCode / Cursor / Slack / Discord) — macOS Accessibility
exposes a thin tree for Electron, so Mac-Pilot can optionally fall back to
Chrome DevTools Protocol when the app is launched with
--remote-debugging-port=<PORT>. See docs/ELECTRON-SUPPORT.md.
mac_find_ui {
"app": "Visual Studio Code",
"searchText": "Run Test",
"useElectronFallback": "auto"
}Take a screenshot
mac_screenshot { "target": "screen", "scale": 0.3 }
mac_screenshot { "target": "window", "windowName": "Safari" }Save a custom recipe
mac_recipe_save {
"name": "open-project",
"description": "Open VS Code at project directory",
"steps": [
{ "actionType": "shell", "params": { "command": "code {{path}}" }, "description": "Open VS Code" }
],
"parameters": [
{ "name": "path", "description": "Project directory path" }
],
"tags": ["dev", "vscode"]
}Security
Mac-Pilot blocks dangerous operations before they execute:
Layer | Protection |
Hard block |
|
Risk classification | Every action is rated |
Audit log | All actions (including blocked ones) are logged to SQLite |
Dry run | Test any action with |
Auto-cleanup | Action logs older than 30 days are pruned automatically |
Architecture
~/.mac-pilot/pilot.db (SQLite, WAL mode)
├── action_log — Every action executed, with timing + success/failure
├── action_log_fts — Full-text search index over action history
├── recipes — Saved automation sequences
├── recipes_fts — Full-text search index over recipes
├── app_knowledge — Per-app quirks, selectors, workarounds (auto-learned)
└── security_log — Blocked command audit trailBuilt-in recipes are auto-loaded on first run. Your custom recipes and learned knowledge persist across sessions.
Comparison
Feature | mac-pilot-mcp | Other MCP servers |
Self-learning (auto-saves knowledge) | Yes | No |
Reusable recipes with parameters | Yes | No |
Built-in recipe library | 21 | 0 |
JXA + AppleScript | Both | Usually one |
Full-text search (recipes + history) | Yes | No |
Security audit log | Yes | Rare |
Risk classification (4 levels) | Yes | No |
Dry run mode | Yes | Rare |
Action log auto-cleanup | Yes | No |
Troubleshooting
Your terminal needs Accessibility permission:
System Settings → Privacy & Security → Accessibility
Toggle ON for your terminal
Restart the terminal app completely
The target app must be running. Open it first:
mac_run { "actionType": "open", "target": "AppName" }Reduce the scale (default is 0.5):
mac_screenshot { "target": "screen", "scale": 0.3 }Recipe names are case-sensitive. Search first:
mac_recipe_search { "query": "your keyword" }Use dry run to check the risk classification:
mac_run { "actionType": "shell", "command": "your-command", "dryRun": true }Requirements
macOS (darwin only)
Node.js >= 18
Accessibility permission for UI automation
Contributing
Issues and PRs welcome at github.com/leesgit/mac-pilot-mcp.
git clone https://github.com/leesgit/mac-pilot-mcp.git
cd mac-pilot-mcp
npm install
npm run build
npm test # 144 testsLicense
MIT - Byeongchang Lee
Available Tools
11 toolsmac_clipboardA
Read / write / clear the macOS clipboard (text only, via pbpaste/pbcopy).
Examples:
Read text: { action: "read" }
Write text: { action: "write", text: "hello" }
Clear: { action: "clear" }
Limitations:
Text only. Images/files in the clipboard appear as their typed name.
No clipboard history — only the current value.
Inputs: action (required), text.
mac_find_uiA
Find UI elements (role, title, position, size) in an app via Accessibility, with optional Electron CDP fallback.
Examples:
All buttons in Safari: { app: "Safari", role: "AXButton" }
Element by title: { app: "Mail", title: "Send" }
Fuzzy search: { app: "Finder", searchText: "Documents" }
Electron AX (VSCode with --remote-debugging-port=9222): { app: "Visual Studio Code", useElectronFallback: true }
Auto-fallback for known Electron apps: { app: "Cursor", useElectronFallback: "auto" }
Limitations:
Requires Accessibility permission for the client app.
Electron apps (VSCode, Cursor, Slack, Discord) expose a thin AX tree; use useElectronFallback when AX returns empty.
CDP fallback needs the user to relaunch the app with --remote-debugging-port=.
Inputs: app (required), role, title, maxResults, +3 more.
mac_permissionsA
Check macOS Privacy permissions (Automation/Accessibility/Screen Recording) + deep-link to grant.
Examples:
{ check: "all" } → return state of all 3 permissions
{ check: "accessibility" } → only Accessibility
Limitations:
macOS doesn't expose TCC state to ordinary processes. We probe by attempting a known-safe operation and observing the error class.
"Screen Recording" cannot be detected reliably without invoking a screenshot; we report "unknown" instead of guessing.
Inputs: check.
mac_recipe_exportA
Export user-saved recipes as a portable .mac-recipe.json bundle (built-ins excluded by default).
Examples:
Export one recipe inline: { name: "open-url-in-private" }
Export all user recipes to a file: { outputPath: "~/recipes/backup.json" }
Include built-ins: { outputPath: "~/recipes/full.json", includeBuiltins: true }
Format: mac-recipe-bundle/v1 (versioned for forward compatibility).
Limitations: outputPath must resolve under $HOME and end with .json.
Inputs: name, outputPath, includeBuiltins.
mac_recipe_importA
Import a .mac-recipe.json bundle (inline or file path). Conflict policy: skip | rename | replace.
Examples:
From file: { inputPath: "~/recipes/team-bundle.json" }
From file with replace policy: { inputPath: "~/recipes/team.json", onConflict: "replace" }
Inline bundle: { bundle: { format: "mac-recipe-bundle/v1", exportedAt: "...", recipes: [...] } }
Conflict policy:
"skip" (default): keep existing recipe
"rename": append "-imported-N" until name is unique
"replace": delete existing first
Limitations:
Provide exactly one of
bundleorinputPath.Bundle format major version is enforced — v2 bundles rejected.
Inputs: bundle, inputPath, onConflict.
mac_recipe_runA
Run a saved recipe by name with parameter values.
Examples:
{ name: "toggle-dark-mode" }
{ name: "open-url-in-private", params: { url: "https://example.com" } }
Dry run (preview steps): { name: "send-email", params: { ... }, dryRun: true }
Limitations:
Stops on the first failed step (no partial rollback).
Each step inherits the recipe's app as appContext for self-learning.
Inputs: name (required), dryRun, params.
mac_recipe_saveA
Save a multi-step automation as a named recipe. {{param}} placeholders are JSON-safe substituted.
Example: { name: "open-url-in-private", description: "Open a URL in Safari private window", app: "Safari", steps: [ { actionType: "open", params: { target: "Safari" }, description: "Launch Safari" }, { actionType: "keypress", params: { text: "cmd+shift+n" }, description: "Open private window" }, { actionType: "keypress", params: { text: "cmd+l" }, description: "Focus address bar" }, { actionType: "type", params: { text: "{{url}}" }, description: "Enter URL" }, { actionType: "keypress", params: { text: "return" }, description: "Navigate" } ], parameters: [{ name: "url", description: "URL to open" }], tags: ["safari", "browser", "private"] }
Limitations:
Recipe names are unique. Re-saving the same name fails — delete or rename.
Each step's params goes through the security sandbox at run time.
Inputs: name (required), steps (required), description (required), app, +2 more.
mac_recipe_searchA
Search 118 built-in + saved recipes by natural-language query. Call this BEFORE writing new AppleScript.
Examples:
{ query: "dark mode" } → matches toggle-dark-mode, get-dark-mode
{ query: "screenshot", app: "Finder" }
{ query: "send email", includeHistory: true }
Limitations:
FTS5 tokenizer is English-biased. For Korean/CJK, supplement with the
appfilter.
Inputs: query (required), app, includeHistory.
mac_runA
Run an AppleScript/JXA/shell command or send click/type/keypress to macOS.
Supported actionTypes: applescript, jxa, shell, open, click, type, keypress.
Examples:
Open Safari: { actionType: "open", target: "Safari" }
Type text: { actionType: "type", text: "hello world" }
Cmd+C: { actionType: "keypress", text: "cmd+c" }
Run AppleScript: { actionType: "applescript", script: 'tell application "Finder" to activate', appContext: "Finder" }
List files: { actionType: "shell", command: "ls -la ~/Documents" }
Limitations:
Requires Accessibility + Automation permissions for click/type/keypress and AS targeting other apps.
Cannot bypass the lock screen.
Dangerous shell patterns (rm -rf /, curl|sh, sudo, etc.) are blocked by the sandbox.
Set appContext for the best self-learning: errors get classified per-app and reliable hints are auto-prepended on subsequent calls.
Inputs: actionType (required), x, y, text, +6 more.
mac_screenshotA
Capture screen, window, or region as base64 PNG.
Examples:
Full screen: { target: "screen" }
Specific app window: { target: "window", windowName: "Safari" }
Region (x,y from top-left): { target: "region", region: { x: 0, y: 0, width: 800, height: 600 } }
High-fidelity capture: { target: "screen", scale: 1.0 } (warning: larger token cost)
Limitations:
Requires Screen Recording permission (System Settings → Privacy & Security → Screen Recording).
Default scale is 0.5 to keep token cost reasonable; bump for OCR-quality captures.
Cursor is not included in the capture.
Inputs: target (required), scale, region, windowName.
mac_stateA
Read current macOS state: frontmost app, windows, Finder selection, running apps.
Examples:
All state: {} (returns everything)
Window list only: { include: ["windows"] }
Frontmost app: { include: ["frontmost_app"] }
Limitations:
Window list requires Accessibility for the apps you want to see.
"clipboard" still works but
mac_clipboardis preferred (lighter + write support).
Inputs: include.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct aspect of macOS automation: mac_run executes commands, mac_state reads system state, mac_clipboard manages the clipboard, mac_find_ui inspects UI elements, mac_screenshot captures the screen, and the recipe* tools cover the full recipe lifecycle. There is no meaningful overlap; even mac_run and mac_recipe_run are clearly separated by ad-hoc vs saved workflows.
All tools share the mac_ prefix and use snake_case, but the verb/noun order varies: mac_run and mac_find_ui are verb-first, while mac_state and mac_permissions are noun-first, and recipe tools use recipe_verb (e.g., mac_recipe_export). This is a minor deviation from a fully consistent verb_noun pattern but remains predictable and readable.
With 11 tools, the server is well-scoped for macOS automation. It covers command execution, state inspection, clipboard, UI inspection, screenshots, permissions, and a complete recipe subsystem without bloating. The count sits comfortably in the ideal 3-15 range and each tool earns its place.
The tool surface covers core automation actions (run, state, UI, screenshot, clipboard) and a full recipe lifecycle (save, run, search, export, import). Minor gaps exist, such as no explicit recipe deletion or a dedicated list-all tool, but these can be worked around via search or export, so agent workflows are not severely hindered.
Maintenance
Related MCP Connectors
Shared, tested playbooks (recipes) for AI agents. Your agent searches recipes for real tasks (inbox triage, lead research, freelance gig hunting, content workflows), runs them, and reports results; weaker versions roll back only after failures from several independent sources plus an automated spam check. Free, no install, no email needed: one remote MCP URL.
Open-source Zapier/n8n alternative as an MCP server: agents build, run and debug your workflows.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for macOS that enables AI agents to control the desktop GUI through keyboard input, mouse actions, and screen captures. It provides stable low-level primitives for UI automation and agent-driven desktop workflows.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that gives any AI assistant eyes and hands on your desktop — screenshots, clicking, typing, OCR, window management, accessibility-tree queries, workflow recording.5Apache 2.0
- AlicenseNot gradedqualityDmaintenanceStandalone MCP server that gives AI agents full GUI control over macOS — screenshots, mouse, keyboard, apps, clipboard, and multi-display — with zero private dependencies.20MIT
- AlicenseBqualityDmaintenanceMCP server that enables AI to fully control macOS — mouse, keyboard, terminal, screenshots, window management, UI element detection, and provides AI-optimized information reporting.3629 npmMIT