Class McpRequestContext
Per-call state handed to a tool: the session it belongs to, the caller identity resolved by the host, and the channel used to report progress on long operations.
[Obfuscation(Exclude = true)]
public sealed class McpRequestContext
- Inheritance
-
McpRequestContext
- Inherited Members
Properties
- Principal
Gets or sets the caller identity resolved by the host, for example an API key principal. Tools use it to scope what the session is allowed to see.
- ProgressSink
Gets or sets the callback used to deliver progress notifications. Set by the host transport. Arguments are the progress token, the current value, the total when known, and a message.
- ProgressToken
Gets or sets the progress token identifying this call's progress stream: supplied by the caller on the MCP transport, or set by any other host (with its own ProgressSink) that wants a tool's progress.
nullwhen nobody asked. Tools should still call ReportProgressAsync(double, double?, string, CancellationToken) unconditionally; it is a no-op when no token is present.
- ProtocolVersion
Gets or sets the protocol version negotiated for this session.
- SessionId
Gets or sets the identifier of the session this call belongs to.
Methods
- ReportProgressAsync(double, double?, string, CancellationToken)
Reports progress for the current call. Does nothing when the caller did not supply a progress token or the host did not install a sink.