@mastra/mcp 0.14.2 → 0.14.3-alpha.0

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
@@ -366,6 +366,7 @@ var ResourceClientActions = class {
366
366
  };
367
367
 
368
368
  // src/client/client.ts
369
+ var DEFAULT_SERVER_CONNECT_TIMEOUT_MSEC = 3e3;
369
370
  function convertLogLevelToLoggerMethod(level) {
370
371
  switch (level) {
371
372
  case "debug":
@@ -483,7 +484,7 @@ var InternalMastraMCPClient = class extends MastraBase {
483
484
  }
484
485
  }
485
486
  async connectHttp(url) {
486
- const { requestInit, eventSourceInit, authProvider } = this.serverConfig;
487
+ const { requestInit, eventSourceInit, authProvider, connectTimeout } = this.serverConfig;
487
488
  this.log("debug", `Attempting to connect to URL: ${url}`);
488
489
  let shouldTrySSE = url.pathname.endsWith(`/sse`);
489
490
  if (!shouldTrySSE) {
@@ -495,10 +496,7 @@ var InternalMastraMCPClient = class extends MastraBase {
495
496
  authProvider
496
497
  });
497
498
  await this.client.connect(streamableTransport, {
498
- timeout: (
499
- // this is hardcoded to 3s because the long default timeout would be extremely slow for sse backwards compat (60s)
500
- 3e3
501
- )
499
+ timeout: connectTimeout ?? DEFAULT_SERVER_CONNECT_TIMEOUT_MSEC
502
500
  });
503
501
  this.transport = streamableTransport;
504
502
  this.log("debug", "Successfully connected using Streamable HTTP transport.");