summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/mcp-client.ts
diff options
context:
space:
mode:
authorBrian Ray <[email protected]>2025-08-15 15:14:48 -0400
committerGitHub <[email protected]>2025-08-15 19:14:48 +0000
commit2c07dc0757867a138b3832d781457ecf5d9afcf7 (patch)
tree1d46ae2cfae9105c4efe18752dec62ca35fa27fc /packages/core/src/tools/mcp-client.ts
parent01b8a7565cb419f906817507f6e788e14d6f8aae (diff)
fixes for oauth spec - adds github oauth support. Resource paramater. (#6281)
Diffstat (limited to 'packages/core/src/tools/mcp-client.ts')
-rw-r--r--packages/core/src/tools/mcp-client.ts11
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