deps: bump swift-sdk 0.12.0 -> 0.12.1#2
Merged
Conversation
Three tools were silently broken in v0.2.0 because their underlying APIs (NSMetadataQuery, UNUserNotificationCenter, NSAlert.runModal) require an active CFRunLoop, which never spins in this binary — `@main async` enters Swift Concurrency directly without calling NSApplicationMain(). Fixes: - spotlight_search: NSMetadataQuery → /usr/bin/mdfind (with 5s timeout) - notify: UNUserNotificationCenter → osascript 'display notification' - prompt_user: NSAlert.runModal → osascript 'display dialog' All three now use external processes that bring their own runloops. Functionally verified spotlight_search returns 5 paths in ~50ms post-fix.
Applies to manifest.json, .claude-plugin/marketplace.json, Info.plist (CFBundleDisplayName), README title. Internal name 'mac-mcp' unchanged since it's the manifest id consumers key off.
…1, patch) Only outdated direct dependency. Patch bump of modelcontextprotocol/swift-sdk. swift build + swift test (8 tests) green on Swift 6.3.2. No majors available. Transitive pins (swift-nio/log/collections/atomics/system/eventsource) already latest.
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s dependency on modelcontextprotocol/swift-sdk and bumps the project version to 0.2.2, while also changing several macOS tool implementations (notably moving from in-process APIs to osascript / mdfind) and updating branding strings.
Changes:
- Bump
modelcontextprotocol/swift-sdkrequirement tofrom: 0.12.1and bump project version strings to0.2.2. - Rework
notify/prompt_userto shell out toosascriptinstead of usingUNUserNotificationCenter/NSAlert. - Rework
spotlight_searchto usemdfindinstead ofNSMetadataQuery.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/MacMCPCore/MacMCPCore.swift | Bumps core library version metadata to 0.2.2. |
| Sources/MacMCP/Tools/SystemTools.swift | Switches notifications and prompting to osascript-backed implementations. |
| Sources/MacMCP/Tools/FinderTools.swift | Switches Spotlight search implementation to mdfind with an async timeout loop. |
| Sources/MacMCP/Server.swift | Bumps server version to 0.2.2. |
| Resources/Info.plist | Updates bundle display name and version/build numbers. |
| README.md | Updates the project header/branding string. |
| Package.swift | Updates swift-sdk dependency requirement to from: 0.12.1. |
| manifest.json | Updates display name + version in the extension manifest. |
| .claude-plugin/marketplace.json | Updates marketplace metadata/plugin versions to 0.2.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+143
to
+149
| let script = """ | ||
| display dialog "\(esc(message))" \ | ||
| with title "\(esc(title))" \ | ||
| default answer "\(esc(defaultValue))" \ | ||
| buttons {"\(esc(cancelLabel))", "\(esc(okLabel))"} \ | ||
| default button "\(esc(okLabel))" | ||
| """ |
Comment on lines
+165
to
169
| if task.terminationStatus != 0 { | ||
| return jsonResult(.object([ | ||
| "confirmed": .bool(confirmed), | ||
| "value": .string(confirmed ? field.stringValue : "") | ||
| "confirmed": .bool(false), | ||
| "value": .string("") | ||
| ])) |
Comment on lines
+133
to
+137
| var argv: [String] = [] | ||
| if let scope, !scope.isEmpty { | ||
| argv += ["-onlyin", scope] | ||
| } | ||
| mq.start() | ||
| } | ||
| mq.disableUpdates() | ||
| if mq.isStarted { mq.stop() } | ||
| argv.append(q) |
Comment on lines
+146
to
+150
| // Cap at 5 s so a slow Spotlight can't hang the MCP loop. | ||
| let deadline = Date().addingTimeInterval(5) | ||
| while task.isRunning && Date() < deadline { | ||
| try await Task.sleep(nanoseconds: 25_000_000) | ||
| } |
Comment on lines
13
to
15
| dependencies: [ | ||
| .package(url: "https://github.com/modelcontextprotocol/swift-sdk.git", from: "0.11.0") | ||
| .package(url: "https://github.com/modelcontextprotocol/swift-sdk.git", from: "0.12.1") | ||
| ], |
| "version": "0.2.0", | ||
| "display_name": "MacOS-MCP", | ||
| "version": "0.2.2", | ||
| "description": "Native macOS control via Swift + Cocoa: windows, Finder, clipboard, screenshots, notifications, and typed app automation. Code-signed for stable TCC grants. No raw shell or AppleScript exec.", |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patch bump of the only direct dep (modelcontextprotocol/swift-sdk, auth + misc fixes).
swift buildgreen. No majors available.🤖 Generated with Claude Code