OllamaSharp icon indicating copy to clipboard operation
OllamaSharp copied to clipboard

Tools.GetFromMcpServers

Open changweihua opened this issue 7 months ago • 1 comments

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'.”

Image

Tks.

changweihua avatar May 20 '25 08:05 changweihua

Needs to update ModelContextProtocol ,https://github.com/modelcontextprotocol/csharp-sdk/pull/410

changweihua avatar May 20 '25 08:05 changweihua

remove the direct reference to ModelContextProtocol

NeverMorewd avatar Jun 03 '25 07:06 NeverMorewd