@@ -29,6 +29,7 @@ type Config struct {
2929}
3030
3131type authType string
32+ type serverType string
3233
3334const (
3435 // AuthTypePassthrough defines auth flow where API token, used to communicate with MCP server,
@@ -38,6 +39,9 @@ const (
3839 // AuthTypeStatic defines auth flow where API token is statically configured and
3940 // defined in configuration or environment variable.
4041 AuthTypeStatic authType = "static"
42+
43+ ServerTypeStdio serverType = "stdio"
44+ ServerTypeStreamableHttp serverType = "streamable-http"
4145)
4246
4347// CentralConfig contains StackRox Central connection configuration.
@@ -62,8 +66,9 @@ type GlobalConfig struct {
6266
6367// ServerConfig contains HTTP server configuration.
6468type ServerConfig struct {
65- Address string `mapstructure:"address"`
66- Port int `mapstructure:"port"`
69+ Type serverType `mapstructure:"type"`
70+ Address string `mapstructure:"address"`
71+ Port int `mapstructure:"port"`
6772}
6873
6974// ToolsConfig contains configuration for individual MCP tools.
@@ -138,6 +143,7 @@ func setDefaults(viper *viper.Viper) {
138143
139144 viper .SetDefault ("server.address" , "0.0.0.0" )
140145 viper .SetDefault ("server.port" , defaultPort )
146+ viper .SetDefault ("server.type" , ServerTypeStreamableHttp )
141147
142148 viper .SetDefault ("tools.vulnerability.enabled" , false )
143149 viper .SetDefault ("tools.config_manager.enabled" , false )
@@ -207,6 +213,12 @@ func (cc *CentralConfig) validate() error {
207213}
208214
209215func (sc * ServerConfig ) validate () error {
216+ if sc .Type != ServerTypeStreamableHttp && sc .Type != ServerTypeStdio {
217+ return errors .New ("server.type must be either streamable-http or stdio" )
218+ }
219+ if sc .Type == ServerTypeStdio {
220+ return nil
221+ }
210222 if sc .Address == "" {
211223 return errors .New ("server.address is required" )
212224 }
0 commit comments