Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

generate_agent_installer

Create platform-specific agent installers with embedded configuration for the Velociraptor forensics platform. Generate Windows, Linux, or macOS packages that deploy without additional setup.

Instructions

Generate an agent installer package with embedded configuration.

Creates platform-specific installers that can be deployed without additional configuration.

Args: deployment_id: The deployment to generate installer for os_type: Target OS - 'windows', 'linux', or 'macos' installer_type: Installer format - 'msi', 'deb', 'rpm', or 'pkg' (auto-selected based on os_type if not specified) labels: Labels to apply to agents installed with this package

Returns: Path to generated installer and installation instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
os_typeNowindows
installer_typeNo
labelsNo

Implementation Reference

  • The tool 'generate_agent_installer' is implemented in 'src/megaraptor_mcp/tools/deployment.py'. It handles the logic for generating agent installer packages for different OS types by loading deployment certificates and calling 'InstallerGenerator'.
    async def generate_agent_installer(
        deployment_id: str,
        os_type: str = "windows",
        installer_type: Optional[str] = None,
        labels: Optional[list[str]] = None,
    ) -> list[TextContent]:
        """Generate an agent installer package with embedded configuration.
    
        Creates platform-specific installers that can be deployed without
        additional configuration.
    
        Args:
            deployment_id: The deployment to generate installer for
            os_type: Target OS - 'windows', 'linux', or 'macos'
            installer_type: Installer format - 'msi', 'deb', 'rpm', or 'pkg'
                          (auto-selected based on os_type if not specified)
            labels: Labels to apply to agents installed with this package
    
        Returns:
            Path to generated installer and installation instructions.
        """
        try:
            from ..deployment.agents import InstallerGenerator, InstallerType
            from ..deployment.security import CertificateManager
            from ..deployment.deployers import DockerDeployer
    
            # Get deployment info
            deployer = DockerDeployer()
            info = await deployer.get_status(deployment_id)
    
            if not info:
                return [TextContent(
                    type="text",
                    text=json.dumps({
                        "error": f"Deployment not found: {deployment_id}",
                        "hint": "Use list_deployments tool to see available deployments"
                    }, indent=2)
                )]
    
            # Load certificates
            cert_manager = CertificateManager()
            bundle = cert_manager.load_bundle(deployment_id)
    
            if not bundle:
                return [TextContent(
                    type="text",
                    text=json.dumps({
                        "error": "Certificate bundle not found"
                    }, indent=2)
                )]
    
            # Determine installer type
            type_map = {
                "windows": InstallerType.MSI,
                "linux": InstallerType.DEB,
                "macos": InstallerType.PKG,
            }
            if installer_type:
                inst_type = InstallerType(installer_type.lower())
            else:
                inst_type = type_map.get(os_type.lower(), InstallerType.ZIP)
    
            # Create installer config
            from ..deployment.agents.installer_gen import InstallerConfig
            config = InstallerConfig(
                server_url=info.server_url.replace("/api/", "") + f":{8000}/",
                ca_cert=bundle.ca_cert,
                ca_fingerprint=bundle.ca_fingerprint,
                labels=labels or [],
                deployment_id=deployment_id,
            )
    
            # Generate installer
            generator = InstallerGenerator()
            result = await generator.generate(config, inst_type)
    
            return [TextContent(
                type="text",
                text=json.dumps(result.to_dict(), indent=2)
            )]
    
        except ImportError as e:
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": f"Missing dependency: {str(e)}",
                    "hint": "Install required packages with: pip install megaraptor-mcp[deployment]"
                }, indent=2)
            )]
    
        except Exception:
            # Generic errors - don't expose internals
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "Operation failed",
                    "hint": "Check deployment configuration and try again"
                }, indent=2)
            )]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wagonbomb/megaraptor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server