@mcp-use/client 2.0.0-beta.6 → 2.0.0-beta.8
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/dist/.tsbuildinfo +1 -1
- package/dist/auth/browser.d.ts +2 -0
- package/dist/auth/browser.d.ts.map +1 -1
- package/dist/auth/session-store.d.ts +5 -0
- package/dist/auth/session-store.d.ts.map +1 -1
- package/dist/index-browser.js +13 -1
- package/dist/index-browser.js.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +20 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/types.d.ts +2 -0
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/useMcp-operations.d.ts.map +1 -1
- package/dist/react/useMcp.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1473,7 +1473,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
1473
1473
|
};
|
|
1474
1474
|
|
|
1475
1475
|
// src/utils/version.ts
|
|
1476
|
-
var VERSION = "2.0.0-beta.
|
|
1476
|
+
var VERSION = "2.0.0-beta.7";
|
|
1477
1477
|
function getPackageVersion() {
|
|
1478
1478
|
return VERSION;
|
|
1479
1479
|
}
|
|
@@ -1849,6 +1849,14 @@ var OAuthSessionStore = class _OAuthSessionStore {
|
|
|
1849
1849
|
async getTokenEndpoint() {
|
|
1850
1850
|
return (await this.discoveryState())?.authorizationServerMetadata?.token_endpoint ?? null;
|
|
1851
1851
|
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Return the protected-resource URL selected during OAuth discovery.
|
|
1854
|
+
* Consumers can persist it and reuse it for server-side refresh exchanges.
|
|
1855
|
+
*/
|
|
1856
|
+
async getResource() {
|
|
1857
|
+
const resource = (await this.discoveryState())?.resourceMetadata?.resource;
|
|
1858
|
+
return typeof resource === "string" ? resource : null;
|
|
1859
|
+
}
|
|
1852
1860
|
};
|
|
1853
1861
|
|
|
1854
1862
|
// src/auth/browser.ts
|
|
@@ -2113,6 +2121,10 @@ var BrowserOAuthClientProvider = class {
|
|
|
2113
2121
|
getTokenEndpoint() {
|
|
2114
2122
|
return this.session.getTokenEndpoint();
|
|
2115
2123
|
}
|
|
2124
|
+
/** Return the protected-resource URL selected during OAuth discovery. */
|
|
2125
|
+
getResource() {
|
|
2126
|
+
return this.session.getResource();
|
|
2127
|
+
}
|
|
2116
2128
|
/**
|
|
2117
2129
|
* Return the stored public OAuth client ID. Browser providers do not retain
|
|
2118
2130
|
* client secrets.
|
|
@@ -4925,12 +4937,18 @@ function useMcp(options) {
|
|
|
4925
4937
|
if (tokens?.access_token) {
|
|
4926
4938
|
const expiresAt = tokens.expires_in ? Date.now() + tokens.expires_in * 1e3 : void 0;
|
|
4927
4939
|
let tokenEndpoint = null;
|
|
4940
|
+
let resource = null;
|
|
4928
4941
|
let clientCreds = null;
|
|
4929
4942
|
try {
|
|
4930
4943
|
tokenEndpoint = await authProviderRef.current.getTokenEndpoint?.() ?? null;
|
|
4931
4944
|
} catch {
|
|
4932
4945
|
tokenEndpoint = null;
|
|
4933
4946
|
}
|
|
4947
|
+
try {
|
|
4948
|
+
resource = await authProviderRef.current.getResource?.() ?? null;
|
|
4949
|
+
} catch {
|
|
4950
|
+
resource = null;
|
|
4951
|
+
}
|
|
4934
4952
|
try {
|
|
4935
4953
|
clientCreds = await authProviderRef.current.getClientCredentials?.() ?? null;
|
|
4936
4954
|
} catch {
|
|
@@ -4947,6 +4965,7 @@ function useMcp(options) {
|
|
|
4947
4965
|
refresh_token: tokens.refresh_token,
|
|
4948
4966
|
scope: tokens.scope,
|
|
4949
4967
|
...tokenEndpoint ? { token_endpoint: tokenEndpoint } : {},
|
|
4968
|
+
...resource ? { resource } : {},
|
|
4950
4969
|
...clientCreds?.client_id ? { client_id: clientCreds.client_id } : {},
|
|
4951
4970
|
...clientCreds?.client_secret ? { client_secret: clientCreds.client_secret } : {}
|
|
4952
4971
|
});
|