diff options
Diffstat (limited to 'packages/core/src/tools/mcp-client.ts')
| -rw-r--r-- | packages/core/src/tools/mcp-client.ts | 11 |
1 files changed, 10 insertions, 1 deletions
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 |
