{"record":{"id":"765be05f744c9c5b","repo":"affaan-m/ECC","slug":"mcp-servers-legacyname-is-a-legacy-name-for-n","errorCode":null,"errorMessage":"mcp_servers.${legacyName} is a legacy name for ${name} (run with --update-mcp to migrate)","messagePattern":"mcp_servers\\.(.+?) is a legacy name for (.+?) \\(run with --update-mcp to migrate\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/codex/merge-mcp-config.js","lineNumber":300,"sourceCode":"    }\n\n    if (finalEntry) {\n      if (updateMcp) {\n        // --update-mcp: remove existing section (and legacy alias), will re-add below\n        toRemoveLog.push(`mcp_servers.${resolvedLabel}`);\n        raw = removeServerFromText(raw, resolvedLabel, existing);\n        if (resolvedLabel !== name) {\n          raw = removeServerFromText(raw, name, existing);\n        }\n        if (legacyName && hasCanonical) {\n          toRemoveLog.push(`mcp_servers.${legacyName}`);\n          raw = removeServerFromText(raw, legacyName, existing);\n        }\n        toAppend.push(spec.toml);\n      } else {\n        // Add-only mode: skip, but warn about drift\n        if (legacyName && !hasCanonical) {\n          warn(`mcp_servers.${legacyName} is a legacy name for ${name} (run with --update-mcp to migrate)`);\n        } else if (configDiffers(finalEntry, spec.fields)) {\n          warn(`mcp_servers.${name} differs from ECC recommendation (run with --update-mcp to refresh)`);\n        } else {\n          log(`  [ok] mcp_servers.${name}`);\n        }\n      }\n    } else {\n      log(`  [add] mcp_servers.${name}`);\n      toAppend.push(spec.toml);\n    }\n  }\n\n  const hasRemovals = toRemoveLog.length > 0;\n\n  if (toAppend.length === 0 && !hasRemovals) {\n    log('All ECC MCP servers already present. Nothing to do.');\n    return;\n  }","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/codex/merge-mcp-config.js#L282-L318","documentation":"Advisory message from merge-mcp-config: the user's config contains an MCP server section under a legacy alias name instead of the canonical name. Without --update-mcp the script will not rewrite it; re-run with --update-mcp to migrate the section to the current name.","triggerScenarios":"Thrown at scripts/codex/merge-mcp-config.js:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the merge with --update-mcp to rename the legacy mcp_servers entry to the new name.","Manually rename the key in the config if a one-off fix is preferred."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}