Skip to content
Discussion options

You must be logged in to vote

You can use OllamaSharp.ModelContextProtocol, which contains the MCP support functions. From there, if you already have the McpClientTool list from the ModelContextProtocol nuget package which OllamaSharp.ModelContextProtocol is built on, you can use something similar to the code here in Tools.cs, around line 85, to convert them into OllamaSharp's version of the McpClientTool object. From there you can pass the list of tools directly into a chat.SendAsync(string prompt, IEnumberable<object>? tools) call as you would any other prompt.

If you don't already have them, you can use Tools.GetFromMcpServers(McpServerConfiguration[] mcpServers) to get a list you can directly pass into the tools p…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@vrenken
Comment options

@vrenken
Comment options

Answer selected by awaescher
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@awaescher
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants