Andes.Extensions.AI.Mcp 0.4.0

dotnet add package Andes.Extensions.AI.Mcp --version 0.4.0
                    
NuGet\Install-Package Andes.Extensions.AI.Mcp -Version 0.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Andes.Extensions.AI.Mcp" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Andes.Extensions.AI.Mcp" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Andes.Extensions.AI.Mcp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Andes.Extensions.AI.Mcp --version 0.4.0
                    
#r "nuget: Andes.Extensions.AI.Mcp, 0.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Andes.Extensions.AI.Mcp@0.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Andes.Extensions.AI.Mcp&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Andes.Extensions.AI.Mcp&version=0.4.0
                    
Install as a Cake Tool

Andes.Extensions.AI.Mcp

Model Context Protocol (MCP) support for Andes.Extensions.AI tool tracking. Adds two things on top of the core middleware:

  • ClassificationMcpClientTool instances are recognized as ToolKind.McpTool and render with the "Calling {Server} MCP" header in progress updates and usage reports.
  • Progress bridging — MCP notifications/progress sent by the server while a tool runs become ChatProgressKind.ToolProgress updates, with the server's message (or a synthesized "{progress}/{total}") and numeric Progress/ProgressTotal values.

Install

dotnet add package Andes.Extensions.AI.Mcp

Quickstart

using Andes.Extensions.AI;
using Microsoft.Extensions.AI;
using ModelContextProtocol.Client;

McpClient mcpClient = await McpClient.CreateAsync(transport);
IList<McpClientTool> mcpTools = await mcpClient.ListToolsAsync();

IChatClient client = innerClient
    .AsBuilder()
    .UseToolTracking(options => options.UseMcpToolClassification())
    .UseFunctionInvocation() // tracking must be registered before function invocation
    .Build();

var chatOptions = new ChatOptions
{
    Tools = mcpTools.WithTracking(mcpClient),
};

await foreach (ChatResponseUpdate update in client.GetStreamingResponseAsync("prompt", chatOptions))
{
    foreach (ChatProgressContent progress in update.Contents.OfType<ChatProgressContent>())
    {
        // e.g. "Calling GitHub MCP" (header), then "step 2 of 5" with Progress=2, ProgressTotal=5
        Console.WriteLine($"{progress.Progress.Message} ({progress.Progress.Progress}/{progress.Progress.ProgressTotal})");
    }
}

WithTracking carries the server display name (ServerInfo.Title ?? ServerInfo.Name, or an explicit string) and enables the progress bridge; pass enableProgress: false to keep the header but skip bridging. Raw McpClientTools that skip WithTracking are still classified as MCP (falling back to UseMcpToolClassification's default server name) but receive no progress bridge — the same applies to MCP tools hidden inside your own DelegatingAIFunction wrappers, which this package never unwraps or bypasses.

Nested calls render as their own activity: when a WithTracking-wrapped tool runs inside an agent, or is invoked directly inside another tool's body, the wrapper opens a child tracking scope — the call streams as a child activity under the enclosing tool, appears as a child ToolCallUsage in the ChatUsageReport, and bridged progress notifications bind to that child scope. A tool the tracking middleware wrapped itself still opens exactly one scope, and report totals are unchanged either way.

Notes

  • MCP servers report progress as single-precision floats; fractional values may show float→double widening artifacts (33.3f33.29999923706055). Integer step counts are unaffected.
  • Progress notifications arrive on the MCP client's receive loop and are delivered best-effort: a notification racing the end of the request may be dropped.
  • Privacy posture matches the core package: progress events never carry prompt content, tool arguments, or tool results.

Full documentation lives in the repository docs.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 27 7/31/2026
0.3.1 38 7/29/2026
0.3.0 35 7/29/2026
0.2.0 78 7/25/2026