Skip to content

Request for friendly support to integrate Microsoft MCP Servers #343

@linchuanhai

Description

@linchuanhai

When using OllamaSharp's OllamaApiClient.ChatAsyncto wrap the public Ollama WebAPI, unlike the advanced Chat class which automatically handles ToolCalls internally, I need to manually determine if the AI requires a ToolCall when the large language model returns a response, and then manually invoke the tool functions in the following way:

var toolInvoker = new DefaultToolInvoker();
foreach (var toolCall in toolCalls)
{
var toolResult = await toolInvoker.InvokeAsync(toolCall, Common.OllamaTools, cancellationToken).ConfigureAwait(false);
var result = RenderToolSignature(toolResult);
sb.Append(result);
}

With business growth, there will likely be a need to deploy server-side tools via Microsoft MCP Servers on a separate server, and then integrate these MCP Servers into this Ollama Web API project. However, I've found that the OllamaSharp SDK makes this integration quite difficult or offers no support for it.

Feature Request:

  1. Would it be possible to add friendly support for Microsoft MCP Servers?

  2. Are there any existing solutions? Could you provide a clear Demo example?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions