mcp.installers.safe_pattern_installerΒΆ

Safe Pattern-Based MCP Server Installer.

Version 1: Uses predefined patterns for safe, predictable installations. No code generation - only trusted, tested patterns.

ClassesΒΆ

InstallationRequest

Request for MCP server installation.

InstallationResult

Result of installation attempt.

SafePatternInstaller

Safe MCP installer using only predefined patterns.

Module ContentsΒΆ

class mcp.installers.safe_pattern_installer.InstallationRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request for MCP server installation.

custom_args: list[str] = NoneΒΆ
env_vars: dict[str, str] = NoneΒΆ
package_name: str = NoneΒΆ
pattern_type: str = NoneΒΆ
require_approval: bool = NoneΒΆ
server_name: str = NoneΒΆ
class mcp.installers.safe_pattern_installer.InstallationResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result of installation attempt.

config_created: bool = FalseΒΆ
message: strΒΆ
process_id: int | None = NoneΒΆ
server_name: strΒΆ
success: boolΒΆ
tools_available: list[str] = NoneΒΆ
class mcp.installers.safe_pattern_installer.SafePatternInstaller(config_manager: haive.mcp.installers.config_manager.MCPConfigManager | None = None)ΒΆ

Safe MCP installer using only predefined patterns.

check_server_status(server_name: str) strΒΆ

Check if an MCP server is running.

cleanup() NoneΒΆ

Stop all running servers.

create_installation_tool(request: InstallationRequest) langchain_core.tools.StructuredToolΒΆ

Create a tool for installing a specific MCP server.

create_quick_install_tools() list[langchain_core.tools.StructuredTool]ΒΆ

Create tools for common MCP server installations.

get_pattern_for_server(package_name: str, suggested_pattern: str) haive.mcp.installers.config_manager.MCPServerPattern | NoneΒΆ

Get the appropriate pattern for a server.

get_status_summary() dict[str, Any]ΒΆ

Get summary of installer status.

async start_server(server_name: str) InstallationResultΒΆ

Start a configured MCP server.

validate_installation_request(request: InstallationRequest) tuple[bool, str]ΒΆ

Validate that installation request is safe.

config_managerΒΆ
request_counters: dict[str, int]ΒΆ
running_servers: dict[str, subprocess.Popen]ΒΆ