-
-
Save oronbz/74f7b5785f12554467d52f4e03056852 to your computer and use it in GitHub Desktop.
Auto-approve annoying Xcode 26.3 MCP prompts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env osascript -l JavaScript | |
| // Find and approve any MCP agent access dialogs in Xcode. | |
| function run() { | |
| var se = Application("System Events"); | |
| try { se.processes.byName("Xcode").name(); } catch (e) { return "Xcode not running."; } | |
| var count = 0; | |
| var windows = se.processes.byName("Xcode").windows(); | |
| for (var i = 0; i < windows.length; i++) { | |
| try { | |
| var w = windows[i]; | |
| if (w.subrole() !== "AXDialog") continue; | |
| if (!w.staticTexts().some(function(t) { return (t.value() || "").indexOf("to access Xcode?") !== -1; })) continue; | |
| w.buttons.byName("Allow").click(); | |
| count++; | |
| } catch (e) {} | |
| } | |
| return count ? "Allowed " + count + " MCP connection(s)." : "No MCP dialogs found."; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "hooks": { | |
| "SessionStart": [ | |
| { | |
| "hooks": [ | |
| { | |
| "type": "command", | |
| "command": "\"$CLAUDE_PROJECT_DIR\"/path/to/hook_allow_mcp.js", | |
| "timeout": 10 | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment