@@ -136,9 +136,11 @@ func init() {
136136 rootCmd .PersistentFlags ().Bool ("lockdown-mode" , false , "Enable lockdown mode" )
137137 rootCmd .PersistentFlags ().Bool ("insiders" , false , "Enable insiders features" )
138138 rootCmd .PersistentFlags ().Duration ("repo-access-cache-ttl" , 5 * time .Minute , "Override the repo access cache TTL (e.g. 1m, 0s to disable)" )
139- rootCmd .PersistentFlags ().Int ("port" , 8082 , "HTTP server port" )
140- rootCmd .PersistentFlags ().String ("base-url" , "" , "Base URL where this server is publicly accessible (for OAuth resource metadata)" )
141- rootCmd .PersistentFlags ().String ("base-path" , "" , "Externally visible base path for the HTTP server (for OAuth resource metadata)" )
139+
140+ // HTTP-specific flags
141+ httpCmd .Flags ().Int ("port" , 8082 , "HTTP server port" )
142+ httpCmd .Flags ().String ("base-url" , "" , "Base URL where this server is publicly accessible (for OAuth resource metadata)" )
143+ httpCmd .Flags ().String ("base-path" , "" , "Externally visible base path for the HTTP server (for OAuth resource metadata)" )
142144
143145 // Bind flag to viper
144146 _ = viper .BindPFlag ("toolsets" , rootCmd .PersistentFlags ().Lookup ("toolsets" ))
@@ -154,9 +156,9 @@ func init() {
154156 _ = viper .BindPFlag ("lockdown-mode" , rootCmd .PersistentFlags ().Lookup ("lockdown-mode" ))
155157 _ = viper .BindPFlag ("insiders" , rootCmd .PersistentFlags ().Lookup ("insiders" ))
156158 _ = viper .BindPFlag ("repo-access-cache-ttl" , rootCmd .PersistentFlags ().Lookup ("repo-access-cache-ttl" ))
157- _ = viper .BindPFlag ("port" , rootCmd . PersistentFlags ().Lookup ("port" ))
158- _ = viper .BindPFlag ("base-url" , rootCmd . PersistentFlags ().Lookup ("base-url" ))
159- _ = viper .BindPFlag ("base-path" , rootCmd . PersistentFlags ().Lookup ("base-path" ))
159+ _ = viper .BindPFlag ("port" , httpCmd . Flags ().Lookup ("port" ))
160+ _ = viper .BindPFlag ("base-url" , httpCmd . Flags ().Lookup ("base-url" ))
161+ _ = viper .BindPFlag ("base-path" , httpCmd . Flags ().Lookup ("base-path" ))
160162
161163 // Add subcommands
162164 rootCmd .AddCommand (stdioCmd )
0 commit comments