Skip to content

Let developers build and install iMCP Helper for Home - #275

Merged
mattt merged 13 commits into
mainfrom
mattt/helper-self-build
Oct 13, 2026
Merged

mattt merged 13 commits into
mainfrom
mattt/helper-self-build

Conversation

@mattt

@mattt mattt commented Oct 13, 2026

Copy link
Copy Markdown
Owner

This PR takes the Home helper out of release builds and adds a script that builds and installs it with your own Apple Developer team.

Apple only makes HomeKit available to Mac Catalyst apps, and it doesn't allow the HomeKit entitlement in Developer ID provisioning profiles, so a notarized iMCP can't ship the helper from #215. The release dry run failed for that reason. HomeKit works with development signing, though, so developers can build the helper for their own Macs:

  • Scripts/install-helper.sh builds iMCP Helper for Mac Catalyst with your team and a bundle ID of your own, checks that it carries the HomeKit entitlement, and installs it in /Applications. On the first build for a new bundle ID, it builds once for iOS to register the HomeKit capability, then retries.
  • iMCP finds the helper in /Applications, or asks you to choose it when you turn on Home. Settings > Services > Home shows the helper and lets you change it. An app counts as the helper only if its Info.plist sets iMCPHelper.
  • Release builds set EMBED_HOME_HELPER = NO and leave the helper out. Debug builds still embed it.
  • The helper's bundle ID comes from HELPER_BUNDLE_IDENTIFIER.

The README explains the setup.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Helper selection can be ignored or displayed without switching the active Home connection.

3 open findings
What changed in this PR

Enables developers to build, sign, install, and select their own HomeKit helper while excluding it from release builds.

Changes:

  • Adds helper installation and signing workflow.
  • Adds helper discovery, selection, and activation prompts.
  • Updates build settings, tests, and documentation.
File Description
Scripts/​install-helper.sh Builds, verifies, and installs the helper.
Scripts/​build-helper.sh Skips helper embedding when configured.
README.md Documents developer installation.
iMCP.xcodeproj/​project.pbxproj Configures helper identity and release exclusion.
Helper/​Info.plist Adds the helper marker.
CLITests/​HomeProxyTests.swift Tests helper discovery and matching.
App/​Views/​ServiceToggleView.swift Prompts for a missing helper.
App/​Views/​ServicesSettingsView.swift Adds helper selection UI.
App/​Services/​HomeHelperLocator.swift Resolves and validates helpers.
App/​Services/​Home.swift Stores selections and launches helpers.
App/​Controllers/​ServerController.swift Gates Home activation on helper availability.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread App/Services/Home.swift
Comment on lines +279 to +283
&& HomeHelperLocator.isRunningHelper(
bundleURL: application.bundleURL,
localizedName: application.localizedName,
helper: url,
isHelper: HomeHelperLocator.isHelper(at:)
Comment thread App/Views/ServicesSettingsView.swift Resolved
Comment thread Scripts/install-helper.sh Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Helper switching has a termination race, and the recovery test can terminate the wrong helper.

2 open findings
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Terminate only the helper launched from the expected path

CLITests/​HomeProxyTests.swift:26

This can terminate any running app carrying the helper marker, not necessarily the helper launched from IMCP_HELPER_PATH. With multiple self-built helpers, the test may kill an unrelated process while the backend helper remains alive, making the recovery assertion pass without testing recovery. Match the running app's standardized bundle path to path instead.

🧠 Review effort: Balanced

Comment thread App/Services/Home.swift Resolved
The live test now quits only the helper it launched.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Bonjour fallback can connect to a different running helper than the one selected by the user.

2 open findings
1 resolved since last review

🧠 Review effort: Balanced

Comment thread App/Services/Home.swift
isHelper: HomeHelperLocator.isHelper(at:)
)
}) {
return previous?.pid == running.processIdentifier ? previous : nil
@mattt
mattt merged commit 25f24e6 into main Oct 13, 2026
3 checks passed
@mattt
mattt deleted the mattt/helper-self-build branch October 13, 2026 21:33
mattt added a commit that referenced this pull request Oct 13, 2026
Release checks read the first MARKETING_VERSION in the project file, and the bump read the first CURRENT_PROJECT_VERSION. Since #275 the helper's 1.0 and 1 come first, so a 1.7.0 bump would set build 2. The helper now carries the app's version, and the bump uses the highest build number.
mattt added a commit that referenced this pull request Oct 14, 2026
Since #275, the first line containing PRODUCT_BUNDLE_IDENTIFIER is the helper's DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO, so the export mapped the WeatherKit profile to "NO" and failed. Match the key exactly and skip build-setting references.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants