Skip to content

Commit 1a5732b

Browse files
authored
docs: add McpServerOptionsSetup code comment (#77)
1 parent c398873 commit 1a5732b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ModelContextProtocol/Configuration/McpServerOptionsSetup.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,31 @@
66

77
namespace ModelContextProtocol.Configuration;
88

9+
/// <summary>
10+
/// Configures the McpServerOptions using provided server handlers.
11+
/// </summary>
12+
/// <param name="serverHandlers">The server handlers configuration options.</param>
913
internal sealed class McpServerOptionsSetup(IOptions<McpServerHandlers> serverHandlers) : IConfigureOptions<McpServerOptions>
1014
{
15+
/// <summary>
16+
/// Configures the given McpServerOptions instance by setting server information
17+
/// and applying custom server handlers.
18+
/// </summary>
19+
/// <param name="options">The options instance to be configured.</param>
1120
public void Configure(McpServerOptions options)
1221
{
1322
Throw.IfNull(options);
1423

1524
var assemblyName = Assembly.GetEntryAssembly()?.GetName();
25+
26+
// Set server information based on the entry assembly
1627
options.ServerInfo = new Implementation
1728
{
1829
Name = assemblyName?.Name ?? "McpServer",
1930
Version = assemblyName?.Version?.ToString() ?? "1.0.0",
2031
};
2132

33+
// Apply custom server handlers
2234
serverHandlers.Value.OverwriteWithSetHandlers(options);
2335
}
2436
}

0 commit comments

Comments
 (0)