Microsoft.Agents.A365.Tooling.Extensions.AgentFramework
1.0.0
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.Agents.A365.Tooling.Extensions.AgentFramework --version 1.0.0
NuGet\Install-Package Microsoft.Agents.A365.Tooling.Extensions.AgentFramework -Version 1.0.0
<PackageReference Include="Microsoft.Agents.A365.Tooling.Extensions.AgentFramework" Version="1.0.0" />
<PackageVersion Include="Microsoft.Agents.A365.Tooling.Extensions.AgentFramework" Version="1.0.0" />
<PackageReference Include="Microsoft.Agents.A365.Tooling.Extensions.AgentFramework" />
paket add Microsoft.Agents.A365.Tooling.Extensions.AgentFramework --version 1.0.0
#r "nuget: Microsoft.Agents.A365.Tooling.Extensions.AgentFramework, 1.0.0"
#:package Microsoft.Agents.A365.Tooling.Extensions.AgentFramework@1.0.0
#addin nuget:?package=Microsoft.Agents.A365.Tooling.Extensions.AgentFramework&version=1.0.0
#tool nuget:?package=Microsoft.Agents.A365.Tooling.Extensions.AgentFramework&version=1.0.0
Microsoft.Agents.A365.Tooling.Extensions.AgentFramework
Microsoft Agent Framework integration for the Microsoft Agent 365 Tooling SDK. Provides MCP (Model Context Protocol) tool server discovery and registration for agents built with Microsoft.Extensions.AI and Microsoft.Agents.AI.
Installation
dotnet add package Microsoft.Agents.A365.Tooling.Extensions.AgentFramework
Key Features
- MCP tool discovery — queries the Agent 365 Tooling Gateway and connects to configured MCP servers
AddToolServersToAgent— builds anAIAgentwith MCP tools loaded alongside any existing toolsGetMcpToolsAsync— returns discovered MCP tools asIList<AITool>for manual agent wiringSendChatHistoryAsync— forwards conversation history to the real-time threat-protection endpoint- V1/V2 per-audience token support — V1 servers share the ATG token; V2 servers (distinct
audience) receive audience-scoped OBO tokens automatically - Dev-mode support — tokens sourced from environment variables when
ASPNETCORE_ENVIRONMENT=Development
Service Registration
using Microsoft.Agents.A365.Tooling.Extensions.AgentFramework.Extensions;
// Program.cs
builder.Services.AddMcpServices();
AddMcpServices() registers:
IMcpToolServerConfigurationService→McpToolServerConfigurationService(scoped)IMcpToolRegistrationService→McpToolRegistrationService(scoped)
Usage
Adding MCP tools to an agent
using Microsoft.Agents.A365.Tooling.Extensions.AgentFramework.Services;
using Microsoft.Agents.Builder.App.UserAuth;
using Microsoft.Extensions.AI;
public class MyActivityHandler : ActivityHandler
{
private readonly IMcpToolRegistrationService _mcpTools;
private readonly IChatClient _chatClient;
public MyActivityHandler(IMcpToolRegistrationService mcpTools, IChatClient chatClient)
{
_mcpTools = mcpTools;
_chatClient = chatClient;
}
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var userAuth = turnContext.Activity.GetUserAuthorization();
var agent = await _mcpTools.AddToolServersToAgent(
chatClient: _chatClient,
agentInstructions: "You are a helpful assistant.",
initialTools: [],
agentUserId: turnContext.Activity.From.Id,
userAuthorization: userAuth,
authHandlerName: "default",
turnContext: turnContext);
var response = await agent.CompleteAsync(turnContext.Activity.Text, cancellationToken: cancellationToken);
await turnContext.SendActivityAsync(response.Message.Text, cancellationToken: cancellationToken);
}
}
Retrieving tools without building an agent
IList<AITool> tools = await _mcpTools.GetMcpToolsAsync(
agentUserId: turnContext.Activity.From.Id,
userAuthorization: userAuth,
authHandlerName: "default",
turnContext: turnContext);
Sending chat history
// From a list of ChatMessage objects
OperationResult result = await _mcpTools.SendChatHistoryAsync(chatMessages, turnContext, cancellationToken);
Authentication
Production
Token acquisition is automatic. The service uses the Agent Framework UserAuthorization and authHandlerName parameters to perform agentic OBO token exchange via AgenticMcpTokenProvider.
- V1 servers (no
audiencefield, oraudiencematches the ATG App ID) — receive the shared ATG-scoped token. - V2 servers (
audienceidentifies a different application) — receive a token scoped to{audience}/{scope}or{audience}/.default.
Local development
Set ASPNETCORE_ENVIRONMENT=Development (or DOTNET_ENVIRONMENT=Development). Tokens are read from environment variables instead of the OBO flow:
| Variable | Purpose |
|---|---|
BEARER_TOKEN_<SERVERNAME> |
Per-server token (hyphens in name replaced with underscores, uppercased) |
BEARER_TOKEN |
Shared fallback token for all servers |
Example: for a server named my-mcp-server, set BEARER_TOKEN_MY_MCP_SERVER.
Environment Variables
| Variable | Purpose | Default |
|---|---|---|
ASPNETCORE_ENVIRONMENT or DOTNET_ENVIRONMENT |
Set to Development to enable dev mode |
— |
MCP_PLATFORM_ENDPOINT |
Override the Tooling Gateway base URL | https://agent365.svc.cloud.microsoft |
BEARER_TOKEN_<SERVERNAME> |
Dev-mode per-server Bearer token | — |
BEARER_TOKEN |
Dev-mode shared Bearer token fallback | — |
Trademarks
Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
License
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License - see the LICENSE file for details.
| 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. |
-
net8.0
- Azure.AI.OpenAI (>= 2.7.0-beta.2)
- Azure.Core (>= 1.50.0)
- Azure.Identity (>= 1.17.1)
- Microsoft.Agents.A365.Tooling (>= 1.0.0)
- Microsoft.Agents.AI (>= 1.1.0)
- Microsoft.Agents.Authentication.Msal (>= 1.4.83)
- Microsoft.Agents.Builder (>= 1.4.83)
- Microsoft.Agents.Hosting.AspNetCore (>= 1.4.83)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.AI (>= 10.2.0)
- Microsoft.Extensions.AI.AzureAIInference (>= 10.0.0-preview.1.25559.3)
- Microsoft.Extensions.AI.OpenAI (>= 10.0.1-preview.1.25571.5)
- Microsoft.Extensions.Configuration (>= 10.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.4)
- Microsoft.Extensions.DependencyInjection (>= 10.0.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Hosting (>= 10.0.4)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Http (>= 10.0.4)
- Microsoft.Extensions.Logging (>= 10.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Logging.Console (>= 10.0.4)
- Microsoft.Extensions.Options (>= 10.0.4)
- ModelContextProtocol.Core (>= 0.2.0-preview.3)
- OpenAI (>= 2.7.0)
- System.Text.Json (>= 10.0.4)
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.1.9-preview | 41 | 5/27/2026 |
| 1.1.8-preview | 38 | 5/26/2026 |
| 1.1.5-preview | 48 | 5/14/2026 |
| 1.0.0 | 549 | 5/1/2026 |
| 0.3.4-beta | 66 | 4/23/2026 |
| 0.2.152-beta | 75 | 4/13/2026 |
| 0.2.151-beta | 2,210 | 4/3/2026 |
| 0.2.144-beta | 73 | 3/25/2026 |
| 0.2.127-beta | 104 | 2/9/2026 |
| 0.2.118-beta | 152 | 1/24/2026 |
| 0.2.112-beta | 184 | 1/18/2026 |
| 0.1.75-beta | 433 | 11/19/2025 |
| 0.1.72-beta | 2,332 | 11/18/2025 |
See CHANGELOG.md for release notes.