Sampling implementation #2158
Replies: 3 comments 2 replies
-
|
Hi @IsraelShok, thanks for the question. Could you share what client/SDK path you are testing against and the exact sampling behavior you expect versus observed so I can align with the current protocol support and document any gaps. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @IsraelShok, to answer directly: Sampling is partially implemented. The framework is in place but the actual LLM invocation is stubbed out:
In practice, sampling (where an MCP server requests the client to generate an LLM completion) is a less commonly used MCP feature compared to tools and resources, and many MCP deployments don't require it. The gateway prioritizes the server->client elicitation flow which is the more common interaction pattern. If you have a specific use case for sampling, please share the client/SDK path and the expected behavior — that would help prioritize making the implementation fully functional. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @IsraelShok, apologies for the delay on this. Current state of sampling — confirmed by code review: The
Regarding your specific questions:
Alternative: If you need LLM completions as part of your MCP workflow, consider using a tool that calls an LLM API directly rather than relying on the sampling protocol. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, there is an implementation for sampling logic?
I can see code that related to elicitation, but cant see for sampling.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions