From f70b70d035620416aafb64349531fd2a20dee3cb Mon Sep 17 00:00:00 2001 From: "victor.delarosa" <1938685+vdlr@users.noreply.github.com> Date: Fri, 13 Feb 2026 11:01:01 +0100 Subject: [PATCH 1/2] release 1.2.4 update MCP Setup xygeni/product-backlog#4222 --- .github/workflows/build-test-publish.yml | 2 +- CHANGELOG.md | 5 + README.md | 1 + package.json | 2 +- src/xygeni/common/commands.ts | 7 +- src/xygeni/service/installer.ts | 6 +- src/xygeni/views/mcp-setup-view.ts | 166 +++++++++++++++-------- 7 files changed, 121 insertions(+), 68 deletions(-) diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index c2b3b84..3d2303b 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -31,7 +31,7 @@ jobs: - name: Upload extension artifact uses: actions/upload-artifact@v4 with: - name: extension-vsix + name: xygeni-scanner-vscode path: "*.vsix" - uses: trstringer/manual-approval@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 37ee265..f79cf0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,3 +26,8 @@ ## [1.2.3] - Fix scanner compatibility with asdf CLI manager +- Remove deprecate install.sh usage + +## [1.2.4] + +- Update MCP Setup to use current XYGENI_TOKEN \ No newline at end of file diff --git a/README.md b/README.md index 83166f1..342e1bd 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Xygeni Security Scanner is a powerful extension that brings comprehensive securi - **In-Editor Issue Highlighting:** View security findings directly in your code, making it easy to pinpoint and fix issues. - **Detailed Vulnerability Information:** Get rich details for each identified issue, including severity, description, and remediation guidance. - **Proxy Support:** Configure the extension to work with your corporate proxy. +- **MCP Setup:** Generate ready-to-use MCP server configuration from the extension to connect Xygeni security tools to MCP-compatible AI assistants. ## Installation diff --git a/package.json b/package.json index a44b0d6..00e068d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "publisher": "xygeni-security", "license": "MIT", "icon": "media/images/logo_xy.png", - "version": "1.2.3", + "version": "1.2.4", "engines": { "vscode": "^1.99.2" }, diff --git a/src/xygeni/common/commands.ts b/src/xygeni/common/commands.ts index 6e60cea..0c844a1 100644 --- a/src/xygeni/common/commands.ts +++ b/src/xygeni/common/commands.ts @@ -201,8 +201,11 @@ export class CommandsImpl implements Commands, ScanViewEmitter, IssueViewEmitter this.connectionReady(); if (!override && await InstallerService.getInstance().isScannerInstalled()) { - Logger.log('=== Xygeni Scanner already installed ==='); + Logger.log('=== Xygeni Scanner already installed. ==='); this.installerOk(); + this.setMcpLibraryInstalled(); + Logger.log(`=== MCP Library is ready. Check Xygeni MCP Setup to configure it. ===`); + return Promise.resolve(); } @@ -413,7 +416,7 @@ export class CommandsImpl implements Commands, ScanViewEmitter, IssueViewEmitter } showMcpSetupView() { - McpSetupView.showMcpSetup(this); + void McpSetupView.showMcpSetup(this); } openDiffViewCommand(uri: string, tempFile: string): void { diff --git a/src/xygeni/service/installer.ts b/src/xygeni/service/installer.ts index c26926a..d8afea0 100644 --- a/src/xygeni/service/installer.ts +++ b/src/xygeni/service/installer.ts @@ -190,10 +190,8 @@ export default class InstallerService { // remove installPath if exists, force fresh install if (fs.existsSync(this.mcpLibraryPath)) { - this.logger.log(` MCP Library already exist at: ${installMcpPath}`); - this.logger.log(` Check Xygeni MCP Setup to configure it.`); - this.logger.log("============================================================"); - return Promise.resolve(); + this.logger.log(` Removing existing installation at: ${this.mcpLibraryPath}`); + fs.rmSync(this.mcpLibraryPath, { recursive: true, force: true }); } // create folder if not yet if (!fs.existsSync(installMcpPath)){ diff --git a/src/xygeni/views/mcp-setup-view.ts b/src/xygeni/views/mcp-setup-view.ts index 767058b..4301269 100644 --- a/src/xygeni/views/mcp-setup-view.ts +++ b/src/xygeni/views/mcp-setup-view.ts @@ -1,6 +1,7 @@ +import * as fs from 'fs'; +import * as path from 'path'; import * as vscode from 'vscode'; -import { Commands } from "../common/interfaces"; -import path from 'path'; +import { Commands } from '../common/interfaces'; import { Logger } from '../common/logger'; export class McpSetupView { @@ -8,7 +9,7 @@ export class McpSetupView { private static panel: vscode.WebviewPanel | undefined; - public static showMcpSetup(commands: Commands): void { + public static async showMcpSetup(commands: Commands): Promise { if (this.panel) { this.panel.reveal(vscode.ViewColumn.Two); } else { @@ -32,12 +33,49 @@ export class McpSetupView { }; } + const panel = this.panel; + if (!panel) { + return; + } + const nonce = this.getNonce(); - const mcpLibraryPath = commands.getMcpLibraryPath(); + const configuredMcpLibraryPath = commands.getMcpLibraryPath(); + const fallbackMcpLibraryPath = path.join(commands.getExtensionPath(), '.xygeni-mcp', 'xygeni-mcp-server.jar'); + const mcpLibraryPath = configuredMcpLibraryPath || (fs.existsSync(fallbackMcpLibraryPath) ? fallbackMcpLibraryPath : undefined); const isMcpLibraryInstalled = mcpLibraryPath !== undefined; const scannerInstallDirectory = commands.getScannerInstallationDir(); const scannerInstalled = commands.isInstallReady(); const javaHome = process.env.JAVA_HOME || '$JAVA_HOME'; + const savedToken = await commands.getToken(); + if (this.panel !== panel) { + return; + } + const xygeniToken = savedToken || '$XYGENI_TOKEN'; + + const serverName = 'xygeni-mcp-server'; + const jarPath = mcpLibraryPath || '$XYGENI_MCP_SERVER_JAR'; + const scannerPathArg = `--scannerPath=${scannerInstallDirectory}`; + + const jsonConfig = JSON.stringify({ + servers: { + [serverName]: { + timeout: 60, + type: 'stdio', + command: 'java', + args: [ + '-jar', + jarPath, + scannerPathArg + ], + env: { + JAVA_HOME: javaHome, + XYGENI_TOKEN: xygeniToken + } + } + } + }, null, 2); + + const tomlConfig = this.buildTomlConfig(serverName, jarPath, scannerPathArg, javaHome, xygeniToken); // Auto-import the MCP documentation this.loadMcpDocumentation(); @@ -48,7 +86,7 @@ export class McpSetupView { Xygeni MCP Server Setup Guide - +