Add support for message-level filters to McpServer (#1207)
This commit is contained in:
parent
6224f30a33
commit
7d48d3922c
1 changed files with 1333 additions and 105 deletions
|
|
@ -41,9 +41,12 @@ internal sealed partial class StreamableHttpPostTransport(
|
|||
{
|
||||
Debug.Assert(_pendingRequest.Id is null);
|
||||
|
||||
message.Context ??= new JsonRpcMessageContext();
|
||||
|
||||
if (message is JsonRpcRequest request)
|
||||
{
|
||||
_pendingRequest = request.Id;
|
||||
message.Context.RelatedTransport = this;
|
||||
|
||||
// Invoke the initialize request handler if applicable.
|
||||
if (request.Method == RequestMethods.Initialize)
|
||||
|
|
@ -53,9 +56,6 @@ internal sealed partial class StreamableHttpPostTransport(
|
|||
}
|
||||
}
|
||||
|
||||
message.Context ??= new JsonRpcMessageContext();
|
||||
message.Context.RelatedTransport = this;
|
||||
|
||||
if (parentTransport.FlowExecutionContextFromRequests)
|
||||
{
|
||||
message.Context.ExecutionContext = ExecutionContext.Capture();
|
||||
|
|
|
|||
Loading…
Reference in a new issue