haive.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 haive.mcp.installers.safe_pattern_installer.InstallationRequest(/, **data)

Bases: pydantic.BaseModel

Request for MCP server installation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.mcp.installers.safe_pattern_installer.InstallationResult(/, **data)

Bases: pydantic.BaseModel

Result of installation attempt.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.mcp.installers.safe_pattern_installer.SafePatternInstaller(config_manager=None)

Safe MCP installer using only predefined patterns.

Init .

Parameters:

config_manager (haive.mcp.installers.config_manager.MCPConfigManager | None) – [TODO: Add description]

check_server_status(server_name)

Check if an MCP server is running.

Parameters:

server_name (str)

Return type:

str

cleanup()

Stop all running servers.

Return type:

None

create_installation_tool(request)

Create a tool for installing a specific MCP server.

Parameters:

request (InstallationRequest)

Return type:

langchain_core.tools.StructuredTool

create_quick_install_tools()

Create tools for common MCP server installations.

Return type:

list[langchain_core.tools.StructuredTool]

get_pattern_for_server(package_name, suggested_pattern)

Get the appropriate pattern for a server.

Parameters:
  • package_name (str)

  • suggested_pattern (str)

Return type:

haive.mcp.installers.config_manager.MCPServerPattern | None

get_status_summary()

Get summary of installer status.

Return type:

dict[str, Any]

async start_server(server_name)

Start a configured MCP server.

Parameters:

server_name (str)

Return type:

InstallationResult

validate_installation_request(request)

Validate that installation request is safe.

Parameters:

request (InstallationRequest)

Return type:

tuple[bool, str]