88import java .util .List ;
99import java .util .ServiceLoader ;
1010import picocli .CommandLine ;
11- import picocli .CommandLine .Command ;
1211import software .amazon .smithy .java .mcp .cli .commands .Configure ;
1312import software .amazon .smithy .java .mcp .cli .commands .InstallBundle ;
1413import software .amazon .smithy .java .mcp .cli .commands .ListBundles ;
2221 * It discovers and registers all available configuration commands and
2322 * sets up the command hierarchy.
2423 */
25- @ Command (name = "mcp-registry" , versionProvider = VersionProvider .class , mixinStandardHelpOptions = true ,
26- scope = CommandLine .ScopeType .INHERIT )
27- public class McpCli {
24+ public final class McpCli {
25+
26+ private McpCli () {
27+ throw new UnsupportedOperationException ();
28+ }
2829
2930 public static void main (String [] args ) {
31+ addSystemProperties ();
3032 var configureCommand = new CommandLine (new Configure ());
3133 discoverConfigurationCommands ().forEach (configureCommand ::addSubcommand );
32- var commandLine = new CommandLine (new McpCli ())
34+ var commandLine = new CommandLine (new McpRegistry ())
3335 .addSubcommand (new StartServer ())
3436 .addSubcommand (new ListBundles ())
3537 .addSubcommand (new InstallBundle ())
@@ -38,6 +40,10 @@ public static void main(String[] args) {
3840 commandLine .execute (args );
3941 }
4042
43+ private static void addSystemProperties () {
44+ System .setProperty ("jdk.httpclient.allowRestrictedHeaders" , "host" ); //This is required for JavaHttpClientTransport.
45+ }
46+
4147 /**
4248 * Discovers and loads all ConfigurationCommand implementations using the Java ServiceLoader.
4349 *
0 commit comments