Skip to content

Commit 1802257

Browse files
Copilotdata-douser
andcommitted
feat: make stdio server path configurable via MCP_SERVER_PATH env var
Add MCP_SERVER_PATH env var support for configuring the server binary path in stdio mode. Update CLI help text to document new environment variables. Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
1 parent 2af20c2 commit 1802257

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

client/src/lib/cli-parser.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ OPTIONS:
133133
Example: --timeout 600
134134
135135
--help Display help information
136+
137+
ENVIRONMENT VARIABLES:
138+
MCP_MODE MCP transport mode: stdio (default) or http
139+
MCP_SERVER_PATH Path to the MCP server JS entry point (stdio mode only)
140+
MCP_SERVER_URL MCP server URL (http mode only, default: http://localhost:3000/mcp)
141+
ENABLE_MONITORING_TOOLS Enable session_* monitoring tools (default: false)
136142
`;
137143
}
138144

client/src/ql-mcp-client.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,9 @@ class CodeQLMCPClient {
123123
});
124124

125125
if (this.mcpMode === "stdio") {
126-
const serverPath = path.join(
127-
__dirname,
128-
"..",
129-
"server",
130-
"dist",
131-
"codeql-development-mcp-server.js"
132-
);
126+
const serverPath =
127+
process.env.MCP_SERVER_PATH ||
128+
path.join(__dirname, "..", "server", "dist", "codeql-development-mcp-server.js");
133129
this.transport = new StdioClientTransport({
134130
command: "node",
135131
args: [serverPath],

0 commit comments

Comments
 (0)