Skip to content

Commit c39b1ef

Browse files
Copilotstephentoub
andcommitted
Change SupportedProtocolVersions from ICollection<string> to IReadOnlyList<string>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent bf473f4 commit c39b1ef

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/ModelContextProtocol.Core/Server/DestinationBoundMcpServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal sealed class DestinationBoundMcpServer(McpServerImpl server, ITransport
1212
public override McpServerOptions ServerOptions => server.ServerOptions;
1313
public override IServiceProvider? Services => server.Services;
1414
public override LoggingLevel? LoggingLevel => server.LoggingLevel;
15-
public override ICollection<string> SupportedProtocolVersions => server.SupportedProtocolVersions;
15+
public override IReadOnlyList<string> SupportedProtocolVersions => server.SupportedProtocolVersions;
1616

1717
public override ValueTask DisposeAsync() => server.DisposeAsync();
1818

src/ModelContextProtocol.Core/Server/McpServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public abstract partial class McpServer : McpSession
5858
/// <summary>
5959
/// Gets the protocol versions supported by this server implementation.
6060
/// </summary>
61-
public abstract ICollection<string> SupportedProtocolVersions { get; }
61+
public abstract IReadOnlyList<string> SupportedProtocolVersions { get; }
6262

6363
/// <summary>
6464
/// Runs the server, listening for and handling client requests.

src/ModelContextProtocol.Core/Server/McpServerImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void Register<TPrimitive>(McpServerPrimitiveCollection<TPrimitive>? collection,
156156
public override LoggingLevel? LoggingLevel => _loggingLevel?.Value;
157157

158158
/// <inheritdoc />
159-
public override ICollection<string> SupportedProtocolVersions => McpSessionHandler.SupportedProtocolVersions;
159+
public override IReadOnlyList<string> SupportedProtocolVersions => McpSessionHandler.SupportedProtocolVersions;
160160

161161
/// <inheritdoc />
162162
public override async Task RunAsync(CancellationToken cancellationToken = default)

tests/ModelContextProtocol.Tests/Server/McpServerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ public override Task<JsonRpcResponse> SendRequestAsync(JsonRpcRequest request, C
938938
public override Implementation? ClientInfo => throw new NotImplementedException();
939939
public override IServiceProvider? Services => throw new NotImplementedException();
940940
public override LoggingLevel? LoggingLevel => throw new NotImplementedException();
941-
public override ICollection<string> SupportedProtocolVersions => throw new NotImplementedException();
941+
public override IReadOnlyList<string> SupportedProtocolVersions => throw new NotImplementedException();
942942
public override Task SendMessageAsync(JsonRpcMessage message, CancellationToken cancellationToken = default) =>
943943
throw new NotImplementedException();
944944
public override Task RunAsync(CancellationToken cancellationToken = default) =>

0 commit comments

Comments
 (0)