Fix --server-url flag not being parsed by CLI

Add --server-url option to CLI parser so the flag is properly recognized
and passed through to the server process via the /config endpoint.
This commit is contained in:
Felix Weinberger 2025-08-07 11:51:36 +01:00
commit cf7c138958
No known key found for this signature in database

View file

@ -24,6 +24,7 @@ type CliOptions = {
server?: string;
cli?: boolean;
transport?: string;
serverUrl?: string;
};
type ServerConfig =
@ -224,7 +225,8 @@ function parseArgs(): Args {
.option("--config <path>", "config file path")
.option("--server <n>", "server name from config file")
.option("--cli", "enable CLI mode")
.option("--transport <type>", "transport type (stdio, sse, http)");
.option("--transport <type>", "transport type (stdio, sse, http)")
.option("--server-url <url>", "server URL for SSE/HTTP transport");
// Parse only the arguments before --
program.parse(preArgs);
@ -318,6 +320,7 @@ function parseArgs(): Args {
envArgs: options.e || {},
cli: options.cli || false,
transport: transport as "stdio" | "sse" | "streamable-http" | undefined,
serverUrl: options.serverUrl,
};
}