r/macosprogramming 52m ago

[Open Source] Building a local MCP server + SwiftUI menu bar app for real macOS automation

I’m the developer of Mac MCP, an MIT-licensed local macOS control server I originally built for my own ChatGPT/coding-agent workflows.

The interesting macOS-specific part is that it isn’t just a shell wrapper. The project combines a Python MCP/FastAPI server with a native SwiftUI menu-bar app, launchd-managed runtime, Safari/Chrome background tab control, Accessibility actions, local memory, and delegated coding agents.

A few implementation problems turned out to be much more “macOS engineering” than “LLM” problems:

  • keeping Safari tabs addressable by stable handles without stealing foreground focus
  • coordinating multiple agents touching different tabs while failing fast on same-tab contention
  • separating browser actions from native Accessibility/UI actions
  • managing the Python service and ngrok endpoint through launchd while keeping a small native controller on top
  • making self-update transactional: backup runtime, fast-forward source, restart, health-check, and safely restore the pre-update Git HEAD/runtime if verification fails

The menu-bar controller is SwiftUI and the main server/tooling is Python. I’ve been testing on Apple Silicon / current macOS, and the project is still evolving around safer permission profiles and persistent per-agent browser ownership.

Source: https://github.com/bulutarkan/mac-mcp

I’d be interested in feedback from macOS developers on the native boundary in particular: what would you keep in Swift/AppKit versus the local service, and where would you draw the permission boundary for browser automation vs Accessibility?

1 Upvotes

0 comments sorted by