Skip to content

Commit f2bbabf

Browse files
authored
Merge branch 'main' into optionaloptions
2 parents b1e8ac0 + 1a5732b commit f2bbabf

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,5 @@ $RECYCLE.BIN/
7171
_NCrunch_*
7272
.*crunch*.local.xml
7373
nCrunchTemp_*
74+
75+
*.orig

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)