@ai-sdk/mcp 1.0.78 → 1.0.79

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