8
8
import java .util .List ;
9
9
import java .util .ServiceLoader ;
10
10
import picocli .CommandLine ;
11
- import picocli .CommandLine .Command ;
12
11
import software .amazon .smithy .java .mcp .cli .commands .Configure ;
13
12
import software .amazon .smithy .java .mcp .cli .commands .InstallBundle ;
14
13
import software .amazon .smithy .java .mcp .cli .commands .ListBundles ;
22
21
* It discovers and registers all available configuration commands and
23
22
* sets up the command hierarchy.
24
23
*/
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
+ }
28
29
29
30
public static void main (String [] args ) {
31
+ addSystemProperties ();
30
32
var configureCommand = new CommandLine (new Configure ());
31
33
discoverConfigurationCommands ().forEach (configureCommand ::addSubcommand );
32
- var commandLine = new CommandLine (new McpCli ())
34
+ var commandLine = new CommandLine (new McpRegistry ())
33
35
.addSubcommand (new StartServer ())
34
36
.addSubcommand (new ListBundles ())
35
37
.addSubcommand (new InstallBundle ())
@@ -38,6 +40,10 @@ public static void main(String[] args) {
38
40
commandLine .execute (args );
39
41
}
40
42
43
+ private static void addSystemProperties () {
44
+ System .setProperty ("jdk.httpclient.allowRestrictedHeaders" , "host" ); //This is required for JavaHttpClientTransport.
45
+ }
46
+
41
47
/**
42
48
* Discovers and loads all ConfigurationCommand implementations using the Java ServiceLoader.
43
49
*
0 commit comments