mcp.downloader.legacy_coreΒΆ

General MCP Server Downloader - A flexible, configuration-driven approach.

This script provides a general, extensible system for downloading and configuring MCP servers from various sources using configurable installation strategies.

Key features: - Plugin architecture for different installation methods - Configuration-driven patterns and templates - Support for multiple server registries and sources - Flexible metadata handling - Batch processing with retry logic - Progress tracking and logging

AttributesΒΆ

ClassesΒΆ

DockerInstaller

Installer for Docker-based MCP servers.

GeneralMCPDownloader

General MCP Server Downloader with configurable patterns and.

GitInstaller

Installer for Git-based MCP servers.

InstallationMethod

Supported installation methods.

MCPInstaller

Abstract base class for MCP installers.

NPMInstaller

Installer for NPM-based MCP servers.

PipInstaller

Installer for Python/pip-based MCP servers.

ServerConfig

Configuration for a specific MCP server.

ServerTemplate

Template for MCP server configuration.

FunctionsΒΆ

main()

Main function for CLI usage.

Module ContentsΒΆ

class mcp.downloader.legacy_core.DockerInstallerΒΆ

Bases: MCPInstaller

Installer for Docker-based MCP servers.

async can_handle(server_config: ServerConfig, template: ServerTemplate) boolΒΆ

Can Handle.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) dict[str, Any]ΒΆ

Install.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) boolΒΆ

Verify.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

class mcp.downloader.legacy_core.GeneralMCPDownloader(config_file: str | None = None, install_dir: str | None = None)ΒΆ

General MCP Server Downloader with configurable patterns and. installers.

async auto_discover_and_download(limit: int | None = None) dict[str, Any]ΒΆ

Auto-discover servers from registries and download them.

create_default_config()ΒΆ

Create a default configuration file.

async discover_servers_from_registry(registry_url: str) list[dict[str, Any]]ΒΆ

Discover MCP servers from a registry or documentation source.

async download_servers(server_names: list[str] | None = None, categories: list[str] | None = None, max_concurrent: int = 5) dict[str, Any]ΒΆ

Download and install MCP servers.

load_config()ΒΆ

Load configuration from file.

config_file = 'mcp_downloader_config.yaml'ΒΆ
install_dirΒΆ
installers: list[MCPInstaller]ΒΆ
patterns: dict[str, Any]ΒΆ
servers: list[ServerConfig] = []ΒΆ
templates: dict[str, ServerTemplate]ΒΆ
class mcp.downloader.legacy_core.GitInstallerΒΆ

Bases: MCPInstaller

Installer for Git-based MCP servers.

async can_handle(server_config: ServerConfig, template: ServerTemplate) boolΒΆ

Can Handle.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) dict[str, Any]ΒΆ

Install.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) boolΒΆ

Verify.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

class mcp.downloader.legacy_core.InstallationMethod(*args, **kwds)ΒΆ

Bases: enum.Enum

Supported installation methods.

BINARY = 'binary'ΒΆ
CURL = 'curl'ΒΆ
DOCKER = 'docker'ΒΆ
GIT = 'git'ΒΆ
MANUAL = 'manual'ΒΆ
NPM = 'npm'ΒΆ
PIP = 'pip'ΒΆ
SCRIPT = 'script'ΒΆ
class mcp.downloader.legacy_core.MCPInstallerΒΆ

Bases: abc.ABC

Abstract base class for MCP installers.

abstractmethod can_handle(server_config: ServerConfig, template: ServerTemplate) boolΒΆ
Async:

Check if this installer can handle the given configuration.

abstractmethod install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) dict[str, Any]ΒΆ
Async:

Install the MCP server.

abstractmethod verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) boolΒΆ
Async:

Verify the installation was successful.

class mcp.downloader.legacy_core.NPMInstallerΒΆ

Bases: MCPInstaller

Installer for NPM-based MCP servers.

async can_handle(server_config: ServerConfig, template: ServerTemplate) boolΒΆ

Can Handle.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) dict[str, Any]ΒΆ

Install.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) boolΒΆ

Verify.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

class mcp.downloader.legacy_core.PipInstallerΒΆ

Bases: MCPInstaller

Installer for Python/pip-based MCP servers.

async can_handle(server_config: ServerConfig, template: ServerTemplate) boolΒΆ

Can Handle.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) dict[str, Any]ΒΆ

Install.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

async verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) boolΒΆ

Verify.

Parameters:
  • server_config – [TODO: Add description]

  • template – [TODO: Add description]

  • install_dir – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

class mcp.downloader.legacy_core.ServerConfigΒΆ

Configuration for a specific MCP server.

enabled: bool = TrueΒΆ
name: strΒΆ
priority: int = 0ΒΆ
source: strΒΆ
tags: set[str]ΒΆ
template: strΒΆ
variables: dict[str, Any]ΒΆ
class mcp.downloader.legacy_core.ServerTemplateΒΆ

Template for MCP server configuration.

args_pattern: list[str] = []ΒΆ
capabilities: list[str] = []ΒΆ
category: str = 'general'ΒΆ
command_pattern: strΒΆ
env_vars: dict[str, str]ΒΆ
health_check: str | None = NoneΒΆ
installation_method: InstallationMethodΒΆ
name: strΒΆ
post_install: list[str] = []ΒΆ
prerequisites: list[str] = []ΒΆ
async mcp.downloader.legacy_core.main()ΒΆ

Main function for CLI usage.

mcp.downloader.legacy_core.aiohttp = NoneΒΆ
mcp.downloader.legacy_core.loggerΒΆ
mcp.downloader.legacy_core.yaml = NoneΒΆ