From 35231b408efe889a900cf7f8153c4fd1159bd4fc Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Thu, 27 Aug 2026 19:39:12 -0400 Subject: [PATCH] refactor(core): use keyed MCP credential reads (#45708) --- packages/core/src/mcp/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/core/src/mcp/index.ts b/packages/core/src/mcp/index.ts index 6bc1c5b2d94..8370c80ea0d 100644 --- a/packages/core/src/mcp/index.ts +++ b/packages/core/src/mcp/index.ts @@ -273,14 +273,12 @@ export const layer = (options?: Options) => return McpOAuth.provider({ ...base, store: McpOAuth.memoryStore() }) const credentialID = found.id const methodID = found.value.methodID - const integrationID = entry.integrationID // Tracks the refresh token this provider last presented, so invalidate can tell whether the SDK // rejected the currently-stored credential or a snapshot another connection has already rotated past. let presented = found.value.refresh const readOAuthCredential = async () => { - const stored = await Effect.runPromise(credentials.list(integrationID)) - const match = stored.find((credential) => credential.id === credentialID) - return match && match.value.type === "oauth" ? match.value : undefined + const stored = await Effect.runPromise(credentials.get(credentialID)) + return stored?.value.type === "oauth" ? stored.value : undefined } return McpOAuth.provider({ ...base,