@mcp-use/client 2.4.2 → 2.4.3

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.
@@ -1883,7 +1883,7 @@ var HttpConnector = class extends BaseConnector {
1883
1883
  };
1884
1884
 
1885
1885
  // src/utils/version.ts
1886
- var VERSION = "2.4.2";
1886
+ var VERSION = "2.4.3";
1887
1887
  function getPackageVersion() {
1888
1888
  return VERSION;
1889
1889
  }
@@ -3472,7 +3472,8 @@ init_logging();
3472
3472
  var MCPConnection = class {
3473
3473
  /**
3474
3474
  * The underlying connector managing the transport layer.
3475
- * This is the Stdio, HTTP, or WebSocket connector handling actual communication.
3475
+ * This is the stdio or HTTP connector for a server, or the in-process
3476
+ * connector that backs code mode.
3476
3477
  */
3477
3478
  connector;
3478
3479
  /**
@@ -3483,12 +3484,12 @@ var MCPConnection = class {
3483
3484
  /**
3484
3485
  * Creates a new MCP session.
3485
3486
  *
3486
- * @param connector - The connector to use for communication (Stdio, HTTP, WebSocket)
3487
+ * @param connector - The connector to use for communication (stdio, HTTP, or code mode)
3487
3488
  * @param autoConnect - Whether to automatically connect during initialization (default: true)
3488
3489
  *
3489
3490
  * @example
3490
3491
  * ```typescript
3491
- * const connector = new HttpConnector({ url: 'http://localhost:3000/mcp' });
3492
+ * const connector = new HttpConnector('http://localhost:3000/mcp');
3492
3493
  * const session = new MCPSession(connector);
3493
3494
  * await session.initialize(); // Auto-connects and initializes
3494
3495
  * ```
@@ -3508,9 +3509,11 @@ var MCPConnection = class {
3508
3509
  /**
3509
3510
  * Establishes the connection to the MCP server.
3510
3511
  *
3511
- * This method starts the underlying transport (spawns process for Stdio,
3512
- * opens WebSocket, etc.) but does not perform the MCP initialization
3513
- * handshake. Call {@link initialize} after connecting.
3512
+ * For stdio and HTTP connectors, this method starts the underlying
3513
+ * transport (spawns the process for stdio, opens the HTTP transport) and
3514
+ * performs the MCP initialization handshake through the SDK client. Call
3515
+ * {@link initialize} afterwards to cache the server's capabilities, server
3516
+ * info, and tools.
3514
3517
  *
3515
3518
  * @returns Promise that resolves when connected
3516
3519
  *
@@ -3548,9 +3551,10 @@ var MCPConnection = class {
3548
3551
  /**
3549
3552
  * Initializes the MCP session with the server.
3550
3553
  *
3551
- * This method performs the MCP initialization handshake, exchanging
3552
- * capabilities and metadata with the server. If `autoConnect` is true
3553
- * and the session is not yet connected, it will connect first.
3554
+ * This method caches the capabilities, server info, and tools negotiated
3555
+ * during {@link connect}. If `autoConnect` is true and the session is not
3556
+ * yet connected, it connects first, which performs the MCP initialization
3557
+ * handshake.
3554
3558
  *
3555
3559
  * After initialization, you can list and call tools, read resources, etc.
3556
3560
  *
@@ -4192,7 +4196,7 @@ var BaseMCPClient = class {
4192
4196
  *
4193
4197
  * @param serverName - The name of the server as defined in the client configuration
4194
4198
  * @param autoInitialize - Whether to automatically initialize the session (default: true)
4195
- * @returns A promise that resolves to the created MCPSession instance
4199
+ * @returns A promise that resolves to the created MCPConnection instance (also exported as MCPSession).
4196
4200
  * @throws If the server is not found in the configuration
4197
4201
  *
4198
4202
  * @example
@@ -4287,6 +4291,7 @@ var BaseMCPClient = class {
4287
4291
  * the negotiated protocol version and normalized server metadata.
4288
4292
  *
4289
4293
  * @param serverName - The configured server name.
4294
+ * @returns A ready MCPConnection for calling tools and accessing server resources.
4290
4295
  */
4291
4296
  async connect(serverName) {
4292
4297
  return this.createSession(serverName);