Tighten draft protocol negotiation boundaries (#1692)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
a8d374b280
commit
fd38f51e27
1 changed files with 1755 additions and 589 deletions
|
|
@ -483,7 +483,7 @@ public class McpClientTests : ClientServerTestBase
|
|||
[Fact]
|
||||
public async Task AsClientLoggerProvider_MessagesSentToClient()
|
||||
{
|
||||
await using McpClient client = await CreateMcpClientForServer();
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions { ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion });
|
||||
|
||||
ILoggerProvider loggerProvider = Server.AsClientLoggerProvider();
|
||||
Assert.Throws<ArgumentNullException>("categoryName", () => loggerProvider.CreateLogger(null!));
|
||||
|
|
@ -765,7 +765,7 @@ public class McpClientTests : ClientServerTestBase
|
|||
[Fact]
|
||||
public async Task SetLoggingLevelAsync_WithRequestParams_SetsLevel()
|
||||
{
|
||||
await using McpClient client = await CreateMcpClientForServer();
|
||||
await using McpClient client = await CreateMcpClientForServer(new McpClientOptions { ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion });
|
||||
|
||||
// Should not throw
|
||||
await client.SetLoggingLevelAsync(
|
||||
|
|
@ -795,9 +795,9 @@ public class McpClientTests : ClientServerTestBase
|
|||
[Fact]
|
||||
public async Task ServerCanPingClient()
|
||||
{
|
||||
// ping is a legacy-only RPC (removed in the 2026-07-28 protocol per SEP-2575), so pin the client
|
||||
// to a legacy protocol version to exercise the server-initiated ping round-trip.
|
||||
await using McpClient client = await CreateMcpClientForServer(new() { ProtocolVersion = "2025-11-25" });
|
||||
// ping is available only on initialize-handshake revisions (removed in the 2026-07-28 protocol
|
||||
// per SEP-2575), so pin the client to exercise the server-initiated ping round-trip.
|
||||
await using McpClient client = await CreateMcpClientForServer(new() { ProtocolVersion = McpProtocolVersions.November2025ProtocolVersion });
|
||||
|
||||
var pingRequest = new JsonRpcRequest { Method = RequestMethods.Ping };
|
||||
var response = await Server.SendRequestAsync(pingRequest, TestContext.Current.CancellationToken);
|
||||
|
|
|
|||
Loading…
Reference in a new issue