Skip to content

Sampling Example #224

Open
Open
@renaisser

Description

@renaisser

Describe the bug
It is not exactly a bug, but there is no available example in the documentation demonstrating how to implement both the client and server for the sampling endpoint using the rmcp crate. It is unclear how to properly structure the client-server communication to simulate or execute a sampling response (e.g., via sampling/createMessage).

To Reproduce

Expected behavior
A clear working example that demonstrates:

  • Server setup that listens for sampling/createMessage and returns a structured response.
  • Client setup that sends a sampling/createMessage request and properly handles the response. This would help clarify the transport mechanism (stdio, http, sse) and message structure needed.

Logs

Additional context
Use case involves simulating or chaining multi-step prompt execution using the sampling/createMessage logic as a base. A minimal working example in Rust for both client and server would be extremely helpful to bootstrap development.

Thank you so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions