CreateMessageRequest
A request from the server to sample an LLM via the client.
The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
Important: This is a request from server to client, not client to server. The server is asking the client to use its LLM to generate a completion.
Human-in-the-loop: Clients should:
Show the sampling request to the user before executing it
Allow the user to approve or reject the request
Show the generated response to the user before sending it back to the server
Properties
A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
The messages to use as context for sampling.
Metadata for this request. May include a progressToken for out-of-band progress notifications.
Metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
The server's preferences for which model to select.
The parameters for the sampling request, including messages and model preferences.
List of sequences that will stop generation if encountered.
An optional system prompt the server wants to use for sampling.
Temperature parameter for sampling (typically 0.0-2.0).