Skip to content

Make client information available in server handlers #552

@rnett

Description

@rnett

Is your feature request related to a problem? Please describe.

It is not possible for server handlers (e.g. tools) to react to information about the client that is connected. Information that is useful includes:

  • The client's name & version (aka Implementation) - useful for patching around specific client behaviors, if some are known to behave poorly or need special handling.
  • The client capabilities. This is required to know which messages can be sent without resulting in unexpected exceptions or erroneous handling. Graceful fallback is often required when certain capabilities are not supported by clients. It's not really possible to do this currently - calling non-supported methods results in non-specific IllegalStateExceptions, which could have come from anywhere.

While server capabilities could also be helpful, it's something that you control anyways, so it's much less impactful.

Describe the solution you'd like

Add clientImplementation and clientCapabilities to ClientConnection.

Describe alternatives you've considered

There's a workaround, which is to use the session ID to extract the full ServerSession object from the Server instance. But that's ugly and awkward.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions