Skip to content

How to allow ClientSessionGroup to pass additional parameters to ClientSession (_establish_session method)? #1291

@raychen911

Description

@raychen911

Initial Checks

Description

session_group

When I use ClientSessionGroup, I expect mcp.ClientSession to support the elicitation_callback parameter. However, I found that there is no way to pass this parameter through the initialization of ClientSessionGroup.

Example Code

async def _establish_session(
        self, server_params: ServerParameters
    ) -> tuple[types.Implementation, mcp.ClientSession]:
        """Establish a client session to an MCP server."""

        
            # This does not allow passing other arguments supported by ClientSession, such as: elicitation_callback
            await self._exit_stack.enter_async_context(session_stack)
            # ...

Python & MCP Python SDK

1.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Broken core functionality, security issues, critical missing featurebugSomething isn't workingready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions