Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@priyansh4320
Copy link
Collaborator

@priyansh4320 priyansh4320 commented Aug 4, 2025

Why are these changes needed?

MultiMCPSessionManager class can support both Stdio and SSE session now.

Related issue number

Closes #1975

Checks

@priyansh4320 priyansh4320 changed the title feat:[McpSessionManager] can manage SSE and Stdio session both feat:[MCPClientSessionManager] can manage SSE and Stdio session both Aug 4, 2025
@priyansh4320 priyansh4320 requested a review from marklysze August 4, 2025 23:50
Copy link
Member

@Lancetnik Lancetnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I think it could be better a bit.

if isinstance(config, StdioConfig):
    async with self.create_stdio_session(config) as session:
        yield session
elif isinstance(config, SseConfig):
    async with self.create_sse_session(config) as session:
        yield session

This code looks not scalable. I suggest to move create_session method to StdioConfig and SseConfig and hide them by the same interface. MCPClient should return just an interface call result this way

@asynccontextmanager
async def open_session(
    self,
    config: SessionConfigProtocol,
) -> AsyncIterator[ClientSession]:
    async with config.create_session(self.exit_stack) as session:
        yield session

@priyansh4320 priyansh4320 self-assigned this Aug 6, 2025
@priyansh4320 priyansh4320 force-pushed the 1975-feature-request-add-sse-transport-support-in-mcpclientsessionmanager branch from 9f51b68 to e30e4c0 Compare August 6, 2025 17:14
@Lancetnik
Copy link
Member

Lancetnik commented Aug 6, 2025

@marklysze hi! The code looks fine, but can you help me with tests a bit? I am not familiar enought with your testing practice yet

@Lancetnik Lancetnik enabled auto-merge August 7, 2025 22:10
@Lancetnik Lancetnik added this pull request to the merge queue Aug 7, 2025
Merged via the queue into main with commit b213417 Aug 7, 2025
17 checks passed
@Lancetnik Lancetnik deleted the 1975-feature-request-add-sse-transport-support-in-mcpclientsessionmanager branch August 7, 2025 22:24
@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
autogen/mcp/mcp_client.py 90.90% 4 Missing ⚠️
Files with missing lines Coverage Δ
autogen/mcp/mcp_client.py 79.47% <90.90%> (+2.02%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add sse transport support in MCPClientSessionManager

3 participants