-
Notifications
You must be signed in to change notification settings - Fork 51
Description
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-123DartMcpServer.samplingRequest-gemini-cli-456DartMcpServer.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