Skip to content

v0.3.7

Choose a tag to compare

@Jeomon Jeomon released this 01 Jun 00:49

Bug Fixes

Fix SyntaxError on import — _SCRAPE_MAX_CHARS misplaced above decorator (#8)

macos-mcp 0.3.6 was completely broken on import due to _SCRAPE_MAX_CHARS = 20_000 being placed between the @mcp.tool(...) decorator and def scrape_tool(...). Python raised a SyntaxError before serving a single tool call. The constant has been moved above the decorator.

Fix AXObserver memory leak in EventObserver (~10–17 MB/min) (#7)

Two cooperating bugs caused steady linear physical footprint growth during long-running sessions, eventually triggering OOM on extended use:

  • AppObserver.start() leaked partial CF state on failure — early-exit paths after AXObserverCreate succeeded left AXObserver and run loop source references alive and never released by the AX framework.
  • _update_observers retried unobservable PIDs every 0.1 s — failed PIDs were never marked as seen, so system/permission-denied apps triggered a new AXObserverCreate call (and leak) on every event loop tick (~10 objects/second).

Both sites are now fixed: start() cleans up partial state at each failure path, and _update_observers unconditionally marks PIDs as seen regardless of success or failure.