Skip to content

Commit 014a661

Browse files
committed
Default to only launching Smithy bundles when no bundles are specified
1 parent 330f874 commit 014a661

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

  • mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands

mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands/StartServer.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.io.IOException;
99
import java.util.ArrayList;
1010
import java.util.List;
11+
import java.util.Map;
1112
import java.util.concurrent.CompletableFuture;
1213
import java.util.function.Supplier;
1314
import java.util.stream.Collectors;
@@ -77,7 +78,17 @@ public void execute(ExecutionContext context) throws IOException {
7778
var config = context.config();
7879
// By default, load all available tools
7980
if (toolBundles == null || toolBundles.isEmpty()) {
80-
toolBundles = new ArrayList<>(config.getToolBundles().keySet());
81+
toolBundles = new ArrayList<>(config.getToolBundles()
82+
.entrySet()
83+
.stream()
84+
.filter(entry -> {
85+
// By default, only include smithy bundles if no bundles are specified.
86+
// We can undo this once we have fanout support for generic bundles.
87+
var bundle = entry.getValue();
88+
return bundle.getValue() instanceof McpBundleConfig.SmithyModeledMember;
89+
})
90+
.map(Map.Entry::getKey)
91+
.toList());
8192
}
8293

8394
if (toolBundles.isEmpty() && !registryServer) {

0 commit comments

Comments
 (0)