diff --git a/src/main/wrapper/CxConstants.ts b/src/main/wrapper/CxConstants.ts index 13eb042e..7c97c64e 100644 --- a/src/main/wrapper/CxConstants.ts +++ b/src/main/wrapper/CxConstants.ts @@ -108,5 +108,7 @@ export enum CxConstants { STATE_CONFIRMED = "confirmed", CMD_LEARN_MORE = "learn-more", IDE_SCANS_KEY = " scan.config.plugins.ideScans", - AI_GUIDED_REMEDIATION_KEY = " scan.config.plugins.aiGuidedRemediation" + AI_GUIDED_REMEDIATION_KEY = " scan.config.plugins.aiGuidedRemediation", + AI_MCP_SERVER_KEY = "scan.config.plugins.aiMcpServer" + } diff --git a/src/main/wrapper/CxWrapper.ts b/src/main/wrapper/CxWrapper.ts index 18028455..eb1ecdf8 100644 --- a/src/main/wrapper/CxWrapper.ts +++ b/src/main/wrapper/CxWrapper.ts @@ -369,6 +369,16 @@ export class CxWrapper { return output.has(CxConstants.AI_GUIDED_REMEDIATION_KEY) && output.get(CxConstants.AI_GUIDED_REMEDIATION_KEY).toLowerCase() === " true"; } + + async aiMcpServerEnabled(): Promise { + const commands: string[] = [CxConstants.CMD_UTILS, CxConstants.SUB_CMD_TENANT]; + commands.push(...this.initializeCommands(false)); + const exec = new ExecutionService(); + const output = await exec.executeMapTenantOutputCommands(this.config.pathToExecutable, commands); + return output.has(CxConstants.AI_MCP_SERVER_KEY) && + output.get(CxConstants.AI_MCP_SERVER_KEY).toLowerCase() === "true"; +} + async kicsChat(apikey: string, file: string, line: number, severity: string, vulnerability: string, input: string, conversationId?: string, model?: string): Promise { const commands: string[] = [ CxConstants.CMD_CHAT,