{"slug": "mcp-server-that-lets-claude-click-menus-on-your-mac-and-fix-its-own-mistakes", "title": "MCP server that lets Claude click menus on your Mac and fix its own mistakes", "summary": "A new MCP server called mcp-osascript lets Claude AI control macOS by moving windows, clicking menus, typing text, and managing browser tabs through 12 typed tools with input validation and security guardrails. The server automatically corrects menu-click errors by returning available items, enabling Claude to retry with the correct name.", "body_md": "**Let Claude control your Mac.** Move windows, click menus, type text, read clipboard, manage browser tabs — 12 typed tools with input validation and security guardrails.\n\n```\n{\n  \"mcpServers\": {\n    \"osascript\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-osascript\"]\n    }\n  }\n}\n```\n\nAdd this to your Claude Desktop config (`Settings → Developer → Edit Config`\n\n), restart Claude, and you're ready.\n\n## Config for other clients (Cursor, VS Code, Claude Code)\n\n**Cursor / VS Code (Copilot)**\n\n```\n{\n  \"mcpServers\": {\n    \"osascript\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-osascript\"]\n    }\n  }\n}\n```\n\n**Claude Code**\n\n```\nclaude mcp add osascript -- npx -y mcp-osascript\n```\n\n**From source (development)**\n\n```\ngit clone https://github.com/m0rvayne/mcp-osascript.git\ncd mcp-osascript && npm install\n# then use: \"command\": \"node\", \"args\": [\"/path/to/mcp-osascript/server/index.js\"]\n```\n\nOnce installed, ask Claude:\n\n| Prompt | What happens |\n|---|---|\n\"Open Safari and show me what tabs I have\" |\nLaunches Safari, reads all tab titles and URLs |\n\"Move the Finder window to the left half of my screen\" |\nResizes and positions the window |\n\"Click File → Export as PDF in Keynote\" |\nNavigates the menu bar and clicks the item |\n\"Copy the URL from my active Chrome tab\" |\nReads browser tabs, finds the active one |\n\"Type 'Hello World' into the active text field\" |\nSimulates keyboard input |\n\"Show a notification when you're done\" |\nDisplays a native macOS banner |\n\"What app am I using right now?\" |\nReturns the frontmost app name and bundle ID |\n\"Press Cmd+Shift+4\" |\nTriggers the screenshot shortcut |\n\"List all items in the Edit menu of VS Code\" |\nIntrospects the menu bar |\n\"Close the second window of Terminal\" |\nTargets a specific window by index |\n\n12 typed tools, each with input validation, error classification, and permission-aware error messages.\n\n| Tool | What it does | Permission |\n|---|---|---|\n`run_osascript` |\nExecute any AppleScript or JXA script | None |\n`get_clipboard` |\nRead clipboard as text | None |\n`set_clipboard` |\nWrite text to clipboard | None |\n`send_notification` |\nShow macOS notification banner | None |\n`open_url` |\nOpen URL in browser (http/https/mailto only) | None |\n`open_app` |\nLaunch or bring app to front | None |\n`get_frontmost_app` |\nGet active app name + bundle ID | Automation |\n`get_browser_tabs` |\nList tabs in Safari, Chrome, or Arc | Automation |\n`type_text` |\nType text into active app (max 500 chars) | Accessibility |\n`press_key` |\nPress key with modifiers (cmd+c, return, f5) | Accessibility |\n`manage_windows` |\nList / move / resize / minimize / fullscreen / close | Accessibility |\n`app_menu` |\nList or click menu items in any app | Accessibility |\n\nWhen Claude tries to click a menu item that doesn't exist, the server automatically returns the list of available items at that level — so Claude can retry with the correct name. No other MCP server does this.\n\n```\nUser:   \"Click File → Export as PDF in Preview\"\nClaude: calls app_menu click [\"File\", \"Export as PDF\"]\nServer: \"Menu item 'Export as PDF' not found in 'File'.\n         Available: ['New from Clipboard', 'Open...', 'Close', 'Save',\n         'Duplicate', 'Rename...', 'Export...', 'Export as PDF...']\"\nClaude: calls app_menu click [\"File\", \"Export as PDF...\"]\nServer: \"Clicked: File > Export as PDF...\"\n```\n\n| mcp-osascript | steipete (824★) | peakmojo (463★) | |\n|---|---|---|---|\n| Typed tools with validation | 12 |\n2 (generic) | 1 (generic) |\n| URL scheme allowlist | http/https/mailto |\nNo | No |\n| Env isolation (child process) | PATH+HOME+LANG only |\nFull process.env | Full process.env |\n| Process group kill (no orphans) | SIGTERM→SIGKILL |\nNo | No |\n| Error sanitization (paths, tokens) | Yes |\nNo | No |\n| Prototype pollution protection | Object.create(null) |\nNo | No |\n| Self-correcting menu click | Yes |\nNo | No |\n| Integration tests | 41 |\n0 | 0 |\n| Stdin piping (no temp files) | Yes |\nTemp files | Temp files |\n\nTools work in three tiers:\n\n**No permission needed**— clipboard, notifications, URLs, apps. Works immediately.** Automation**— browser tabs, frontmost app. macOS prompts once per browser.** Accessibility**— keyboard, windows, menus. Grant once in** System Settings → Privacy & Security → Accessibility**.\n\nWhen a permission is missing, the server tells you exactly what to do:\n\n```\n\"Accessibility permission required. Grant access to 'osascript'\nin System Settings > Privacy & Security > Accessibility.\"\nnpm test\n```\n\n41 integration tests covering all 12 tools — input validation, security boundaries (URL scheme blocking, prototype pollution, script size limits), timeout enforcement, and permission error handling.\n\n## Security & Architecture\n\n`run_osascript`\n\nexecutes arbitrary code — this is by design. The MCP client (Claude) is the trust boundary.- Scripts piped via stdin to\n`/usr/bin/osascript`\n\n— no temp files, no TOCTOU race conditions. - Script size: 50 KB max. Output: 50K chars max (truncated).\n- Error messages sanitized — filesystem paths, tokens, and passwords are stripped.\n- Child processes get minimal env:\n`PATH`\n\n,`HOME`\n\n,`LANG`\n\nonly — no API keys or secrets leak. - URL scheme allowlist —\n`file://`\n\n,`smb://`\n\n,`vnc://`\n\n,`javascript:`\n\nall blocked. - Handler dispatch uses\n`Object.create(null)`\n\n— no prototype pollution.\n\n- Process group kill on timeout — SIGTERM → 2s grace → SIGKILL. No orphaned processes.\n- Concurrency semaphore — max 5 simultaneous osascript processes.\n- Graceful shutdown —\n`server.close()`\n\nwith 10s force-exit safety net. - Error classification — parses macOS error codes (-1728, -1743, -25211) into actionable messages. Supports English and Russian locales.\n\n- macOS 13+ (Ventura or later)\n- Node.js 18+\n\nMIT", "url": "https://wpnews.pro/news/mcp-server-that-lets-claude-click-menus-on-your-mac-and-fix-its-own-mistakes", "canonical_source": "https://github.com/m0rvayne/mcp-osascript", "published_at": "2026-06-21 10:08:07+00:00", "updated_at": "2026-06-21 10:37:22.863621+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "ai-products"], "entities": ["Claude", "macOS", "Safari", "Chrome", "Arc", "VS Code", "Keynote", "Finder"], "alternates": {"html": "https://wpnews.pro/news/mcp-server-that-lets-claude-click-menus-on-your-mac-and-fix-its-own-mistakes", "markdown": "https://wpnews.pro/news/mcp-server-that-lets-claude-click-menus-on-your-mac-and-fix-its-own-mistakes.md", "text": "https://wpnews.pro/news/mcp-server-that-lets-claude-click-menus-on-your-mac-and-fix-its-own-mistakes.txt", "jsonld": "https://wpnews.pro/news/mcp-server-that-lets-claude-click-menus-on-your-mac-and-fix-its-own-mistakes.jsonld"}}