Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,25 @@ public class AddAwsServiceBundle extends AbstractAddBundle {
@Option(names = {"-b", "--blocked-apis"}, description = "List of APIs to hide in the MCP server")
protected Set<String> blockedApis;

@Option(names = "--include-write-apis",
description = "Include write APIs in the MCP server")
Boolean includeWriteApis;
@Option(names = "--read-only-apis",
description = "Include read only APIs in the MCP server",
defaultValue = "true")
protected boolean readOnlyApis;

@Override
protected CliBundle getNewToolConfig() {
var bundleBuilder = AwsServiceBundler.builder()
.serviceName(awsServiceName);
//If nothing is specified then default to only readOnlyOperations.
if (readOnlyApis) {
// Include read-only apis unless disabled
bundleBuilder.readOnlyOperations();
}
Comment on lines +40 to +49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be Boolean and we should still only respect the allowedApis if explicitly passed. Right now there is no way for a customer to only create a bundle for a single API without blockingListing every other one.

IMO what would be better is this,

  1. If nothing is passed default to read-only-apis.
  2. If an allow list is passed use only that. Users can optionally also pass read-only-apis and then they get the union of allowList and readOnlyApis.

if (allowedApis != null) {
// User explicitly specified allowed APIs - use only those
bundleBuilder.exposedOperations(allowedApis);
} else if (includeWriteApis == null || !includeWriteApis) {
// Default case or explicit false - read-only operations
bundleBuilder.readOnlyOperations();
}
// Always apply blocked operations if specified
if (blockedApis != null) {
// Always apply blocked operations if specified
bundleBuilder.blockedOperations(blockedApis);
}
var bundle = bundleBuilder.build().bundle();
Expand Down