# create_toolkit

## `autogen.mcp.create_toolkit` async

```python
create_toolkit(session, *, use_mcp_tools=True, use_mcp_resources=True, resource_download_folder=None)
```

Create a toolkit from the MCP client session.

| PARAMETER                  | DESCRIPTION                                                                                          |
|----------------------------|------------------------------------------------------------------------------------------------------|
| `session`                  | The MCP client session.<br>**TYPE:** `ClientSession`                                               |
| `use_mcp_tools`           | Whether to include MCP tools in the toolkit.<br>**TYPE:** `bool` **DEFAULT:** `True`               |
| `use_mcp_resources`       | Whether to include MCP resources in the toolkit.<br>**TYPE:** `bool` **DEFAULT:** `True`           |
| `resource_download_folder` | The folder to download files to.<br>**TYPE:** `Optional[Union[Path, str]]` **DEFAULT:** `None`    |

| RETURNS   | DESCRIPTION                                                             |
|-----------|-------------------------------------------------------------------------|
| `Toolkit` | The toolkit containing the converted tools.<br>**TYPE:** `Toolkit`      |

Source code in `autogen/mcp/mcp_client.py`

|     |     |
|-----|-----|
| --- | --- |
| ``` | ``` |
|     | @export_module("autogen.mcp")
async def create_toolkit(
    session: "ClientSession",
    *,
    use_mcp_tools: bool = True,
    use_mcp_resources: bool = True,
    resource_download_folder: Path | str | None = None,
) -> Toolkit:  # type: ignore[no-any-unimported]
    """Create a toolkit from the MCP client session.
    Args:
        session (ClientSession): The MCP client session.
        use_mcp_tools (bool): Whether to include MCP tools in the toolkit.
        use_mcp_resources (bool): Whether to include MCP resources in the toolkit.
        resource_download_folder (Optional[Union[Path, str]]): The folder to download files to.
    Returns:
        Toolkit: The toolkit containing the converted tools.
    """
    if resource_download_folder is not None:
        resource_download_folder = Path(resource_download_folder)
        await anyio.to_thread.run_sync(lambda: resource_download_folder.mkdir(parents=True, exist_ok=True))
    return await MCPClient.load_mcp_toolkit(
        session=session,
        use_mcp_tools=use_mcp_tools,
        use_mcp_resources=use_mcp_resources,
        resource_download_folder=resource_download_folder,
    )
```
