Module handler

Module handler 

Source
Expand description

Client handler traits for server-initiated requests.

MCP servers can initiate certain requests to clients, such as:

  • Sampling: Request the client’s LLM to generate a response
  • Elicitation: Request user input through the client
  • Roots: Get file system roots that the client exposes

This module defines traits that clients can implement to handle these requests.

Structs§

NoOpHandler
A no-op handler that rejects all server requests.
Root
A root directory that the client exposes to servers.
SamplingHandler
A handler that supports sampling by delegating to a closure.

Traits§

ClientHandler
Handler trait for server-initiated requests.