haive.mcp.downloader.configΒΆ

Configuration models for MCP Downloader.

This module defines the configuration models used throughout the MCP downloader system, including templates, server configurations, and installation methods.

Example

Creating a server template:


template = ServerTemplate(

name=”npm_official”, installation_method=InstallationMethod.NPM, command_pattern=”@modelcontextprotocol/server-{service}”, capabilities=[β€œtools”], category=”official”

)

Creating a server configuration:

config = ServerConfig(
name="filesystem",
template="npm_official",
source="npm",
variables={"service": "filesystem"},
tags={"official", "file-operations"}

)

Classes:

InstallationMethod: Enum of supported installation methods ServerTemplate: Template for server installation patterns ServerConfig: Configuration for a specific server DownloaderConfig: Overall downloader configuration

ClassesΒΆ

DiscoveryConfig

Configuration for server discovery.

DownloaderConfig

Overall configuration for the MCP downloader.

InstallationMethod

Supported installation methods for MCP servers.

ServerConfig

Configuration for a specific MCP server.

ServerTemplate

Template for MCP server installation patterns.

FunctionsΒΆ

load_config(config_file)

Load configuration from YAML file.

save_config(config, config_file)

Save configuration to YAML file.

Module ContentsΒΆ

class haive.mcp.downloader.config.DiscoveryConfig(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Configuration for server discovery.

Parameters:

data (Any)

sourcesΒΆ

List of discovery source URLs

patternsΒΆ

Package naming patterns by registry

auto_discoverΒΆ

Enable automatic discovery

discovery_intervalΒΆ

Hours between discovery runs

max_serversΒΆ

Maximum servers to discover per source

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.

class haive.mcp.downloader.config.DownloaderConfig(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Overall configuration for the MCP downloader.

Parameters:

data (Any)

install_dirΒΆ

Directory for server installations

config_dirΒΆ

Directory for configuration files

log_dirΒΆ

Directory for log files

max_concurrentΒΆ

Maximum concurrent downloads

retry_attemptsΒΆ

Number of retry attempts

retry_delayΒΆ

Delay between retries in seconds

health_check_enabledΒΆ

Enable health checks after install

health_check_timeoutΒΆ

Health check timeout in seconds

backup_enabledΒΆ

Enable configuration backups

backup_dirΒΆ

Directory for backups

templatesΒΆ

List of server templates

serversΒΆ

List of server configurations

discoveryΒΆ

Discovery configuration

Example

Full configuration:

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.

class haive.mcp.downloader.config.InstallationMethod[source]ΒΆ

Bases: str, enum.Enum

Supported installation methods for MCP servers.

NPMΒΆ

Node Package Manager installation

PIPΒΆ

Python Package Index installation

GITΒΆ

Git repository cloning

DOCKERΒΆ

Docker image pull

BINARYΒΆ

Binary executable download

CURLΒΆ

Direct HTTP download

MANUALΒΆ

Manual installation process

SCRIPTΒΆ

Custom script execution

Initialize self. See help(type(self)) for accurate signature.

class haive.mcp.downloader.config.ServerConfig(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Configuration for a specific MCP server.

Server configurations define individual servers to be installed, referencing a template and providing server-specific variables.

Parameters:

data (Any)

nameΒΆ

Server name identifier

templateΒΆ

Template name to use

sourceΒΆ

Source location (npm, git URL, etc.)

variablesΒΆ

Variables to substitute in template patterns

enabledΒΆ

Whether the server is enabled for installation

priorityΒΆ

Installation priority (lower = higher priority)

tagsΒΆ

Set of tags for categorization

env_varsΒΆ

Additional environment variables

versionΒΆ

Specific version to install

Example

Filesystem server config:

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.

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class haive.mcp.downloader.config.ServerTemplate(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Template for MCP server installation patterns.

Templates define reusable installation patterns that can be applied to multiple servers with similar installation requirements.

Parameters:

data (Any)

nameΒΆ

Unique template identifier

installation_methodΒΆ

Method to use for installation

command_patternΒΆ

Pattern for the command to run the server

args_patternΒΆ

Default arguments for the command

env_varsΒΆ

Environment variables to set

capabilitiesΒΆ

List of server capabilities

categoryΒΆ

Server category for organization

health_checkΒΆ

Command to verify server health

prerequisitesΒΆ

Required system dependencies

post_installΒΆ

Commands to run after installation

timeoutΒΆ

Installation timeout in seconds

Example

NPM template:

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.

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

haive.mcp.downloader.config.load_config(config_file)[source]ΒΆ

Load configuration from YAML file.

Parameters:

config_file (pathlib.Path) – Path to YAML configuration file

Returns:

Loaded configuration

Return type:

DownloaderConfig

Raises:

Example

Loading config:

haive.mcp.downloader.config.save_config(config, config_file)[source]ΒΆ

Save configuration to YAML file.

Parameters:
Return type:

None

Example

Saving config: