Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/mcp / / deriveServerIdentity
Function: deriveServerIdentity()
function deriveServerIdentity(transport, serverInfoName?): ServerIdentity;Defined in: packages/mcp/src/helpers/identity.ts:37
Compute the canonical ServerIdentity for the supplied transport. The id is suitable for use as a registry key and as the operator-facing label in audit rows + trace attributes.
W-016: the id derives ONLY from operator-controlled data (the transport config) plus the optional operator-supplied serverInfoName override. The name a server self-reports on initialize never participates: every security-relevant surface keys off this id (TOFU pins, mcp:<id>:<uri> handle scoping, taint labels, audit rows), and a server-controlled id let a rug-pull server mint a fresh TOFU record by renaming itself, or impersonate a trusted server's scope by claiming its name. HTTP-family ids include a non-default port, so localhost:3001 and localhost:3002 are distinct servers.
Parameters
| Parameter | Type |
|---|---|
transport | MCPTransportConfig |
serverInfoName? | string |