{"record":{"id":"2ddb7dd6c30ea3cb","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-setup-mcp-mode-value-after-mcp-expected","errorCode":null,"errorMessage":"Missing setup MCP mode value after --mcp. Expected one of: none, compat","messagePattern":"Missing setup MCP mode value after --mcp\\. Expected one of: none, compat","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":653,"sourceCode":"      );\n    }\n    return next as SetupMcpMode;\n  };\n\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index];\n    if (arg === \"--no-mcp\") {\n      setValue(\"none\", arg);\n      continue;\n    }\n    if (arg === \"--with-mcp\") {\n      setValue(\"compat\", arg);\n      continue;\n    }\n    if (arg === \"--mcp\") {\n      const next = args[index + 1];\n      if (!next || next.startsWith(\"-\")) {\n        throw new Error(\n          `Missing setup MCP mode value after --mcp. Expected one of: none, compat`,\n        );\n      }\n      setValue(parseValue(next), arg);\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--mcp=\")) {\n      setValue(parseValue(arg.slice(\"--mcp=\".length)), \"--mcp\");\n    }\n  }\n\n  return value;\n}\n\nexport function resolveSetupScopeArg(args: string[]): SetupScope | undefined {\n  let value: string | undefined;\n  for (let index = 0; index < args.length; index += 1) {","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L635-L671","documentation":"--mcp expects a value (`none` or `compat`) as the next token. The error fires when --mcp is last or the next token starts with `-`.","triggerScenarios":"`omx setup --mcp` (end of args) or `--mcp --scope project`.","commonSituations":"Truncated commands or scripts dropping the value.","solutions":["Append a valid mode: `--mcp compat`","Or use the boolean shorthand `--no-mcp`/flag form if you want the default"],"exampleFix":"# before\nomx setup --mcp\n# after\nomx setup --mcp=compat","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--mcp');\nconst v = args[i + 1];\nif (!v || v.startsWith('-')) throw new Error('missing MCP mode value');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer --mcp=compat inline form"],"tags":["cli","missing-argument","mcp"],"backgroundTag":"missing-cli-argument-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}