Skip to content

Commit 76e0ab7

Browse files
Copilotdata-douser
andcommitted
fix: extract additionalArgs as raw CLI arguments instead of --additionalArgs=value
Previously, `additionalArgs` (e.g., `["--sarif-include-query-help=always"]`) stayed in the options object and was processed by `buildCodeQLArgs` into `--additionalArgs=--sarif-include-query-help=always`, which is invalid. Now `additionalArgs` is extracted from options before CLI arg building and appended as raw arguments after positional args, so args like `--sarif-include-query-help=always` and `--no-sarif-minify` are passed through correctly to the `codeql` CLI. Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/ff382e0c-2894-422a-a9c8-22c431c9a77a Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
1 parent f3dd9f7 commit 76e0ab7

File tree

4 files changed

+140
-6
lines changed

4 files changed

+140
-6
lines changed

server/dist/codeql-development-mcp-server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57350,6 +57350,8 @@ function registerCLITool(server, definition) {
5735057350
mkdirSync5(outputDir, { recursive: true });
5735157351
}
5735257352
}
57353+
const userAdditionalArgs = Array.isArray(options.additionalArgs) ? options.additionalArgs : [];
57354+
delete options.additionalArgs;
5735357355
let result;
5735457356
if (command === "codeql") {
5735557357
let cwd;
@@ -57365,9 +57367,9 @@ function registerCLITool(server, definition) {
5736557367
if (name === "codeql_test_run") {
5736657368
options["keep-databases"] = true;
5736757369
}
57368-
result = await executeCodeQLCommand(subcommand, options, positionalArgs, cwd);
57370+
result = await executeCodeQLCommand(subcommand, options, [...positionalArgs, ...userAdditionalArgs], cwd);
5736957371
} else if (command === "qlt") {
57370-
result = await executeQLTCommand(subcommand, options, positionalArgs);
57372+
result = await executeQLTCommand(subcommand, options, [...positionalArgs, ...userAdditionalArgs]);
5737157373
} else {
5737257374
throw new Error(`Unsupported command: ${command}`);
5737357375
}

0 commit comments

Comments
 (0)