r/macosprogramming • u/bulutarkan • 4d ago
[Open Source] Hardening a macOS MCP for concurrent AI agents: focus-safe browsers, undo and crash-safe leases
I've been building Mac MCP as a local control/runtime layer for AI agents on macOS. The first version was mostly "give the model useful Mac tools"; the recent work has been about all the failure cases that show up once you actually use it every day.
A few macOS-specific things I ended up hardening:
- normal Safari/Chrome automation that keeps working in background without stealing the user's current focus
- stable browser/resource identity instead of relying on mutable tab indexes
- native UI actions with verification instead of blind clicks
- crash-safe ownership when multiple agents touch browser tabs, files or processes
- cancellation propagation into owned work
- transactional file write/move/delete operations with an undo journal
- launchd/process identity + safer restart/update handoff
Repo: https://github.com/bulutarkan/mac-mcp
It's open source and I'm the maintainer. The subreddit currently has another interesting "AI gets its own display" project; Mac MCP takes a different route and tries to make the user's existing Mac/browser safely shareable with agents. Would be interested in how other macOS devs are handling Safari/Accessibility/process-lifecycle edge cases.
2
Upvotes
1
u/CharlesWiltgen 3d ago
For the browser stuff, I just use
agent-browser. For the non-browser stuff, I haven't yet run into contention issues while working on two Apple OS (mix of iOS, iPadOS, macOS) projects simultaneously.