From afe81fdcc9b86ea59b1217f0105ed02f1c8ccc8d Mon Sep 17 00:00:00 2001 From: guglielmoc Date: Wed, 10 Jun 2026 07:19:53 +0000 Subject: [PATCH] refactor: remove redundant comment regarding protocol version validation exemption --- mcp/server.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mcp/server.go b/mcp/server.go index adcf698f..912dea98 100644 --- a/mcp/server.go +++ b/mcp/server.go @@ -1558,11 +1558,7 @@ func (ss *ServerSession) handle(ctx context.Context, req *jsonrpc.Request) (any, if perRequestErr != nil { return nil, perRequestErr } - // server/discover is exempt from the version-validation gate so that a - // client probing with a version the server doesn't implement can still - // learn the server's supported versions from the response (whether the - // handler returns a DiscoverResult or an UnsupportedProtocolVersionError - // with a Data.Supported payload). + if validatedMeta.usesNewProtocol && !slices.Contains(supportedProtocolVersions, validatedMeta.initializeParams.ProtocolVersion) { data, _ := json.Marshal(UnsupportedProtocolVersionData{