Skip to content

Trust local clients by their app's code signature - #374

Closed
oliverames wants to merge 1 commit into
mattt:mainfrom
oliverames:pr/trust-by-signature
Closed

oliverames wants to merge 1 commit into
mattt:mainfrom
oliverames:pr/trust-by-signature

Conversation

@oliverames

@oliverames oliverames commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What it does and why

Trusting a client today means copying a credential into its MCP settings by hand. This PR replaces that with code-signature trust for signed apps and automatic CLI credentials for terminal clients.

What changed

  • For signed apps, iMCP finds the app responsible for the connecting imcp-server and checks its code signature. The approval dialog shows that app's name, icon, and developer. Choosing Always Allow trusts the app's designated requirement, so there is nothing to copy.
  • Terminals and unsigned or ad hoc runtimes are never trusted by signature, because that would trust everything running inside them. Instead, imcp-server persists a credential at ~/Library/Application Support/iMCP/client-credential when IMCP_CLIENT_CREDENTIAL is not set.
  • Every client gets a single-step Allow Once or Always Allow prompt on first connection, with no file panels or copy-paste modals.
  • Settings lists trusted apps and credentials with a Remove button.
  • The responsible-app lookup uses the private responsibility_get_pid_responsible_for_pid symbol. It is the only private API used, and the change has no dependency on other open PRs. If you would rather avoid that API, I am happy to discuss alternatives.

Testing

  • Debug build of the iMCP scheme on macOS succeeds.
  • imcp-serverTests: 189 tests, 1 skipped, 0 failures.
  • swift format lint --strict is clean.
  • CI: both builds (macOS 26 with Xcode 26.0, macOS 27 with Xcode 27.0) pass.

Not verified

  • The live approval dialog inside the sandbox.
  • Trust by signature against a real signed client app such as Claude Desktop.

Replaces #345.

Trusting a client used to mean copying a credential into its MCP settings.

iMCP now finds the app responsible for the connecting imcp-server, validates
its code signature, and shows that app's name, icon, and developer in the
approval window. Always Allow stores trust keyed to the app's designated
requirement, so there is nothing to copy.

Terminals and unsigned, ad hoc, or non-bundle clients are never trusted by
signature, since that would trust everything running inside them. For those,
imcp-server persists a credential at
~/Library/Application Support/iMCP/client-credential when
IMCP_CLIENT_CREDENTIAL is not set. Every client gets a single-step Allow Once
or Always Allow prompt on first connection. Settings lists trusted apps and
credentials with a Remove button.

The responsible-app lookup uses the private
responsibility_get_pid_responsible_for_pid symbol.
@mattt

mattt commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Following up from #364, the two things that stood out to me here: the responsible process isn't always the client that holds the server's stdio, and unconfigured clients end up sharing one credential.

@oliverames

Copy link
Copy Markdown
Contributor Author

Closing per #364. Thanks for the notes on the responsible process and shared credential. I will fix those on my fork.

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