Improve how to host McpServer (#30)
This commit is contained in:
parent
30f3f192ca
commit
257a97a659
1 changed files with 538 additions and 45 deletions
22
src/mcpdotnet/Configuration/DefaultMcpServerBuilder.cs
Normal file
22
src/mcpdotnet/Configuration/DefaultMcpServerBuilder.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace McpDotNet.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Default implementation of <see cref="IMcpServerBuilder"/>.
|
||||
/// </summary>
|
||||
internal class DefaultMcpServerBuilder : IMcpServerBuilder
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public IServiceCollection Services { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DefaultMcpServerBuilder"/> class.
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public DefaultMcpServerBuilder(IServiceCollection services)
|
||||
{
|
||||
Services = services ?? throw new ArgumentNullException(nameof(services));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue