From 2c07dc0757867a138b3832d781457ecf5d9afcf7 Mon Sep 17 00:00:00 2001 From: Brian Ray <62354532+emeryray2002@users.noreply.github.com> Date: Fri, 15 Aug 2025 15:14:48 -0400 Subject: fixes for oauth spec - adds github oauth support. Resource paramater. (#6281) --- packages/core/src/tools/mcp-client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'packages/core/src/tools') diff --git a/packages/core/src/tools/mcp-client.ts b/packages/core/src/tools/mcp-client.ts index 83bc4024..837b91fc 100644 --- a/packages/core/src/tools/mcp-client.ts +++ b/packages/core/src/tools/mcp-client.ts @@ -227,10 +227,16 @@ async function handleAutomaticOAuth( }; // Perform OAuth authentication + // Pass the server URL for proper discovery + const serverUrl = mcpServerConfig.httpUrl || mcpServerConfig.url; console.log( `Starting OAuth authentication for server '${mcpServerName}'...`, ); - await MCPOAuthProvider.authenticate(mcpServerName, oauthAuthConfig); + await MCPOAuthProvider.authenticate( + mcpServerName, + oauthAuthConfig, + serverUrl, + ); console.log( `OAuth authentication successful for server '${mcpServerName}'`, @@ -933,12 +939,15 @@ export async function connectToMcpServer( }; // Perform OAuth authentication + // Pass the server URL for proper discovery + const serverUrl = mcpServerConfig.httpUrl || mcpServerConfig.url; console.log( `Starting OAuth authentication for server '${mcpServerName}'...`, ); await MCPOAuthProvider.authenticate( mcpServerName, oauthAuthConfig, + serverUrl, ); // Retry connection with OAuth token -- cgit v1.2.3