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¶
Installer for binary executable MCP servers. |
|
Installer for direct HTTP downloads. |
|
Installer for Docker-based MCP servers. |
|
Installer for Git repository-based MCP servers. |
|
Abstract base class for MCP installers. |
|
Installer for NPM-based MCP servers. |
|
Installer for Python pip-based MCP servers. |
Module Contents¶
- class haive.mcp.downloader.installers.BinaryInstaller[source]¶
Bases:
MCPInstallerInstaller 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
- async install(server_config, template, install_dir)[source]¶
Download and install binary executable.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Installation result dictionary
- Return type:
- 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
- class haive.mcp.downloader.installers.CurlInstaller[source]¶
Bases:
MCPInstallerInstaller 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
- async install(server_config, template, install_dir)[source]¶
Download files via HTTP.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Installation result dictionary
- Return type:
- 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
- class haive.mcp.downloader.installers.DockerInstaller[source]¶
Bases:
MCPInstallerInstaller 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
- async install(server_config, template, install_dir)[source]¶
Pull Docker image.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Installation result dictionary
- Return type:
- 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
- class haive.mcp.downloader.installers.GitInstaller[source]¶
Bases:
MCPInstallerInstaller 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
- async install(server_config, template, install_dir)[source]¶
Clone Git repository and run post-install commands.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Installation result dictionary
- Return type:
- 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
- class haive.mcp.downloader.installers.MCPInstaller[source]¶
Bases:
abc.ABCAbstract 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
Check if this installer can handle the given configuration.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
- Returns:
True if this installer can handle the installation
- Return type:
- abstractmethod install(server_config, template, install_dir)[source]¶
- Async:
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
Install the MCP server.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Dict with installation results including success status
- Return type:
- abstractmethod verify(server_config, template, install_dir)[source]¶
- Async:
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
Verify the installation was successful.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
True if installation is verified
- Return type:
- class haive.mcp.downloader.installers.NPMInstaller[source]¶
Bases:
MCPInstallerInstaller 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
- async install(server_config, template, install_dir)[source]¶
Install NPM package.
Attempts global installation first, falls back to local if that fails.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Installation result dictionary
- Return type:
- 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type:
- class haive.mcp.downloader.installers.PipInstaller[source]¶
Bases:
MCPInstallerInstaller 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
- Return type:
- async install(server_config, template, install_dir)[source]¶
Install Python package via pip.
- Parameters:
server_config (haive.mcp.downloader.config.ServerConfig) – Server configuration
template (haive.mcp.downloader.config.ServerTemplate) – Server template
install_dir (pathlib.Path) – Installation directory
- Returns:
Installation result dictionary
- Return type:
- 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:
server_config (haive.mcp.downloader.config.ServerConfig)
template (haive.mcp.downloader.config.ServerTemplate)
install_dir (pathlib.Path)
- Return type: