{"record":{"id":"51c27757e248baf2","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-setup-mcp-mode-next-expected-one-of","errorCode":null,"errorMessage":"Invalid setup MCP mode: ${next}. Expected one of: none, compat","messagePattern":"Invalid setup MCP mode: (.+?)\\. Expected one of: none, compat","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":633,"sourceCode":"  }\n\n  return value;\n}\n\n\nexport function resolveSetupMcpModeArg(args: string[]): SetupMcpMode | undefined {\n  let value: SetupMcpMode | undefined;\n  const setValue = (next: SetupMcpMode, source: string): void => {\n    if (value && value !== next) {\n      throw new Error(\n        `Conflicting setup MCP mode flags: ${source} selects ${next}, but another flag already selected ${value}`,\n      );\n    }\n    value = next;\n  };\n  const parseValue = (next: string): SetupMcpMode => {\n    if (!SETUP_MCP_MODES.includes(next as SetupMcpMode)) {\n      throw new Error(\n        `Invalid setup MCP mode: ${next}. Expected one of: none, compat`,\n      );\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];","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L615-L651","documentation":"The MCP mode value must be one of the allowed enum values (`none` or `compat`). Any other string (from --mcp <value> or --mcp=<value>) is rejected.","triggerScenarios":"`--mcp default`, `--mcp=None` (wrong case), or an unsupported mode name.","commonSituations":"Expecting modes removed/renamed across versions; guessing mode names.","solutions":["Use `none` or `compat` exactly","Run help to list current SETUP_MCP_MODES"],"exampleFix":"# before\nomx setup --mcp default\n# after\nomx setup --mcp compat","handlingStrategy":"type-guard","validationCode":"const MCP_MODES = ['none', 'compat'];\nif (!MCP_MODES.includes(value)) throw new Error('invalid MCP mode');","typeGuard":"const isSetupMcpMode = (v: string): v is 'none' | 'compat' => v === 'none' || v === 'compat';","tryCatchPattern":null,"preventionTips":["Use exact lowercase mode names"],"tags":["cli","invalid-value","enum-validation","mcp"],"backgroundTag":"invalid-cli-flag-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}