mcp.downloader.legacy_core ========================== .. py:module:: mcp.downloader.legacy_core .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: mcp.downloader.legacy_core.aiohttp mcp.downloader.legacy_core.logger mcp.downloader.legacy_core.yaml Classes ------- .. autoapisummary:: mcp.downloader.legacy_core.DockerInstaller mcp.downloader.legacy_core.GeneralMCPDownloader mcp.downloader.legacy_core.GitInstaller mcp.downloader.legacy_core.InstallationMethod mcp.downloader.legacy_core.MCPInstaller mcp.downloader.legacy_core.NPMInstaller mcp.downloader.legacy_core.PipInstaller mcp.downloader.legacy_core.ServerConfig mcp.downloader.legacy_core.ServerTemplate Functions --------- .. autoapisummary:: mcp.downloader.legacy_core.main Module Contents --------------- .. py:class:: DockerInstaller Bases: :py:obj:`MCPInstaller` Installer for Docker-based MCP servers. .. py:method:: can_handle(server_config: ServerConfig, template: ServerTemplate) -> bool :async: Can Handle. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> dict[str, Any] :async: Install. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> bool :async: Verify. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:class:: GeneralMCPDownloader(config_file: str | None = None, install_dir: str | None = None) General MCP Server Downloader with configurable patterns and. installers. .. py:method:: auto_discover_and_download(limit: int | None = None) -> dict[str, Any] :async: Auto-discover servers from registries and download them. .. py:method:: create_default_config() Create a default configuration file. .. py:method:: discover_servers_from_registry(registry_url: str) -> list[dict[str, Any]] :async: Discover MCP servers from a registry or documentation source. .. py:method:: download_servers(server_names: list[str] | None = None, categories: list[str] | None = None, max_concurrent: int = 5) -> dict[str, Any] :async: Download and install MCP servers. .. py:method:: load_config() Load configuration from file. .. py:attribute:: config_file :value: 'mcp_downloader_config.yaml' .. py:attribute:: install_dir .. py:attribute:: installers :type: list[MCPInstaller] .. py:attribute:: patterns :type: dict[str, Any] .. py:attribute:: servers :type: list[ServerConfig] :value: [] .. py:attribute:: templates :type: dict[str, ServerTemplate] .. py:class:: GitInstaller Bases: :py:obj:`MCPInstaller` Installer for Git-based MCP servers. .. py:method:: can_handle(server_config: ServerConfig, template: ServerTemplate) -> bool :async: Can Handle. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> dict[str, Any] :async: Install. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> bool :async: Verify. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:class:: InstallationMethod(*args, **kwds) Bases: :py:obj:`enum.Enum` Supported installation methods. .. py:attribute:: BINARY :value: 'binary' .. py:attribute:: CURL :value: 'curl' .. py:attribute:: DOCKER :value: 'docker' .. py:attribute:: GIT :value: 'git' .. py:attribute:: MANUAL :value: 'manual' .. py:attribute:: NPM :value: 'npm' .. py:attribute:: PIP :value: 'pip' .. py:attribute:: SCRIPT :value: 'script' .. py:class:: MCPInstaller Bases: :py:obj:`abc.ABC` Abstract base class for MCP installers. .. py:method:: can_handle(server_config: ServerConfig, template: ServerTemplate) -> bool :abstractmethod: :async: Check if this installer can handle the given configuration. .. py:method:: install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> dict[str, Any] :abstractmethod: :async: Install the MCP server. .. py:method:: verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> bool :abstractmethod: :async: Verify the installation was successful. .. py:class:: NPMInstaller Bases: :py:obj:`MCPInstaller` Installer for NPM-based MCP servers. .. py:method:: can_handle(server_config: ServerConfig, template: ServerTemplate) -> bool :async: Can Handle. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> dict[str, Any] :async: Install. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> bool :async: Verify. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:class:: PipInstaller Bases: :py:obj:`MCPInstaller` Installer for Python/pip-based MCP servers. .. py:method:: can_handle(server_config: ServerConfig, template: ServerTemplate) -> bool :async: Can Handle. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: install(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> dict[str, Any] :async: Install. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:method:: verify(server_config: ServerConfig, template: ServerTemplate, install_dir: pathlib.Path) -> bool :async: Verify. :param server_config: [TODO: Add description] :param template: [TODO: Add description] :param install_dir: [TODO: Add description] :returns: Add return description] :rtype: [TODO .. py:class:: ServerConfig Configuration for a specific MCP server. .. py:attribute:: enabled :type: bool :value: True .. py:attribute:: name :type: str .. py:attribute:: priority :type: int :value: 0 .. py:attribute:: source :type: str .. py:attribute:: tags :type: set[str] .. py:attribute:: template :type: str .. py:attribute:: variables :type: dict[str, Any] .. py:class:: ServerTemplate Template for MCP server configuration. .. py:attribute:: args_pattern :type: list[str] :value: [] .. py:attribute:: capabilities :type: list[str] :value: [] .. py:attribute:: category :type: str :value: 'general' .. py:attribute:: command_pattern :type: str .. py:attribute:: env_vars :type: dict[str, str] .. py:attribute:: health_check :type: str | None :value: None .. py:attribute:: installation_method :type: InstallationMethod .. py:attribute:: name :type: str .. py:attribute:: post_install :type: list[str] :value: [] .. py:attribute:: prerequisites :type: list[str] :value: [] .. py:function:: main() :async: Main function for CLI usage. .. py:data:: aiohttp :value: None .. py:data:: logger .. py:data:: yaml :value: None