From d3842e606de3fff5ed5678273db6f3ed08528875 Mon Sep 17 00:00:00 2001 From: Ayush Thakur Date: Tue, 31 Mar 2026 19:59:38 +0530 Subject: [PATCH] fix(mcp): finishAuth returns disabled instead of connected after OAuth After successful OAuth, finishAuth called createAndStore with the raw config which may have enabled=false (e.g. server was previously disconnected). This caused create() to short-circuit and return status disabled instead of reconnecting. Pass { ...mcpConfig, enabled: true } to match what connect() already does. Fixes #20278 --- packages/opencode/src/mcp/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts index e3bf4cac0688..b463a4105bcc 100644 --- a/packages/opencode/src/mcp/index.ts +++ b/packages/opencode/src/mcp/index.ts @@ -821,7 +821,7 @@ export namespace MCP { const mcpConfig = yield* getMcpConfig(mcpName) if (!mcpConfig) return { status: "failed", error: "MCP config not found after auth" } as Status - return yield* createAndStore(mcpName, mcpConfig) + return yield* createAndStore(mcpName, { ...mcpConfig, enabled: true }) }) const removeAuth = Effect.fn("MCP.removeAuth")(function* (mcpName: string) {