From 53f11676815c531cba279df9e15bdcd79e82251d Mon Sep 17 00:00:00 2001 From: David Kaya Date: Fri, 27 Mar 2026 20:08:40 +0100 Subject: [PATCH] feat: use GitHub Copilot client ID as default for MCP OAuth Use the well-known Copilot client ID (aebc6443-996d-45c2-90f0-388ff96faa56) when no static client config is provided and the auth server doesn't support dynamic client registration. This matches how VS Code authenticates with Entra ID-backed MCP servers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/main/services/mcpOAuthService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/services/mcpOAuthService.ts b/src/main/services/mcpOAuthService.ts index 1f07860..d2aa1e1 100644 --- a/src/main/services/mcpOAuthService.ts +++ b/src/main/services/mcpOAuthService.ts @@ -61,8 +61,13 @@ export async function performMcpOAuthFlow(options: McpOAuthFlowOptions): Promise const authServerUrl = await discoverAuthorizationServer(serverUrl); const metadata = await fetchAuthServerMetadata(authServerUrl); + // Use explicit static config, fall back to the well-known GitHub Copilot client ID, + // and only attempt dynamic registration as a last resort. + const COPILOT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56'; const clientId = staticClientConfig?.clientId - ?? await dynamicClientRegistration(metadata, serverUrl); + ?? (metadata.registration_endpoint + ? await dynamicClientRegistration(metadata, serverUrl) + : COPILOT_CLIENT_ID); const { verifier, challenge } = generatePkceChallenge(); const { port, redirectUri, waitForCallback, close } = await startCallbackServer();