diff --git a/mcp/mcp-cli-api/src/main/java/software/amazon/smithy/java/mcp/cli/SmithyMcpCommand.java b/mcp/mcp-cli-api/src/main/java/software/amazon/smithy/java/mcp/cli/SmithyMcpCommand.java index 286037911..02a44f54a 100644 --- a/mcp/mcp-cli-api/src/main/java/software/amazon/smithy/java/mcp/cli/SmithyMcpCommand.java +++ b/mcp/mcp-cli-api/src/main/java/software/amazon/smithy/java/mcp/cli/SmithyMcpCommand.java @@ -8,6 +8,7 @@ import static software.amazon.smithy.java.mcp.cli.ConfigUtils.loadOrCreateConfig; import java.util.concurrent.Callable; +import picocli.CommandLine; import software.amazon.smithy.java.logging.InternalLogger; import software.amazon.smithy.java.mcp.cli.model.Config; @@ -20,6 +21,9 @@ */ public abstract class SmithyMcpCommand implements Callable { + @CommandLine.Spec + CommandLine.Model.CommandSpec commandSpec; + InternalLogger LOG = InternalLogger.getLogger(SmithyMcpCommand.class); @Override @@ -50,4 +54,8 @@ public final Integer call() throws Exception { protected String registryToUse(Config config) { return config.getDefaultRegistry(); } + + protected final CommandLine.Model.CommandSpec commandSpec() { + return commandSpec; + } } diff --git a/mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands/ListBundles.java b/mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands/ListBundles.java index 65d8f3440..85dc683bb 100644 --- a/mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands/ListBundles.java +++ b/mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands/ListBundles.java @@ -25,13 +25,15 @@ protected void execute(ExecutionContext context) { registry .listMcpBundles() .forEach(bundle -> { - StringBuilder builder = new StringBuilder(bundle.getName()); - if (bundle.getDescription() != null) { - builder.append("\n").append("Description: ").append(bundle.getDescription()); - } else { - builder.append("\n").append("MCP for ").append(bundle.getName()); + System.out.println(commandSpec().commandLine() + .getColorScheme() + .string("@|bold " + bundle.getName() + "|@")); + var description = bundle.getDescription(); + if (description == null) { + description = "MCP server for " + bundle.getName(); } - System.out.println(builder); + System.out.print("\tDescription: "); + System.out.println(description); }); }