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,6 +28,7 @@ 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
@@ -38,6 +39,13 @@ public class McpSseServerConfig
3839 public Dictionary < string , string > ? AdditionalHeaders { get ; set ; }
3940}
4041
42+ public class McpHttpServerConfig
43+ {
44+ public string EndPoint { get ; set ; } = null ! ;
45+ public TimeSpan ConnectionTimeout { get ; init ; } = TimeSpan . FromSeconds ( 30 ) ;
46+ public Dictionary < string , string > ? AdditionalHeaders { get ; set ; }
47+ }
48+
4149public class McpStdioServerConfig
4250{
4351 public string Command { get ; set ; } = null ! ;
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