@ai-sdk/mcp 2.0.43 → 2.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/mcp",
3
- "version": "2.0.43",
3
+ "version": "2.0.44",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
package/src/tool/oauth.ts CHANGED
@@ -607,7 +607,12 @@ function assertMetadataIssuerMatches(
607
607
  metadata: AuthorizationServerMetadata,
608
608
  expectedIssuer: string,
609
609
  ): void {
610
- if (metadata.issuer !== expectedIssuer) {
610
+ const issuerMatches =
611
+ metadata.issuer === expectedIssuer ||
612
+ (expectedIssuer === new URL(expectedIssuer).origin &&
613
+ metadata.issuer === `${expectedIssuer}/`);
614
+
615
+ if (!issuerMatches) {
611
616
  throw new MCPClientOAuthError({
612
617
  message: `OAuth authorization server metadata issuer ${metadata.issuer} does not match expected issuer ${expectedIssuer}`,
613
618
  });