Class RequestContext<TParams>
- Namespace
- ModelContextProtocol.Server
- Assembly
- ModelContextProtocol.dll
Provides a context container that provides access to both the server instance and the client request parameters.
public record RequestContext<TParams> : IEquatable<RequestContext<TParams>>
Type Parameters
TParams
Type of the request parameters specific to each MCP operation.
- Inheritance
-
RequestContext<TParams>
- Implements
-
IEquatable<RequestContext<TParams>>
- Inherited Members
Remarks
The RequestContext<TParams> encapsulates all contextual information for handling an MCP request. This type is typically received as a parameter in handler delegates registered with IMcpServerBuilder, and may be injected as parameters into McpServerTools.
Constructors
RequestContext(IMcpServer, TParams?)
Provides a context container that provides access to both the server instance and the client request parameters.
public RequestContext(IMcpServer Server, TParams? Params)
Parameters
Server
IMcpServerParams
TParams
Remarks
The RequestContext<TParams> encapsulates all contextual information for handling an MCP request. This type is typically received as a parameter in handler delegates registered with IMcpServerBuilder, and may be injected as parameters into McpServerTools.
Properties
Params
public TParams? Params { get; init; }
Property Value
- TParams
Server
public IMcpServer Server { get; init; }