Skip to content

Show a verified client's signing identifier during tool calls - #400

Merged
mattt merged 2 commits into
mainfrom
mattt/verified-client-name
Nov 29, 2026
Merged

mattt merged 2 commits into
mainfrom
mattt/verified-client-name

Conversation

@mattt

@mattt mattt commented Nov 29, 2026

Copy link
Copy Markdown
Owner

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 initialize request, 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.

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.
@mattt
mattt merged commit 08704de into main Nov 29, 2026
2 checks passed
@mattt
mattt deleted the mattt/verified-client-name branch November 29, 2026 14:56
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.

1 participant