mindroot.coreplugins.mcp_ package¶
Submodules¶
mindroot.coreplugins.mcp_.catalog_commands module¶
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_add_custom(server_info: Dict[str, Any], context=None)[source]¶
Add a custom server to the catalog
Example: { “mcp_catalog_add_custom”: {
- “server_info”: {
“name”: “my_server”, “display_name”: “My Custom Server”, “description”: “Custom MCP server”, “command”: “python”, “args”: [“-m”, “my_mcp_server”], “category”: “custom”, “install_method”: “manual”
}
}}
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_categories(context=None)[source]¶
Get list of server categories
Example: { “mcp_catalog_categories”: {} }
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_info(server_name: str, context=None)[source]¶
Get detailed info about a catalog server
Example: { “mcp_catalog_info”: { “server_name”: “calculator” } }
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_install(server_name: str, context=None)[source]¶
Install an MCP server from catalog
Example: { “mcp_catalog_install”: { “server_name”: “calculator” } }
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_install_and_run(server_name: str, context=None)[source]¶
Install and run an MCP server from catalog
Example: { “mcp_catalog_install_and_run”: { “server_name”: “calculator” } }
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_list(category: str = None, context=None)[source]¶
List MCP servers from catalog
Example: { “mcp_catalog_list”: {} } { “mcp_catalog_list”: { “category”: “utilities” } }
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_refresh(context=None)[source]¶
Refresh catalog and update server status
Example: { “mcp_catalog_refresh”: {} }
- async mindroot.coreplugins.mcp_.catalog_commands.mcp_catalog_search(query: str, context=None)[source]¶
Search MCP servers in catalog
Example: { “mcp_catalog_search”: { “query”: “calculator” } } { “mcp_catalog_search”: { “query”: “database” } }
mindroot.coreplugins.mcp_.catalog_manager module¶
- class mindroot.coreplugins.mcp_.catalog_manager.MCPCatalogManager(plugin_dir: str = None, working_dir: str = None)[source]¶
Bases:
objectManages MCP server catalog and process detection
- get_server_info(server_name: str) Dict[str, Any] | None[source]¶
Get detailed info for a specific server
- get_servers_by_category(category: str = None) Dict[str, Any][source]¶
Get servers filtered by category
mindroot.coreplugins.mcp_.dynamic_commands module¶
mindroot.coreplugins.mcp_.mcp_manager module¶
- class mindroot.coreplugins.mcp_.mcp_manager.MCPManager[source]¶
Bases:
objectManages MCP server connections and operations
- async call_tool(server_name: str, tool_name: str, arguments: Dict[str, Any]) Any[source]¶
Call a tool on an MCP server
- complete_oauth_flow(server_name: str, code: str, state: str | None = None) bool[source]¶
Complete OAuth flow with authorization code.
- async connect_server(name: str, secrets: Dict[str, str] | None = None) bool[source]¶
Connect to an MCP server
- mark_server_as_installed(name: str, registry_id: str = None)[source]¶
Mark server as installed (in-memory only for remote servers)
- start_oauth_flow(server_name: str) str | None[source]¶
Start OAuth flow and return authorization URL.
- async test_local_server_capabilities(name: str, command: str, args: List[str], env: Dict[str, str], secrets: Dict[str, str] | None = None) Dict[str, Any][source]¶
Test connection to a local MCP server and return its capabilities.
This method creates a temporary server, connects to it, extracts capabilities, and cleans up. It follows the same pattern as the working catalog system.
- Parameters:
name – Display name for the server (for error messages)
command – Command to run the MCP server
args – Arguments for the command
env – Environment variables
secrets – A dictionary of secrets to substitute into placeholders.
- Returns:
Dict containing success status, message, and capabilities (tools, resources, prompts)
- Raises:
Exception – If MCP SDK is not available or connection fails
- class mindroot.coreplugins.mcp_.mcp_manager.MCPServer(*, name: str, description: str, command: str | None = None, args: List[str] = [], env: Dict[str, str] = {}, transport: str = 'stdio', url: str | None = None, provider_url: str | None = None, transport_url: str | None = None, transport_type: str | None = None, auth_type: str = 'none', auth_headers: Dict[str, str] = {}, authorization_server_url: str | None = None, client_id: str | None = None, client_secret: str | None = None, scopes: List[str] = [], redirect_uri: str | None = None, access_token: str | None = None, refresh_token: str | None = None, token_expires_at: str | None = None, status: str = 'disconnected', secrets: Dict[str, str] | None = None, capabilities: Dict[str, Any] = {}, install_method: str = 'manual', install_package: str | None = None, auto_install: bool = False, installed: bool = False)[source]¶
Bases:
BaseModelModel for MCP server configuration
- access_token: str | None¶
- args: List[str]¶
- auth_headers: Dict[str, str]¶
- auth_type: str¶
- authorization_server_url: str | None¶
- auto_install: bool¶
- capabilities: Dict[str, Any]¶
- client_id: str | None¶
- client_secret: str | None¶
- command: str | None¶
- description: str¶
- env: Dict[str, str]¶
- install_method: str¶
- install_package: str | None¶
- installed: bool¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
- provider_url: str | None¶
- redirect_uri: str | None¶
- refresh_token: str | None¶
- scopes: List[str]¶
- secrets: Dict[str, str] | None¶
- status: str¶
- token_expires_at: str | None¶
- transport: str¶
- transport_type: str | None¶
- transport_url: str | None¶
- url: str | None¶
mindroot.coreplugins.mcp_.mod module¶
- async mindroot.coreplugins.mcp_.mod.enhanced_mcp_manager_service(context=None)[source]¶
Service to access enhanced MCP manager (same as mcp_manager_service now)
- async mindroot.coreplugins.mcp_.mod.mcp_check_tools(context=None)[source]¶
Check availability of installation tools
Example: { “mcp_check_tools”: {} }
- async mindroot.coreplugins.mcp_.mod.mcp_connect(server_name: str, context=None)[source]¶
Connect to an MCP server
Example: { “mcp_connect”: { “server_name”: “filesystem” } }
- async mindroot.coreplugins.mcp_.mod.mcp_debug_connection(server_name: str, context=None)[source]¶
Debug MCP server connection and dynamic command registration
Example: { “mcp_debug_connection”: { “server_name”: “calculator” } } { “mcp_debug_connection”: { “server_name”: “github” } }
- async mindroot.coreplugins.mcp_.mod.mcp_disconnect(server_name: str, context=None)[source]¶
Disconnect from an MCP server
Example: { “mcp_disconnect”: { “server_name”: “filesystem” } }
- async mindroot.coreplugins.mcp_.mod.mcp_enhanced_connect(server_name: str, context=None)[source]¶
Connect to MCP server with enhanced features
Example: { “mcp_enhanced_connect”: { “server_name”: “calculator” } }
- async mindroot.coreplugins.mcp_.mod.mcp_enhanced_disconnect(server_name: str, context=None)[source]¶
Disconnect from MCP server
Example: { “mcp_enhanced_disconnect”: { “server_name”: “calculator” } }
- async mindroot.coreplugins.mcp_.mod.mcp_install_npx_server(name: str, package: str, description: str = None, context=None)[source]¶
Install and configure an npx-based MCP server
Example: { “mcp_install_npx_server”: {
“name”: “github”, “package”: “@modelcontextprotocol/server-github”, “description”: “GitHub server”
} }
- async mindroot.coreplugins.mcp_.mod.mcp_install_uvx_server(name: str, package: str, description: str = None, context=None)[source]¶
Install and configure a uvx-based MCP server
Example: { “mcp_install_uvx_server”: {
“name”: “calculator”, “package”: “mcp-server-calculator”, “description”: “Calculator server”
} }
- async mindroot.coreplugins.mcp_.mod.mcp_list_dynamic_commands(context=None)[source]¶
List dynamically registered MCP commands
Example: { “mcp_list_dynamic_commands”: {} }
- async mindroot.coreplugins.mcp_.mod.mcp_list_servers(context=None)[source]¶
List all configured MCP servers
Example: { “mcp_list_servers”: {} }
mindroot.coreplugins.mcp_.oauth_storage module¶
OAuth token storage implementation for MCP servers.
- class mindroot.coreplugins.mcp_.oauth_storage.MCPTokenStorage(server_name: str, mcp_manager)[source]¶
Bases:
TokenStorageToken storage implementation for MCP OAuth flows.
Stores tokens and client information in the MCP server configuration.
- async get_client_info() OAuthClientInformationFull | None[source]¶
Get stored OAuth client information.
mindroot.coreplugins.mcp_.server_installer module¶
- class mindroot.coreplugins.mcp_.server_installer.MCPServerInstaller[source]¶
Bases:
objectHandles installation of MCP servers via different methods
- async static install_with_npm(package: str, args: list = None) bool[source]¶
Install package with npm
- async static install_with_npx(package: str, args: list = None) bool[source]¶
Install package with npx (similar to uvx, runs without global install)
mindroot.coreplugins.mcp_.setup module¶
mindroot.coreplugins.mcp_.test_dynamic_commands module¶
mindroot.coreplugins.mcp_.testmcpclient module¶
Before running, specify running MCP RS server URL. To spin up RS server locally, see
examples/servers/simple-auth/README.md
- cd to the examples/snippets directory and run:
uv run oauth-client