@mcp-use/client 2.2.2 → 2.2.3-canary.1

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.
@@ -128,7 +128,7 @@ var Logger = class {
128
128
  var logger = Logger.get();
129
129
 
130
130
  // src/utils/version.ts
131
- var VERSION = "2.2.2";
131
+ var VERSION = "2.2.3-canary.1";
132
132
  function getPackageVersion() {
133
133
  return VERSION;
134
134
  }
@@ -2623,7 +2623,8 @@ var BaseConnector = class {
2623
2623
  * @returns Complete list of all resources
2624
2624
  */
2625
2625
  async listAllResources(options) {
2626
- if (!this.client) {
2626
+ const client = this.client;
2627
+ if (!client) {
2627
2628
  throw new Error("MCP client is not connected");
2628
2629
  }
2629
2630
  if (!this.capabilitiesCache?.resources) {
@@ -2636,7 +2637,7 @@ var BaseConnector = class {
2636
2637
  const allResources = [];
2637
2638
  let cursor = void 0;
2638
2639
  do {
2639
- const result = await this.client.listResources({ cursor }, options);
2640
+ const result = await client.listResources({ cursor }, options);
2640
2641
  allResources.push(...result.resources || []);
2641
2642
  cursor = result.nextCursor;
2642
2643
  } while (cursor);
@@ -2989,6 +2990,9 @@ var HttpConnector = class extends BaseConnector {
2989
2990
  throw error;
2990
2991
  }
2991
2992
  await this.completeInteractiveAuthorization();
2993
+ if (!this.connected || !this.client) {
2994
+ throw new Error("MCP client is not connected");
2995
+ }
2992
2996
  return operation();
2993
2997
  }
2994
2998
  }