diff --git a/dotnet/samples/Demos/ModelContextProtocolPlugin/Program.cs b/dotnet/samples/Demos/ModelContextProtocolPlugin/Program.cs index c6c53704aa17..989df9856be6 100644 --- a/dotnet/samples/Demos/ModelContextProtocolPlugin/Program.cs +++ b/dotnet/samples/Demos/ModelContextProtocolPlugin/Program.cs @@ -5,7 +5,9 @@ using Microsoft.Extensions.Logging; using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Connectors.OpenAI; +using ModelContextProtocol; using ModelContextProtocol.Client; +using ModelContextProtocol.Protocol.Types; var config = new ConfigurationBuilder() .AddUserSecrets() @@ -20,7 +22,7 @@ // Create an MCPClient for the GitHub server await using var mcpClient = await McpClientFactory.CreateAsync( - new() + new McpServerConfig() { Id = "github", Name = "GitHub", @@ -31,7 +33,14 @@ ["arguments"] = "-y @modelcontextprotocol/server-github", } }, - new() { ClientInfo = new() { Name = "GitHub", Version = "1.0.0" } }).ConfigureAwait(false); + new McpClientOptions() + { + ClientInfo = new Implementation() + { + Name = "GitHub", + Version = "1.0.0" + } + }).ConfigureAwait(false); // Retrieve the list of tools available on the GitHub server var tools = await mcpClient.ListToolsAsync().ConfigureAwait(false); @@ -45,7 +54,6 @@ builder.Services .AddLogging(c => c.AddDebug().SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace)) .AddOpenAIChatCompletion( - serviceId: "openai", modelId: config["OpenAI:ChatModelId"] ?? "gpt-4o-mini", apiKey: apiKey); Kernel kernel = builder.Build();