Skip to content

Commit d7ec3ec

Browse files
Askirclaude
andcommitted
fix(cli): strip run subcommand from MCP command in buildMcpCommand
buildMcpCommand only stripped `install` from process.argv, so when called from `0pflow run` the generated MCP command included `run` as a spurious argument, causing the MCP server to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7ceec68 commit d7ec3ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/core/src/cli/install.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export interface InstallSettings {
3232
export function buildMcpCommand(): McpCommandResult {
3333
const args = [...process.argv];
3434

35-
// Find and replace "install" with "mcp", "start"
36-
const installIndex = args.findIndex(arg => arg === "install");
37-
const baseArgs = installIndex !== -1
38-
? args.slice(0, installIndex)
35+
// Strip the CLI subcommand (install, run, etc.) to get just [node, script]
36+
const subcommandIndex = args.findIndex(arg => arg === "install" || arg === "run");
37+
const baseArgs = subcommandIndex !== -1
38+
? args.slice(0, subcommandIndex)
3939
: args;
4040

4141
const scriptPath = baseArgs[1] || "";

0 commit comments

Comments
 (0)