Skip to content

Commit c292be1

Browse files
VJ-yadavVijay Yadav
andcommitted
fix: accept mcpServers as alias for mcp in config
When AI tools (Claude Code, Copilot) generate altimate-code config, they write `mcpServers` instead of `mcp`. This causes a startup error: "Unrecognized key: mcpServers". Add normalization during config loading that renames `mcpServers` to `mcp` before schema validation, matching the existing pattern for legacy key migration (theme, keybinds, tui). Fixes AltimateAI#619 Co-Authored-By: Vijay Yadav <[email protected]>
1 parent 0d34855 commit c292be1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎packages/opencode/src/config/config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,12 @@ export namespace Config {
13631363
const normalized = (() => {
13641364
if (!data || typeof data !== "object" || Array.isArray(data)) return data
13651365
const copy = { ...(data as Record<string, unknown>) }
1366+
// Alias mcpServers → mcp (Claude Code / Copilot format compatibility)
1367+
if ("mcpServers" in copy && !("mcp" in copy)) {
1368+
copy.mcp = copy.mcpServers
1369+
delete copy.mcpServers
1370+
log.info("aliased mcpServers to mcp in config", { path: source })
1371+
}
13661372
const hadLegacy = "theme" in copy || "keybinds" in copy || "tui" in copy
13671373
if (!hadLegacy) return copy
13681374
delete copy.theme

0 commit comments

Comments
 (0)