@@ -28,27 +28,38 @@ def __init__(self, config: dict):
2828 def sysdig_endpoint (self ) -> str :
2929 """
3030 Get the Sysdig endpoint from the app config
31+
32+ Returns:
33+ str: The Sysdig API host (e.g., "https://us2.app.sysdig.com").
3134 """
32- return self .app_config ["sysdig" ]["host" ]
35+ return os . environ . get ( "SYSDIG_HOST" , self .app_config ["sysdig" ]["host" ])
3336
3437 def transport (self ) -> str :
3538 """
3639 Get the transport protocol (lower case) from the app config
40+
41+ Returns:
42+ str: The transport protocol (e.g., "stdio", "streamable-http", or "sse").
3743 """
3844 return os .environ .get ("MCP_TRANSPORT" , self .app_config ["mcp" ]["transport" ]).lower ()
3945
40- @staticmethod
41- def log_level () -> str :
46+ def log_level (self ) -> str :
4247 """
43- Get the log level from the app config
48+ Get the log level from the environment or defaults.
49+
50+ Returns:
51+ str: The log level string (e.g., "DEBUG", "INFO", "WARNING", "ERROR").
4452 """
4553 return os .environ .get ("LOGLEVEL" , "ERROR" )
4654
4755 def port (self ) -> int :
4856 """
4957 Get the port from the app config
58+
59+ Returns:
60+ int: The MCP server port.
5061 """
51- return self .app_config ["mcp" ]["port" ]
62+ return os . environ . get ( "SYSDIG_MCP_PORT" , self .app_config ["mcp" ]["port" ])
5263
5364
5465def env_constructor (loader , node ):
@@ -75,7 +86,7 @@ def load_app_config() -> AppConfig:
7586 Load the app config from the YAML file
7687
7788 Returns:
78- dict : The app config loaded from the YAML file
89+ AppConfig : The loaded application configuration wrapper.
7990 """
8091 if not check_config_file_exists ():
8192 log .error ("Config file does not exist" )
@@ -100,7 +111,7 @@ def get_app_config() -> AppConfig:
100111 If the config is already loaded, it returns the existing config.
101112
102113 Returns:
103- dict : The app config loaded from the YAML file, or an empty dict if the file does not exist or is invalid .
114+ AppConfig : The singleton application configuration wrapper .
104115 """
105116 global _app_config
106117 if _app_config is None :
0 commit comments