fix(setup): register OpenCode V2 configurations in mcp.servers

OpenCode V2 reads native server entries from mcp.servers, and a native
entry takes precedence over a V1 mcp.<name> entry. After OpenCode
migrated a configuration, setup wrote an ignored V1 entry, status
reported REA as missing, and uninstall left the native entry in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iwakurakaoru0822andClaude Opus 5.5 committed 2026-10-06 21:58:20 -07:00
1 parent 4a6c17ce83
commit 69d8afefc1
8 files changed
+386 -93

No files matched your search

+6 -3
View File
@@ -5,7 +5,10 @@ import { z } from "zod";
import { PRODUCT_IDENTITY } from "../identity.js";
import { isOwnedClientRegistrationCommand } from "./ClientRegistrationIdentity.js";
import { readClientRegistrationStatuses } from "./ClientRegistrationStatus.js";
import { parseClientConfiguration } from "./ClientConfigurationDocument.js";
import {
effectiveClientServer,
parseClientConfiguration,
} from "./ClientConfigurationDocument.js";
import { supportedClients } from "./SupportedClients.js";
import type { SetupAction } from "./SetupTypes.js";
import type { Result } from "../domain/result.js";
@@ -60,7 +63,7 @@ export const existingMaintenanceScope = async (
continue;
const client = supported.find(({ name }) => name === registration.client);
if (client === undefined) continue;
const { servers } = parseClientConfiguration(
const parsed = parseClientConfiguration(
await readFile(client.configPath, "utf8"),
client.format,
);
@@ -69,7 +72,7 @@ export const existingMaintenanceScope = async (
enabled: z.boolean().optional(),
disabled: z.boolean().optional(),
})
.parse(servers[PRODUCT_IDENTITY.mcpServerKey]);
.parse(effectiveClientServer(parsed, PRODUCT_IDENTITY.mcpServerKey));
if (enabled.enabled !== false && enabled.disabled !== true)
clients.push(client.name);
}