With this PR we get this attributes from the initialization request and response into the initialize span:
mcp.client.name, mcp.client.version, mcp.client.title (from request)
mcp.server.name, mcp.server.version, mcp.server.title (from response)
mcp.protocol.version (from both request and response)
Changes:
- Extract client info and protocol version from the
initialize request and set them on the span after creation in transport.ts
- Extract server info and protocol version from the
initialize response in completeSpanWithResults and add them to the span
- Add two new helper functions
buildClientAttributesFromInfo and buildServerAttributesFromInfo to build attributes directly from PartyInfo objects
Note
The pull request "feat(core): Capture initialize attributes on MCP servers" was created by @betegon but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
With this PR we get this attributes from the initialization request and response into the
initializespan:mcp.client.name,mcp.client.version,mcp.client.title(from request)mcp.server.name,mcp.server.version,mcp.server.title(from response)mcp.protocol.version(from both request and response)Changes:
initializerequest and set them on the span after creation intransport.tsinitializeresponse incompleteSpanWithResultsand add them to the spanbuildClientAttributesFromInfoandbuildServerAttributesFromInfoto build attributes directly fromPartyInfoobjects