@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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/mcp
2
2
 
3
+ ## 2.0.44
4
+
5
+ ### Patch Changes
6
+
7
+ - 809e922: fix(mcp): accept trailing slashes on origin-only OAuth issuers
8
+
3
9
  ## 2.0.43
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -840,7 +840,8 @@ function buildDiscoveryUrls(authorizationServerUrl) {
840
840
  return urlsToTry;
841
841
  }
842
842
  function assertMetadataIssuerMatches(metadata, expectedIssuer) {
843
- if (metadata.issuer !== expectedIssuer) {
843
+ const issuerMatches = metadata.issuer === expectedIssuer || expectedIssuer === new URL(expectedIssuer).origin && metadata.issuer === `${expectedIssuer}/`;
844
+ if (!issuerMatches) {
844
845
  throw new MCPClientOAuthError({
845
846
  message: `OAuth authorization server metadata issuer ${metadata.issuer} does not match expected issuer ${expectedIssuer}`
846
847
  });