Skip to content

Sampling service extension should include client identifier in method name #327

@elliette

Description

@elliette

With #325, the Dart MCP Server registers the DartMcpServer.samplingRequest service extension for the first MCP client connected to DTD that supports sampling.

This means that if there are multiple MCP clients on DTD with sampling support, the sampling requests will all be sent to the first one connected. If that first client then disconnects, there is no way for sampling requests to then be sent to any of the other MCP clients.

I propose suffixing the method name with the client name + UUID when registering the service extension, e.g.:

  • DartMcpServer.samplingRequest-gemini-cli-123
  • DartMcpServer.samplingRequest-gemini-cli-456
  • DartMcpServer.samplingRequest-github-copilot-789

That way the DTD client (e.g. DevTools) could expose the connected MCP clients (Gemini CLI instance 1, Gemini CLI instance 2, Github Copilot) to the user so that they can choose which one they would like to send the sampling request to.

cc @jakemac53 for thoughts here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions