haive.mcp.downloader.installers

Installer plugins for different MCP server types.

This module provides installer implementations for various installation methods including NPM, pip, Git, Docker, binary downloads, and more.

Examples

Using installers directly:


installer = NPMInstaller() if await installer.can_handle(server_config, template):

result = await installer.install(server_config, template, install_dir)

Classes:

MCPInstaller: Abstract base class for installers NPMInstaller: Handles NPM package installations PipInstaller: Handles Python pip installations GitInstaller: Handles Git repository cloning DockerInstaller: Handles Docker image pulling BinaryInstaller: Handles binary executable downloads CurlInstaller: Handles direct HTTP downloads

Version: 1.0.0 Author: Haive MCP Team

Classes

BinaryInstaller

Installer for binary executable MCP servers.

CurlInstaller

Installer for direct HTTP downloads.

DockerInstaller

Installer for Docker-based MCP servers.

GitInstaller

Installer for Git repository-based MCP servers.

MCPInstaller

Abstract base class for MCP installers.

NPMInstaller

Installer for NPM-based MCP servers.

PipInstaller

Installer for Python pip-based MCP servers.

Module Contents

class haive.mcp.downloader.installers.BinaryInstaller[source]

Bases: MCPInstaller

Installer for binary executable MCP servers.

Downloads and installs pre-compiled binary executables.

Examples

Binary installation:

async can_handle(server_config, template)[source]

Check if this is a binary installation.

Parameters:
Return type:

bool

async install(server_config, template, install_dir)[source]

Download and install binary executable.

Parameters:
Returns:

Installation result dictionary

Return type:

dict[str, Any]

async verify(server_config, template, install_dir)[source]

Verify binary installation.

Checks if the binary exists and is executable.

Returns:

True if binary exists and is executable

Parameters:
Return type:

bool

class haive.mcp.downloader.installers.CurlInstaller[source]

Bases: MCPInstaller

Installer for direct HTTP downloads.

Downloads files directly via HTTP/HTTPS without package managers.

Examples

Curl installation:

async can_handle(server_config, template)[source]

Check if this is a curl/HTTP download.

Parameters:
Return type:

bool

async install(server_config, template, install_dir)[source]

Download files via HTTP.

Parameters:
Returns:

Installation result dictionary

Return type:

dict[str, Any]

async verify(server_config, template, install_dir)[source]

Verify curl installation.

Checks if the expected files exist.

Returns:

True if installation directory exists with files

Parameters:
Return type:

bool

class haive.mcp.downloader.installers.DockerInstaller[source]

Bases: MCPInstaller

Installer for Docker-based MCP servers.

Handles pulling Docker images for containerized MCP servers.

Examples

Docker installation:

async can_handle(server_config, template)[source]

Check if this is a Docker installation.

Parameters:
Return type:

bool

async install(server_config, template, install_dir)[source]

Pull Docker image.

Parameters:
Returns:

Installation result dictionary

Return type:

dict[str, Any]

async verify(server_config, template, install_dir)[source]

Verify Docker installation.

Checks if the Docker image exists locally.

Returns:

True if image is available

Parameters:
Return type:

bool

class haive.mcp.downloader.installers.GitInstaller[source]

Bases: MCPInstaller

Installer for Git repository-based MCP servers.

Handles cloning Git repositories and running post-install commands.

Examples

Git installation:

async can_handle(server_config, template)[source]

Check if this is a Git installation.

Parameters:
Return type:

bool

async install(server_config, template, install_dir)[source]

Clone Git repository and run post-install commands.

Parameters:
Returns:

Installation result dictionary

Return type:

dict[str, Any]

async verify(server_config, template, install_dir)[source]

Verify Git installation.

Checks if the repository was cloned successfully.

Returns:

True if repository exists with .git directory

Parameters:
Return type:

bool

class haive.mcp.downloader.installers.MCPInstaller[source]

Bases: abc.ABC

Abstract base class for MCP installers.

All installer implementations must inherit from this class and implement the required methods.

Examples

Creating a custom installer:

abstractmethod can_handle(server_config, template)[source]
Async:

Parameters:
Return type:

bool

Check if this installer can handle the given configuration.

Parameters:
Returns:

True if this installer can handle the installation

Return type:

bool

abstractmethod install(server_config, template, install_dir)[source]
Async:

Parameters:
Return type:

dict[str, Any]

Install the MCP server.

Parameters:
Returns:

Dict with installation results including success status

Return type:

dict[str, Any]

abstractmethod verify(server_config, template, install_dir)[source]
Async:

Parameters:
Return type:

bool

Verify the installation was successful.

Parameters:
Returns:

True if installation is verified

Return type:

bool

class haive.mcp.downloader.installers.NPMInstaller[source]

Bases: MCPInstaller

Installer for NPM-based MCP servers.

Handles installation of MCP servers distributed as NPM packages. Supports both global and local installations.

Examples

NPM installation:

async can_handle(server_config, template)[source]

Check if this is an NPM installation.

Returns:

True if template uses NPM installation method

Parameters:
Return type:

bool

async install(server_config, template, install_dir)[source]

Install NPM package.

Attempts global installation first, falls back to local if that fails.

Parameters:
Returns:

Installation result dictionary

Return type:

dict[str, Any]

async verify(server_config, template, install_dir)[source]

Verify NPM installation.

Checks if the package is accessible via npx.

Returns:

True if package is installed and accessible

Parameters:
Return type:

bool

class haive.mcp.downloader.installers.PipInstaller[source]

Bases: MCPInstaller

Installer for Python pip-based MCP servers.

Handles installation of MCP servers distributed as Python packages.

Examples

Pip installation:

async can_handle(server_config, template)[source]

Check if this is a pip installation.

Parameters:
Return type:

bool

async install(server_config, template, install_dir)[source]

Install Python package via pip.

Parameters:
Returns:

Installation result dictionary

Return type:

dict[str, Any]

async verify(server_config, template, install_dir)[source]

Verify pip installation.

Checks if the module can be imported.

Returns:

True if module is installed and importable

Parameters:
Return type:

bool