# create_toolkit

## `autogen.mcp.create_toolkit`async

```
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: Toolkit: The toolkit containing the converted tools.

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

|     |     |
|-----|-----|
| ``` | ``` |
| <br>172<br>173<br>174<br>175<br>176<br>177<br>178<br>179<br>180<br>181<br>182<br>183<br>184<br>185<br>186<br>187<br>188<br>189<br>190<br>191<br>192<br>193<br>194<br>195<br>196<br>197<br>198<br>199<br>200<br>``` | `@export_module("autogen.mcp")
async def create_toolkit(
    session: "ClientSession",
    *,
    use_mcp_tools: bool = True,
    use_mcp_resources: bool = True,
    resource_download_folder: Optional[Union[Path, str]] = 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:
        if isinstance(resource_download_folder, str):
            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,
    )
``` |
