Skip to content

Commit f0f91c2

Browse files
cx-itay-pazItay Paz
andauthored
Add support in ai mcp config (#841)
Co-authored-by: Itay Paz <[email protected]>
1 parent cc7c139 commit f0f91c2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/main/wrapper/CxConstants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,7 @@ export enum CxConstants {
108108
STATE_CONFIRMED = "confirmed",
109109
CMD_LEARN_MORE = "learn-more",
110110
IDE_SCANS_KEY = " scan.config.plugins.ideScans",
111-
AI_GUIDED_REMEDIATION_KEY = " scan.config.plugins.aiGuidedRemediation"
111+
AI_GUIDED_REMEDIATION_KEY = " scan.config.plugins.aiGuidedRemediation",
112+
AI_MCP_SERVER_KEY = "scan.config.plugins.aiMcpServer"
113+
112114
}

src/main/wrapper/CxWrapper.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,16 @@ export class CxWrapper {
369369
return output.has(CxConstants.AI_GUIDED_REMEDIATION_KEY) && output.get(CxConstants.AI_GUIDED_REMEDIATION_KEY).toLowerCase() === " true";
370370
}
371371

372+
373+
async aiMcpServerEnabled(): Promise<boolean> {
374+
const commands: string[] = [CxConstants.CMD_UTILS, CxConstants.SUB_CMD_TENANT];
375+
commands.push(...this.initializeCommands(false));
376+
const exec = new ExecutionService();
377+
const output = await exec.executeMapTenantOutputCommands(this.config.pathToExecutable, commands);
378+
return output.has(CxConstants.AI_MCP_SERVER_KEY) &&
379+
output.get(CxConstants.AI_MCP_SERVER_KEY).toLowerCase() === "true";
380+
}
381+
372382
async kicsChat(apikey: string, file: string, line: number, severity: string, vulnerability: string, input: string, conversationId?: string, model?: string): Promise<CxCommandOutput> {
373383
const commands: string[] = [
374384
CxConstants.CMD_CHAT,

0 commit comments

Comments
 (0)