Skip to content

Conversation

gabedemesa
Copy link

@gabedemesa gabedemesa commented Sep 16, 2025

Add graceful connection error handling to MultiServerMCPClient 🚀

This PR introduces a new handleConnectionErrorsGracefully parameter to the MultiServerMCPClient that allows applications to continue working even when some MCP servers fail to connect. When enabled, the client will skip servers that fail to connect instead of throwing an error, providing better resilience in production environments.

Features

New Configuration Parameter

  • handleConnectionErrorsGracefully: boolean (default: false)
    • When true: Skip servers that fail to connect and continue with successful connections
    • When false: Maintain original behavior (throw on any connection failure)
    • Fully backward compatible - existing code continues to work unchanged

Usage

  const client = new MultiServerMCPClient({
    handleConnectionErrorsGracefully: true, // Skip failed connections
    // etc ...
  });

Copy link

changeset-bot bot commented Sep 16, 2025

🦋 Changeset detected

Latest commit: 605c9dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/mcp-adapters Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
langchainjs-docs Ready Ready Preview Sep 18, 2025 5:02pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchainjs-api-refs Ignored Ignored Sep 18, 2025 5:02pm

@gabedemesa gabedemesa changed the title add new handleConnectionErrorsGracefully parameter to MultiServerMCPC… feat(langchain-mcp-adapters): gracefully handle connection errors Sep 16, 2025
@gabedemesa gabedemesa marked this pull request as draft September 16, 2025 06:34
@gabedemesa gabedemesa force-pushed the gabedemesa/handle-connection-errors-gracefully branch from ae50fbe to 84650bb Compare September 16, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants