Skip to content

Sampling handler lacks information about which server made the request #702

@Dethon

Description

@Dethon

I'm implementing the sampling capability and it's quite hard to properly follow the IncludeContext parameter when you use more than one MCP server. Theres is no problem with None or AllServers, but handling ThisServer is a challenge because the handler doesn't know which server made the request.

Furthermore, since the handler is passed at client creation we don't have a list of tools that we can capture until the handler has been set and can no longer be changed.

I would like to have an McpClient parameter added to the SamplingHandler callback so we can easily know which server made the call

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions