Table of Contents

Event SamplingRequested

Namespace
LMKit.Mcp.Client
Assembly
LM-Kit.NET.dll

Occurs when the server requests LLM sampling from the client. This event implements the MCP sampling capability, allowing servers to request AI completions while the client maintains control over model access.

public event EventHandler<McpSamplingRequestEventArgs> SamplingRequested

Returns

EventHandler<McpSamplingRequestEventArgs>
Occurs when the server requests LLM sampling from the client. This event implements the MCP sampling capability, allowing servers to request AI completions while the client maintains control over model access.

Remarks

Sampling is a powerful feature that enables agentic behaviors in MCP servers. It allows servers to request LLM completions from the client rather than having servers run their own models.

Human-in-the-loop flow: The client SHOULD present both the request and response to the user for review before returning the response to the server.