Skip to content

feat: Load multiple sse servers on runtime #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rohitdutt-04
Copy link

@rohitdutt-04 rohitdutt-04 commented Apr 16, 2025

Added support for loading and managing multiple SSE servers at runtime through the introduction of McpServer and McpSsseServerLoader classes.

Motivation and Context

This change enables the MCP client to connect to multiple SSE servers simultaneously at runtime. It provides a more flexible and dynamic way to manage server connections, allowing applications to:

  • Define server configurations with custom headers
  • Initialize multiple server connections dynamically
  • Handle connection failures gracefully for individual servers
  • Maintain a list of successfully connected clients

How Has This Been Tested?

The implementation includes error handling and validation for:

  • Empty server lists
  • Missing or invalid server URLs
  • Connection failures
  • Server initialization errors

Breaking Changes

No breaking changes. This is an additive feature that enhances the existing functionality without modifying the current behavior.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • The McpServer class is designed to be extensible, allowing for additional server configuration properties in the future
  • The loader implements a fail-soft approach where failure to connect to one server doesn't prevent attempts to connect to others
  • Server connections are initialized sequentially to maintain better control and error tracking

Future Plans

This implementation lays the groundwork for several planned enhancements:

  • STDIO Server Support: Adding support for STDIO-based servers.

@rohitdutt-04 rohitdutt-04 changed the title Load multiple sse servers on runtime Feat: Load multiple sse servers on runtime Apr 16, 2025
@rohitdutt-04 rohitdutt-04 changed the title Feat: Load multiple sse servers on runtime feat: Load multiple sse servers on runtime Apr 16, 2025
@rohitdutt-04
Copy link
Author

@edwardcapriolo @tzolov Can you please review. We have ongoing MCP integration with our current Agentic framework.

@edwardcapriolo
Copy link

@edwardcapriolo @tzolov Can you please review. We have ongoing MCP integration with our current Agentic framework.

I am not a project maintainer, I tried to get involved about a week ago. I have rebased my own PR multiple times. Tried to get involved with the community. No one seems to answer. Good luck.

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