Skip to content

Commit 180e506

Browse files
committed
fix: ensure envOnly takes precedence over devOnly in install-mcp
- Skip devOnly prompt when envOnly is already provided - Ensure only one of --env-only or --dev-only is emitted in config - Addresses CodeRabbit review feedback
1 parent 28c8cdd commit 180e506

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/cli-v3/src/commands/install-mcp.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ export async function installMcpServer(
215215
);
216216
}
217217

218-
const devOnly = await resolveDevOnly(opts);
218+
// Skip devOnly prompt when envOnly is already provided
219+
const devOnly = opts.envOnly ? false : await resolveDevOnly(opts);
219220

220221
opts.devOnly = devOnly;
221222

@@ -509,12 +510,11 @@ function resolveMcpServerConfig(
509510
args.push("--api-url", options.apiUrl);
510511
}
511512

512-
if (options.devOnly) {
513-
args.push("--dev-only");
514-
}
515-
513+
// Handle environment restrictions - envOnly takes precedence
516514
if (options.envOnly) {
517515
args.push("--env-only", options.envOnly);
516+
} else if (options.devOnly) {
517+
args.push("--dev-only");
518518
}
519519

520520
if (options.disableDeployment) {

0 commit comments

Comments
 (0)