How theguywithouth/mac-computer-use works
mac-use exposes desktop-control tools through an MCP stdio server. The main workflow is an MCP client request routed to the selected backend, then to macOS app discovery, accessibility inspection, screenshots, or UI actions; results return through the server. The native helper is the documented default, with a CLI fallback. The Swift helper excerpt is partial, so feature-level links rely on README statements and some internal implementation boundaries remain intentionally broad.
Main entry points: ComputerUseNativeHelper.swift Native Helper · server.ts Stdio MCP Server · native-helper-backend.ts Native Backend · cli-backend.ts CLI Backend
Components 15
MCP Interface
- Stdio MCP Server
src/server.ts
Backend Runtime
- Native Backend
src/native-helper-backend.ts - CLI Backend
src/cli-backend.ts - Helper Protocol
src/helper-protocol.ts
Native Desktop Control
- Native Helper
helper/ComputerUseNativeHelper.swift - App Discovery
helper/ComputerUseNativeHelper.swift - Accessibility State
helper/ComputerUseNativeHelper.swift - UI Actions
helper/ComputerUseNativeHelper.swift - Cursor Overlay
helper/ComputerUseNativeHelper.swift - Window Capture
helper/WindowCaptureHelper.swift
Contracts and Parsing
- Tool Contracts
src/contract.ts - Backend Interface
src/backend.ts - Observed Output Parser
src/observed-parser.ts
Other components
- MCP Client
- macOS Apps and APIs
Connections 18
- MCP Client → Stdio MCP Server: sends tools
README.md - Stdio MCP Server → Backend Interface: uses contract
src/server.ts - Stdio MCP Server → Native Backend: routes by default
src/server.ts - Stdio MCP Server → CLI Backend: routes optionally
src/server.ts - Stdio MCP Server → MCP Client: returns results
src/server.ts - Native Backend → Helper Protocol: formats requests
src/native-helper-backend.ts - Native Backend → Native Helper: dispatches requests
src/native-helper-backend.ts - CLI Backend → macOS Apps and APIs: runs desktop operations
- Native Helper → App Discovery: provides listing
README.md - Native Helper → Accessibility State: inspects UI
README.md - Native Helper → UI Actions: performs actions
README.md - Native Helper → Window Capture: uses for screenshots
helper/ComputerUseNativeHelper.swift - Native Helper → Cursor Overlay: renders cursor
README.md - App Discovery → macOS Apps and APIs: enumerates apps
README.md - Accessibility State → macOS Apps and APIs: reads accessibility
README.md - UI Actions → macOS Apps and APIs: synthesizes input
README.md - Window Capture → macOS Apps and APIs: captures windows
README.md - Observed Output Parser → Tool Contracts: builds snapshots
src/observed-parser.ts