File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed 
src/ModelContextProtocol/Configuration Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 66
77namespace  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> 
913internal  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} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments