Skip to content

refactor: add mcp client session manager #141

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

Closed
wants to merge 3 commits into from

Conversation

calmini
Copy link
Contributor

@calmini calmini commented May 7, 2025

Overview

The MCP Client Session Manager is a dedicated component that was separated from the MCPRouter to handle all client session-related operations, so that router will delegate mcp server updating to session manager.

Key Responsibilities

1, maintain client session for mcp servers that could be shared over multiple profiles
2. provide add/remove/update methods to manipulate mcp servers updating
3. provide api to retrieve tool/prompt/resource through server_id parameter and hide the complicated mapping structure

a basic operation for router to call mcp request works as below

conn = client_session_manager.get_session(server_id)
if conn and conn.session:
    result = await conn.session.call_tool(tool.name, req.params.arguments or {})

@calmini calmini closed this May 9, 2025
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.

1 participant