Skip to content

Commit 4b68270

Browse files
committed
Update RequestContext.JsonRpcRequest to be backed by JsonRpcMessage
1 parent 2a54e66 commit 4b68270

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ModelContextProtocol.Core/Server/RequestContext.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public sealed class RequestContext<TParams> : MessageContext
2222
public RequestContext(McpServer server, JsonRpcRequest jsonRpcRequest)
2323
: base(server, jsonRpcRequest)
2424
{
25-
JsonRpcRequest = jsonRpcRequest;
2625
}
2726

2827
/// <summary>Gets or sets the parameters associated with this request.</summary>
@@ -40,7 +39,11 @@ public RequestContext(McpServer server, JsonRpcRequest jsonRpcRequest)
4039
/// This property provides access to the complete JSON-RPC request that initiated this handler invocation,
4140
/// including the method name, parameters, request ID, and associated transport and user information.
4241
/// </remarks>
43-
public JsonRpcRequest JsonRpcRequest { get; }
42+
public JsonRpcRequest JsonRpcRequest
43+
{
44+
get => (JsonRpcRequest)JsonRpcMessage;
45+
set => JsonRpcMessage = value;
46+
}
4447

4548
/// <summary>
4649
/// Ends the current response and enables polling for updates from the server.

0 commit comments

Comments
 (0)