Repository navigation
Show a verified client's signing identifier during tool calls - #400
Merged
Merged
Conversation
The approval dialog, the "Client Connected" notification, Settings, and the log name a client that iMCP verified by its code signature by its signing identifier. Tool calls still got the name from the client's initialize request, which any process can send, so the outbound confirmation window and the photo picker could name a different client than the one the person approved. The approval handler now returns a ClientAdmission instead of a Bool. iMCP decides it once, when it approves the connection: a trusted signature or the dialog for a verified client carries the signing identifier, and a credential or the dialog for an unverified client carries none. The connection keeps the resulting name for its tool calls, so ToolCallContext.clientName is the signing identifier for a verified client and the reported name otherwise.
A tool call got only the client's name, so a window couldn't tell a verified signing identifier from a name that the client chose, which can be the same text. ToolCallContext.clientNameIsVerified now says which it is. The approval returns a ToolCallClient, the name and the flag, and the server registers the handlers with it, so the handlers get the client from the approval itself rather than from state that the connection set before it. ToolCallContext.withCall binds the connection ID, the name, and the flag together. A test sends initialize and a tool call over an in-memory transport and checks the name and the flag that the registered handler gets for a verified and an unverified admission. The README says that a trusted credential shows the reported name, even for a signed client.
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.
This PR makes tool calls show a verified client's signing identifier, the name that the approval dialog, the "Client Connected" notification, and Settings already show.
Until now, a tool call used the name from the client's
initializerequest, which any process can choose, so the photo picker could name a different client than the one you approved. A connection now keeps the identity that admitted it: the signing identifier for a verified signature, or the reported name for a credential or an unverified client. A tool call also knows whether iMCP verified the name, so a window can tell the two apart.Follow-up to #399.