Intellectus.AIAgent.MCPServer.Client 1.0.0

dotnet add package Intellectus.AIAgent.MCPServer.Client --version 1.0.0
                    
NuGet\Install-Package Intellectus.AIAgent.MCPServer.Client -Version 1.0.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="Intellectus.AIAgent.MCPServer.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Intellectus.AIAgent.MCPServer.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Intellectus.AIAgent.MCPServer.Client" />
                    
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 Intellectus.AIAgent.MCPServer.Client --version 1.0.0
                    
#r "nuget: Intellectus.AIAgent.MCPServer.Client, 1.0.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 Intellectus.AIAgent.MCPServer.Client@1.0.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=Intellectus.AIAgent.MCPServer.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Intellectus.AIAgent.MCPServer.Client&version=1.0.0
                    
Install as a Cake Tool

.NET Client for Intellectus AI Agent MCP Server

Packages Version Downloads
Intellectus.AIAgent.Framework Nuget Version Downloads count
Intellectus.AIAgent.MCPServer Nuget Version Downloads count
Intellectus.AIAgent.MCPServer.Client Nuget Version Downloads count
ts-intellectus-aiagent-mcpserver-client NPM Version Downloads count

The client library provides a simple way to communicate with an MCP Server using HTTP.

It abstracts the complexities of making requests and handling responses, allowing developers to focus on building their applications.

Hook up your client in Program.cs as shown below:

builder.Services.AddIntellectusMCPClient(settings =>
{
    settings.ServerBaseUrl = "http://localhost:5000";
});

Below Unit Test demonstrates a sample request to the MCP Server using the client library.

[Fact]
public async Task MCPClient_SalesByYear()
{
    // Arrange
    var id = 1;
    var userInput = "What is the sales in 2026 of xyz?";
    
    var toolName = "SalesTool"; // expected tool name        
    var productName = "xyz"; // expected product name
    var totalSales = 500.50m; // expected total sales
    var unitsSold = 50; // expected units sold
    var year = 2026; // expected year

    var client = _serviceProvider.GetRequiredService<IMCPClient>();

    // Act
    var response = await client.PostAsync(id, userInput);

    // Assert
    Assert.NotNull(response);
    Assert.NotNull(response.AgentResponse);
    Assert.False(string.IsNullOrWhiteSpace(response.AgentResponse.Response), "Agent response should not be empty.");
    Assert.NotNull(response.AgentResponse.ToolOutput);
    Assert.False(string.IsNullOrWhiteSpace(response.AgentResponse.ReasoningResult), "Reasoning result should not be empty.");
    Assert.Equal(toolName, response.AgentResponse.ToolName);
    Assert.NotNull(response.AgentResponse.ToolOutput);
    var toolOutputObj = response.AgentResponse.ToolOutput;
    var toolOutput = DeserializeToolOutput<SalesData>(toolOutputObj);
    Assert.Equal(productName, toolOutput.ProductName);
    Assert.Equal(totalSales, toolOutput.TotalSales);
    Assert.Equal(unitsSold, toolOutput.UnitsSold);
    Assert.Equal(year, toolOutput.Year);
}

private T DeserializeToolOutput<T>(object toolOutputObj)
{
    return toolOutputObj switch
    {
        JsonElement je => je.Deserialize<T>(new JsonSerializerOptions { PropertyNameCaseInsensitive = true })!,
        T sd => sd,
        _ => throw new InvalidCastException($"Unexpected ToolOutput type: {toolOutputObj?.GetType().FullName}")
    };
}

Sample MCP Server

Client Tests

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.0.0 90 8/3/2026

Initial release.