@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.
package/dist/index.js CHANGED
@@ -934,7 +934,8 @@ var init_base = __esm({
934
934
  * @returns Complete list of all resources
935
935
  */
936
936
  async listAllResources(options) {
937
- if (!this.client) {
937
+ const client = this.client;
938
+ if (!client) {
938
939
  throw new Error("MCP client is not connected");
939
940
  }
940
941
  if (!this.capabilitiesCache?.resources) {
@@ -947,7 +948,7 @@ var init_base = __esm({
947
948
  const allResources = [];
948
949
  let cursor = void 0;
949
950
  do {
950
- const result = await this.client.listResources({ cursor }, options);
951
+ const result = await client.listResources({ cursor }, options);
951
952
  allResources.push(...result.resources || []);
952
953
  cursor = result.nextCursor;
953
954
  } while (cursor);
@@ -1526,7 +1527,7 @@ init_connector_telemetry();
1526
1527
  init_logging();
1527
1528
 
1528
1529
  // src/utils/version.ts
1529
- var VERSION = "2.2.2";
1530
+ var VERSION = "2.2.3-canary.1";
1530
1531
  function getPackageVersion() {
1531
1532
  return VERSION;
1532
1533
  }
@@ -3101,6 +3102,9 @@ var HttpConnector = class extends BaseConnector {
3101
3102
  throw error;
3102
3103
  }
3103
3104
  await this.completeInteractiveAuthorization();
3105
+ if (!this.connected || !this.client) {
3106
+ throw new Error("MCP client is not connected");
3107
+ }
3104
3108
  return operation();
3105
3109
  }
3106
3110
  }