Add Description property to Implementation type per MCP spec (#966)

* Initial plan

* Add Description property to Implementation type

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>

* Add test to validate client Description from server perspective

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
Copilot 2025-11-17 10:42:40 -05:00 • committed by GitHub
commit 00bb5b2678
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,7 @@ public class McpClientTests : ClientServerTestBase
{
Name = "test-server",
Version = "1.0.0",
Description = "A test server for unit testing",
WebsiteUrl = "https://example.com",
Icons =
[
@ -52,6 +53,7 @@ public class McpClientTests : ClientServerTestBase
var serverInfo = client.ServerInfo;
Assert.Equal("test-server", serverInfo.Name);
Assert.Equal("1.0.0", serverInfo.Version);
Assert.Equal("A test server for unit testing", serverInfo.Description);
Assert.Equal("https://example.com", serverInfo.WebsiteUrl);
Assert.NotNull(serverInfo.Icons);
Assert.Equal(2, serverInfo.Icons.Count);
@ -69,6 +71,29 @@ public class McpClientTests : ClientServerTestBase
Assert.Equal("dark", icon1.Theme);
}
[Fact]
public async Task ServerCanReadClientInfo()
{
var clientOptions = new McpClientOptions
{
ClientInfo = new Implementation
{
Name = "test-client",
Version = "2.0.0",
Description = "A test client for validating client-server communication"
}
};
await using McpClient client = await CreateMcpClientForServer(clientOptions);
// Verify the server received the client info with description
var clientInfo = Server.ClientInfo;
Assert.NotNull(clientInfo);
Assert.Equal("test-client", clientInfo.Name);
Assert.Equal("2.0.0", clientInfo.Version);
Assert.Equal("A test client for validating client-server communication", clientInfo.Description);
}
[Theory]
[InlineData(null, 10)]
[InlineData(0.7f, 50)]