File tree Expand file tree Collapse file tree
src/ModelContextProtocol.Core/Client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -569,8 +569,8 @@ public async Task ConnectAsync(CancellationToken cancellationToken = default)
569569
570570 // Validate protocol version
571571 bool isResponseProtocolValid =
572- _options . ProtocolVersion is { } optionsProtocol ? optionsProtocol == initializeResponse . ProtocolVersion :
573- McpSessionHandler . SupportedProtocolVersions . Contains ( initializeResponse . ProtocolVersion ) ;
572+ McpSessionHandler . SupportedProtocolVersions . Contains ( initializeResponse . ProtocolVersion ) ||
573+ ( _options . ProtocolVersion is { } optionsProtocol && optionsProtocol == initializeResponse . ProtocolVersion ) ;
574574 if ( ! isResponseProtocolValid )
575575 {
576576 LogServerProtocolVersionMismatch ( _endpointName , requestProtocol , initializeResponse . ProtocolVersion ) ;
You can’t perform that action at this time.
0 commit comments