Skip to content

Commit 7ea7917

Browse files
Copilotdata-douser
andauthored
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 22f15c3 commit 7ea7917

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
@@ -57338,6 +57338,8 @@ function registerCLITool(server, definition) {
5733857338
mkdirSync5(outputDir, { recursive: true });
5733957339
}
5734057340
}
57341+
const userAdditionalArgs = Array.isArray(options.additionalArgs) ? options.additionalArgs : [];
57342+
delete options.additionalArgs;
5734157343
let result;
5734257344
if (command === "codeql") {
5734357345
let cwd;
@@ -57353,9 +57355,9 @@ function registerCLITool(server, definition) {
5735357355
if (name === "codeql_test_run") {
5735457356
options["keep-databases"] = true;
5735557357
}
57356-
result = await executeCodeQLCommand(subcommand, options, positionalArgs, cwd);
57358+
result = await executeCodeQLCommand(subcommand, options, [...positionalArgs, ...userAdditionalArgs], cwd);
5735757359
} else if (command === "qlt") {
57358-
result = await executeQLTCommand(subcommand, options, positionalArgs);
57360+
result = await executeQLTCommand(subcommand, options, [...positionalArgs, ...userAdditionalArgs]);
5735957361
} else {
5736057362
throw new Error(`Unsupported command: ${command}`);
5736157363
}

0 commit comments

Comments
 (0)