Complete reference documentation for BaseMCPManager class
BaseMCPManager
is the foundational class for creating MCP (Model Context Protocol) servers in the scmcphub ecosystem. It provides a standardized way to manage and organize multiple MCP modules, with built-in filtering capabilities for both modules and tools.
BaseMCPManager
serves as an abstract base class that handles:
__init__(name, instructions=None, include_modules=None, exclude_modules=None, include_tools=None, exclude_tools=None, include_tags=None, exclude_tags=None, backend=None)
Parameter | Type | Default | Description |
---|---|---|---|
name | str | Required | Name of the MCP server |
instructions | Optional[str] | None | Instructions for the MCP server |
include_modules | Optional[List[str]] | None | List of module names to include. If None , all modules are included |
exclude_modules | Optional[List[str]] | None | List of module names to exclude. If None , no modules are excluded |
include_tools | Optional[List[str]] | None | Dictionary mapping module names to lists of tool names to include |
exclude_tools | Optional[List[str]] | None | Dictionary mapping module names to lists of tool names to exclude |
include_tags | Optional[List[str]] | None | List of tags to include |
exclude_tags | Optional[List[str]] | None | List of tags to exclude |
backend | Optional[NotebookManager] | None | Backend manager class (e.g., AdataManager , NotebookManager ) |
Attribute | Type | Description |
---|---|---|
exec_backend | NotebookManager | Backend instance for execution |
mcp | FastMCP | The main FastMCP instance |
include_modules | Optional[List[str]] | Modules to include |
exclude_modules | Optional[List[str]] | Modules to exclude |
include_tools | Optional[List[str]] | Tools to include per module |
exclude_tools | Optional[List[str]] | Tools to exclude per module |
available_modules | Dict[str, Any] | Dictionary of available modules |
init_mcp()
available_modules
dictionary with module instances.
register_mcp()
exec_lifespan(server)
io
- Input/Output operationspp
- Preprocessingtl
- Toolspl
- Plottingul
- Utilitiesauto
- Auto-completion toolsnb
- Notebook integrationAdataManager
- For AnnData-based operations/tool-modeNotebookManager
- For notebook-based execution/code-modeinclude_modules
when you want to limit to specific modulesexclude_modules
when you want to exclude specific modules from a larger setinclude_tools
for fine-grained control over which tools are availableexclude_tools
to remove specific tools from modules