Skip to content

Commit 5ee649f

Browse files
committed
feat: add --no-semantic-search CLI flag for gateway creation
Wire enableSemanticSearch through GatewayPrimitive, CLI option types, and the useCreateGateway hook so both TUI and CLI paths persist the setting to mcp.json.
1 parent 4b969f2 commit 5ee649f

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/cli/commands/add/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface AddGatewayOptions {
3535
agentClientId?: string;
3636
agentClientSecret?: string;
3737
agents?: string;
38+
semanticSearch?: boolean;
3839
json?: boolean;
3940
}
4041

src/cli/primitives/GatewayPrimitive.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface AddGatewayOptions {
2626
agentClientId?: string;
2727
agentClientSecret?: string;
2828
agents?: string;
29+
noSemanticSearch?: boolean;
2930
}
3031

3132
/**
@@ -156,6 +157,7 @@ export class GatewayPrimitive extends BasePrimitive<AddGatewayOptions, Removable
156157
.option('--agent-client-id <id>', 'Agent OAuth client ID')
157158
.option('--agent-client-secret <secret>', 'Agent OAuth client secret')
158159
.option('--agents <agents>', 'Comma-separated agent names')
160+
.option('--no-semantic-search', 'Disable semantic search for tool discovery')
159161
.option('--json', 'Output as JSON')
160162
.action(async (rawOptions: Record<string, string | boolean | undefined>) => {
161163
const cliOptions = rawOptions as unknown as CLIAddGatewayOptions;
@@ -186,6 +188,7 @@ export class GatewayPrimitive extends BasePrimitive<AddGatewayOptions, Removable
186188
agentClientId: cliOptions.agentClientId,
187189
agentClientSecret: cliOptions.agentClientSecret,
188190
agents: cliOptions.agents,
191+
noSemanticSearch: cliOptions.semanticSearch === false,
189192
});
190193

191194
if (cliOptions.json) {
@@ -282,6 +285,7 @@ export class GatewayPrimitive extends BasePrimitive<AddGatewayOptions, Removable
282285
description: options.description ?? `Gateway for ${options.name}`,
283286
authorizerType: options.authorizerType,
284287
jwtConfig: undefined,
288+
enableSemanticSearch: !options.noSemanticSearch,
285289
};
286290

287291
if (options.authorizerType === 'CUSTOM_JWT' && options.discoveryUrl) {
@@ -348,6 +352,7 @@ export class GatewayPrimitive extends BasePrimitive<AddGatewayOptions, Removable
348352
targets: movedTargets,
349353
authorizerType: config.authorizerType,
350354
authorizerConfiguration: this.buildAuthorizerConfiguration(config),
355+
enableSemanticSearch: config.enableSemanticSearch,
351356
};
352357

353358
mcpSpec.agentCoreGateways.push(gateway);

src/cli/tui/hooks/useCreateMcp.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function useCreateGateway() {
2828
allowedScopes: config.jwtConfig?.allowedScopes?.join(','),
2929
agentClientId: config.jwtConfig?.agentClientId,
3030
agentClientSecret: config.jwtConfig?.agentClientSecret,
31+
noSemanticSearch: !config.enableSemanticSearch,
3132
});
3233
if (!addResult.success) {
3334
throw new Error(addResult.error ?? 'Failed to create gateway');

0 commit comments

Comments
 (0)