forked from microsoft/agent-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgentSkillsProviderBuilderMcpExtensions.cs
More file actions
27 lines (23 loc) · 1.14 KB
/
Copy pathAgentSkillsProviderBuilderMcpExtensions.cs
File metadata and controls
27 lines (23 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Shared.Diagnostics;
using ModelContextProtocol.Client;
namespace Microsoft.Agents.AI;
/// <summary>
/// MCP-specific extension methods for <see cref="AgentSkillsProviderBuilder"/>.
/// </summary>
public static class AgentSkillsProviderBuilderMcpExtensions
{
/// <summary>
/// Adds a skill source that discovers skills served over MCP via the supplied <paramref name="client"/>.
/// </summary>
/// <param name="builder">The builder to extend.</param>
/// <param name="client">An MCP client connected to a server exposing Agent Skills resources.</param>
/// <param name="options">Optional options that control archive-distributed skill handling.</param>
/// <returns>The builder instance for chaining.</returns>
public static AgentSkillsProviderBuilder UseMcpSkills(this AgentSkillsProviderBuilder builder, McpClient client, AgentMcpSkillsSourceOptions? options = null)
{
_ = Throw.IfNull(builder);
_ = Throw.IfNull(client);
return builder.UseSource(loggerFactory => new AgentMcpSkillsSource(client, options, loggerFactory));
}
}