@@ -57,7 +57,7 @@ func main() {
5757 rootCmd .PersistentFlags ().StringVarP (& dataDir , "data-dir" , "d" , "" , "Data directory path (default: ~/.mcpproxy)" )
5858 rootCmd .PersistentFlags ().StringVarP (& listen , "listen" , "l" , "" , "Listen address (for HTTP mode, not used in stdio mode)" )
5959 rootCmd .PersistentFlags ().StringVar (& logLevel , "log-level" , "info" , "Log level (debug, info, warn, error)" )
60- rootCmd .PersistentFlags ().BoolVar (& enableTray , "tray" , true , "Enable system tray" )
60+ rootCmd .PersistentFlags ().BoolVar (& enableTray , "tray" , true , "Enable system tray (use --tray=false to disable) " )
6161 rootCmd .PersistentFlags ().BoolVar (& debugSearch , "debug-search" , false , "Enable debug search tool for search relevancy debugging" )
6262 rootCmd .PersistentFlags ().IntVar (& toolResponseLimit , "tool-response-limit" , 0 , "Tool response limit in characters (0 = disabled, default: 20000 from config)" )
6363 rootCmd .PersistentFlags ().BoolVar (& logToFile , "log-to-file" , true , "Enable logging to file in standard OS location" )
@@ -74,7 +74,7 @@ func main() {
7474 }
7575}
7676
77- func runServer (_ * cobra.Command , _ []string ) error {
77+ func runServer (cmd * cobra.Command , _ []string ) error {
7878 // Load configuration first to get logging settings
7979 cfg , err := loadConfig ()
8080 if err != nil {
@@ -135,7 +135,10 @@ func runServer(_ *cobra.Command, _ []string) error {
135135 zap .Bool ("log_to_file" , logToFile ))
136136
137137 // Override other settings from command line
138- cfg .EnableTray = enableTray
138+ // Check if the tray flag was explicitly set by the user
139+ if cmd .Flags ().Changed ("tray" ) {
140+ cfg .EnableTray = enableTray
141+ }
139142 cfg .DebugSearch = debugSearch
140143
141144 if toolResponseLimit != 0 {
0 commit comments