Content-Length: 264586 | pFad | http://github.com/modelcontextprotocol/rust-sdk/issues/224

2E Sampling Example · Issue #224 · modelcontextprotocol/rust-sdk · GitHub
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

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









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: http://github.com/modelcontextprotocol/rust-sdk/issues/224

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy