File tree Expand file tree Collapse file tree
BotSharp.Abstraction/MCP/Models
BotSharp.Core/MCP/Managers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,10 +28,19 @@ public class McpServerConfigModel
2828 public string ? Description { get ; set ; }
2929
3030 public McpSseServerConfig ? SseConfig { get ; set ; }
31+ public McpHttpServerConfig ? HttpConfig { get ; set ; }
3132 public McpStdioServerConfig ? StdioConfig { get ; set ; }
3233}
3334
34- public class McpSseServerConfig
35+ public class McpSseServerConfig : McpHttpServerConfigBase
36+ {
37+ }
38+
39+ public class McpHttpServerConfig : McpHttpServerConfigBase
40+ {
41+ }
42+
43+ public class McpHttpServerConfigBase
3544{
3645 public string EndPoint { get ; set ; } = null ! ;
3746 public TimeSpan ConnectionTimeout { get ; init ; } = TimeSpan . FromSeconds ( 30 ) ;
@@ -42,6 +51,6 @@ public class McpStdioServerConfig
4251{
4352 public string Command { get ; set ; } = null ! ;
4453 public IList < string > ? Arguments { get ; set ; }
45- public Dictionary < string , string > ? EnvironmentVariables { get ; set ; }
54+ public Dictionary < string , string ? > ? EnvironmentVariables { get ; set ; }
4655 public TimeSpan ShutdownTimeout { get ; set ; } = TimeSpan . FromSeconds ( 5 ) ;
4756}
Original file line number Diff line number Diff line change @@ -28,7 +28,17 @@ public McpClientManager(
2828 }
2929
3030 IClientTransport ? transport = null ;
31- if ( config . SseConfig != null )
31+ if ( config . HttpConfig != null )
32+ {
33+ transport = new HttpClientTransport ( new HttpClientTransportOptions
34+ {
35+ Name = config . Name ,
36+ Endpoint = new Uri ( config . HttpConfig . EndPoint ) ,
37+ AdditionalHeaders = config . HttpConfig . AdditionalHeaders ,
38+ ConnectionTimeout = config . HttpConfig . ConnectionTimeout
39+ } ) ;
40+ }
41+ else if ( config . SseConfig != null )
3242 {
3343 transport = new HttpClientTransport ( new HttpClientTransportOptions
3444 {
You can’t perform that action at this time.
0 commit comments