Tools.GetFromMcpServers
var ollamaTools = await Tools.GetFromMcpServers(new OllamaSharp.ModelContextProtocol.McpClientOptions { InitializationTimeout = TimeSpan.FromMinutes(10), }, new OllamaSharp.ModelContextProtocol.Server.McpServerConfiguration { Name = "MCP Server", Command = "http://localhost:5185/sse", TransportType = OllamaSharp.ModelContextProtocol.Server.McpServerTransportType.Sse, //Options });
Exception: System.TypeLoadException:“Could not load type 'ModelContextProtocol.Protocol.Transport.IClientTransport' from assembly 'ModelContextProtocol, Version=0.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.”
Tks.
Needs to update ModelContextProtocol ,https://github.com/modelcontextprotocol/csharp-sdk/pull/410
remove the direct reference to ModelContextProtocol