Fix Extensions not being copied to ServerCapabilities during initialization (#1399)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-27 19:36:15 -05:00 • committed by GitHub
commit 94aa6952eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,7 +90,7 @@ internal sealed partial class McpServerImpl : McpServer
ConfigureTasks(options);
ConfigureLogging(options);
ConfigureCompletion(options);
ConfigureExperimental(options);
ConfigureExperimentalAndExtensions(options);
// Register any notification handlers that were provided.
if (options.Handlers.NotificationHandlers is { } notificationHandlers)
@ -138,7 +138,7 @@ internal sealed partial class McpServerImpl : McpServer
public override string? NegotiatedProtocolVersion => _negotiatedProtocolVersion;
/// <inheritdoc/>
public ServerCapabilities ServerCapabilities { get; } = new();
public ServerCapabilities ServerCapabilities { get; }
/// <inheritdoc />
public override ClientCapabilities? ClientCapabilities => _clientCapabilities;
@ -262,9 +262,10 @@ internal sealed partial class McpServerImpl : McpServer
McpJsonUtilities.JsonContext.Default.CompleteResult);
}
private void ConfigureExperimental(McpServerOptions options)
private void ConfigureExperimentalAndExtensions(McpServerOptions options)
{
ServerCapabilities.Experimental = options.Capabilities?.Experimental;
ServerCapabilities.Extensions = options.Capabilities?.Extensions;
}
private void ConfigureResources(McpServerOptions options)