McpToolRegistrationService Class

Definition

Service for registering and validating MCP tool servers for Foundry (Persistent Agents) scenarios. NOTE: Persistent Agents cannot be mutated to add tools after creation. This method therefore performs discovery + validation and returns the MCP tool definitions and resources that a caller SHOULD use when creating (or recreating) a PersistentAgent. No agent mutation is attempted here.

public class McpToolRegistrationService : Microsoft.Agents.A365.Tooling.Extensions.AzureFoundry.Services.IMcpToolRegistrationService
type McpToolRegistrationService = class
    interface IMcpToolRegistrationService
Public Class McpToolRegistrationService
Implements IMcpToolRegistrationService
Inheritance
McpToolRegistrationService
Implements

Constructors

Name Description
McpToolRegistrationService(ILogger<IMcpToolRegistrationService>, IServiceProvider, IMcpToolServerConfigurationService, IConfiguration)

Initializes a new instance of the McpToolRegistrationService class.

Methods

Name Description
AddToolServersToAgent(PersistentAgentsClient, String, UserAuthorization, ITurnContext, String)

Add new MCP servers to the agent by updating the PersistentAgentsClient.

AddToolServersToAgentAsync(PersistentAgentsClient, UserAuthorization, String, ITurnContext, String)

Loads/initializes configured MCP tool servers for the specified agent with full context. This is the primary method that customers should use in orchestrators with full authentication context.

GetMcpToolDefinitionsAndResourcesAsync(String, String, ITurnContext, UserAuthorization, String)

Get MCP tool definitions and resources, optionally using per-audience tokens for V2 servers.

GetMcpToolDefinitionsAndResourcesAsync(String, String, ITurnContext)

Get MCP tool definitions and resources.

SendChatHistoryAsync(ITurnContext, PersistentThreadMessage[], CancellationToken)

Sends chat history to the MCP platform for real-time threat protection. Messages are provided directly by the caller as Azure AI Foundry messages.

SendChatHistoryAsync(ITurnContext, PersistentThreadMessage[], ToolOptions, CancellationToken)

Sends chat history to the MCP platform for real-time threat protection. Messages are provided directly by the caller as Azure AI Foundry messages.

SendChatHistoryAsync(PersistentAgentsClient, String, ITurnContext, CancellationToken)

Sends chat history to the MCP platform for real-time threat protection. Messages are retrieved from the Azure AI Foundry Persistent Agents client.

SendChatHistoryAsync(PersistentAgentsClient, String, ITurnContext, ToolOptions, CancellationToken)

Sends chat history to the MCP platform for real-time threat protection. Messages are retrieved from the Azure AI Foundry Persistent Agents client.

Applies to