forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefaultMcpServerBuilder.cs
More file actions
26 lines (23 loc) · 1.16 KB
/
DefaultMcpServerBuilder.cs
File metadata and controls
26 lines (23 loc) · 1.16 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
namespace Microsoft.Extensions.DependencyInjection;
/// <summary>
/// Default implementation of <see cref="IMcpServerBuilder"/> that enables fluent configuration
/// of the Model Context Protocol (MCP) server. This builder is returned by the
/// <see cref="McpServerServiceCollectionExtensions.AddMcpServer"/> extension method and
/// provides access to the service collection for registering additional MCP components.
/// </summary>
internal sealed class DefaultMcpServerBuilder : IMcpServerBuilder
{
/// <inheritdoc/>
public IServiceCollection Services { get; }
/// <summary>
/// Initializes a new instance of the <see cref="DefaultMcpServerBuilder"/> class.
/// </summary>
/// <param name="services">The service collection to which MCP server services will be added. This collection
/// is exposed through the <see cref="Services"/> property to allow additional configuration.</param>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="services"/> is null.</exception>
public DefaultMcpServerBuilder(IServiceCollection services)
{
ArgumentNullException.ThrowIfNull(services);
Services = services;
}
}