Skip to content

feat(core): Capture initialize attributes on MCP servers #18532

Description

@github-actions

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 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions