Skip to content

create_toolkit

autogen.mcp.create_toolkit async #

create_toolkit(session)

Create a toolkit from the MCP client session.

PARAMETER DESCRIPTION
session

The MCP client session.

TYPE: ClientSession

Returns: Toolkit: The toolkit containing the converted tools.

Source code in autogen/mcp/mcp_client.py
@export_module("autogen.mcp")
async def create_toolkit(session: "ClientSession") -> Toolkit:  # type: ignore[no-any-unimported]
    """Create a toolkit from the MCP client session.

    Args:
        session (ClientSession): The MCP client session.
    Returns:
        Toolkit: The toolkit containing the converted tools.
    """

    return await MCPClient.load_mcp_toolkit(session=session)