AgentFrameworkToolkit.Tools.ModelContextProtocol
1.0.0-preview.251222.1
This is a prerelease version of AgentFrameworkToolkit.Tools.ModelContextProtocol.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package AgentFrameworkToolkit.Tools.ModelContextProtocol --version 1.0.0-preview.251222.1
NuGet\Install-Package AgentFrameworkToolkit.Tools.ModelContextProtocol -Version 1.0.0-preview.251222.1
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="AgentFrameworkToolkit.Tools.ModelContextProtocol" Version="1.0.0-preview.251222.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AgentFrameworkToolkit.Tools.ModelContextProtocol" Version="1.0.0-preview.251222.1" />
<PackageReference Include="AgentFrameworkToolkit.Tools.ModelContextProtocol" />
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 AgentFrameworkToolkit.Tools.ModelContextProtocol --version 1.0.0-preview.251222.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AgentFrameworkToolkit.Tools.ModelContextProtocol, 1.0.0-preview.251222.1"
#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 AgentFrameworkToolkit.Tools.ModelContextProtocol@1.0.0-preview.251222.1
#: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=AgentFrameworkToolkit.Tools.ModelContextProtocol&version=1.0.0-preview.251222.1&prerelease
#tool nuget:?package=AgentFrameworkToolkit.Tools.ModelContextProtocol&version=1.0.0-preview.251222.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AgentFramework Toolkit
An opinionated C# Toolkit for Microsoft Agent Framework that makes life easier
NuGet
OpenAI | Azure OpenAI | Google (Gemini) | Anthropic (Claude) | XAI (Grok) | Mistral | OpenRouter | GitHub
Examples of use
All agents have AIAgent as base, fully work the rest of Microsoft Agent Framework)
OpenAI
OpenAIAgentFactory factory = new OpenAIAgentFactory(new OpenAIConnection
{
ApiKey = configuration.OpenAiApiKey,
NetworkTimeout = TimeSpan.FromMinutes(5)
});
OpenAIAgent agent = factory.CreateAgent(new AgentOptions
{
Model = "gpt-5",
ReasoningEffort = OpenAIReasoningEffort.High,
ReasoningSummaryVerbosity = OpenAIReasoningSummaryVerbosity.Concise,
});
GoogleAgentFactory factory = new(new GoogleConnection
{
ApiKey = configuration.GoogleGeminiApiKey
});
GoogleAgent agent = factory.CreateAgent(new GoogleAgentOptions
{
Model = GenerativeAI.GoogleAIModels.Gemini25Pro,
Tools = [AIFunctionFactory.Create(GetWeather)]
});
Anthropic
AnthropicAgentFactory factory = new AnthropicAgentFactory("<AnthropicApiKey">);
factory.CreateAgent(new AnthropicAgentOptions
{
Model = "claude-sonnet-4-5",
MaxOutputTokens = 10000, // <-- Force the MaxToken property I always forget
BudgetTokens = 5000
});
X AI
XAIAgentFactory factory = new(new XAIConnection
{
ApiKey = configuration.XAiGrokApiKey
});
XAIAgent agent = factory.CreateAgent(new AgentOptions
{
Model = "grok-4-fast-non-reasoning",
Tools = [AIFunctionFactory.Create(GetWeather)]
});
Mistral
MistralAgentFactory mistralAgentFactory = new MistralAgentFactory("<MistralApiKey>");
MistralAgent mistralAgent = mistralAgentFactory.CreateAgent(new MistralAgentOptions
{
Model = Mistral.SDK.ModelDefinitions.MistralSmall
});
Azure AI (with every optional setting added for demonstration)
AzureOpenAIAgent fullBlownAgent = azureOpenAIAgentFactory.CreateAgent(new AgentOptions
{
Id = "1234",
Name = "MyAgent",
Description = "The description of my agent",
Instructions = "Speak like a pirate",
Model = "gpt-5-mini",
ReasoningEffort = OpenAIReasoningEffort.High,
ReasoningSummaryVerbosity = OpenAIReasoningSummaryVerbosity.Concise,
Tools = [AIFunctionFactory.Create(GetWeather)],
RawToolCallDetails = details => { Console.WriteLine(details.ToString()); },
RawHttpCallDetails = details =>
{
Console.WriteLine($"URL: {details.RequestUrl}");
Console.WriteLine($"Request: {details.RequestJson}");
Console.WriteLine($"Response: {details.ResponseJson}");
}
});
Repository layout
- src/ – Core libraries and tests (packages live under src/*, tests in src/AgentFrameworkToolkit.Tests).
- examples/Samples – Console sample app with per-provider examples.
- tools/AppHost – Aspire host to orchestrate DevUI and service defaults in dev.
- tools/DevUI – Web UI to try all agents with your own keys.
- tools/ServiceDefaults – Shared dev infra (health checks, telemetry defaults).
Contributing: See CONTRIBUTING.md for build instructions and development guidelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- AgentFrameworkToolkit (>= 1.0.0-preview.251222.1)
- JetBrains.Annotations (>= 2025.2.4)
- Microsoft.Agents.AI (>= 1.0.0-preview.251219.1)
- ModelContextProtocol (>= 0.5.0-preview.1)
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-rc4 | 0 | 3/12/2026 |
| 1.0.0-rc3.1 | 40 | 3/8/2026 |
| 1.0.0-rc3 | 73 | 3/4/2026 |
| 1.0.0-rc2 | 99 | 2/26/2026 |
| 1.0.0-rc1 | 97 | 2/21/2026 |
| 1.0.0-preview.260216.1 | 76 | 2/16/2026 |
| 1.0.0-preview.260212.1 | 51 | 2/12/2026 |
| 1.0.0-preview.260209.1 | 85 | 2/10/2026 |
| 1.0.0-preview.260205.1 | 76 | 2/6/2026 |
| 1.0.0-preview.260203.1 | 49 | 2/4/2026 |
| 1.0.0-preview.260128.1 | 66 | 1/29/2026 |
| 1.0.0-preview.260127.1 | 84 | 1/27/2026 |
| 1.0.0-preview.260126.1 | 51 | 1/26/2026 |
| 1.0.0-preview.260121.1 | 84 | 1/21/2026 |
| 1.0.0-preview.260120.1 | 55 | 1/20/2026 |
| 1.0.0-preview.260115.1 | 347 | 1/15/2026 |
| 1.0.0-preview.260108.1 | 134 | 1/9/2026 |
| 1.0.0-preview.260104.1 | 143 | 1/4/2026 |
| 1.0.0-preview.251230.1 | 62 | 12/30/2025 |
| 1.0.0-preview.251222.1 | 641 | 12/22/2025 |
Loading failed