deploy_server
Deploy a Velociraptor server for incident response and digital forensics. Configure deployment type, profile, and ports to set up endpoint management and threat hunting capabilities.
Instructions
Deploy a Velociraptor server for incident response.
Args: deployment_type: Deployment target - 'docker', 'binary', 'aws', or 'azure' profile: Deployment profile - 'rapid' (auto-destroys in 72h), 'standard', or 'enterprise' server_hostname: Hostname for the server (used in certificates and config) gui_port: Port for GUI/API access (default 8889) frontend_port: Port for client connections (default 8000) target_host: Target host for binary deployment (required for binary type) ssh_user: SSH username for binary deployment ssh_key_path: Path to SSH private key for binary deployment
Returns: Deployment details including server URL, API URL, and admin credentials. IMPORTANT: Admin password is shown only once - save it immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployment_type | No | docker | |
| profile | No | standard | |
| server_hostname | No | localhost | |
| gui_port | No | ||
| frontend_port | No | ||
| target_host | No | ||
| ssh_user | No | ||
| ssh_key_path | No |
Implementation Reference
- The handler function `deploy_server` that performs the deployment logic, selects the appropriate deployer (Docker, Binary, AWS, Azure), and generates certificates/config.
@mcp.tool() async def deploy_server( deployment_type: str = "docker", profile: str = "standard", server_hostname: str = "localhost", gui_port: int = 8889, frontend_port: int = 8000, target_host: Optional[str] = None, ssh_user: Optional[str] = None, ssh_key_path: Optional[str] = None, ) -> list[TextContent]: """Deploy a Velociraptor server for incident response. Args: deployment_type: Deployment target - 'docker', 'binary', 'aws', or 'azure' profile: Deployment profile - 'rapid' (auto-destroys in 72h), 'standard', or 'enterprise' server_hostname: Hostname for the server (used in certificates and config) gui_port: Port for GUI/API access (default 8889) frontend_port: Port for client connections (default 8000) target_host: Target host for binary deployment (required for binary type) ssh_user: SSH username for binary deployment ssh_key_path: Path to SSH private key for binary deployment Returns: Deployment details including server URL, API URL, and admin credentials. IMPORTANT: Admin password is shown only once - save it immediately. """ try: # Validate profile deployment_profile = get_profile(profile) # Generate deployment ID and config deployment_id = generate_deployment_id() config = DeploymentConfig( deployment_id=deployment_id, profile=profile, target=deployment_type, server_hostname=server_hostname, gui_port=gui_port, frontend_port=frontend_port, ) # Generate certificates from ..deployment.security import CertificateManager cert_manager = CertificateManager() certificates = cert_manager.generate_bundle( server_hostname=server_hostname, san_ips=[target_host] if target_host else None, rapid=(profile == "rapid"), ) cert_manager.save_bundle(certificates, deployment_id) # Select and run deployer if deployment_type == "docker": from ..deployment.deployers import DockerDeployer deployer = DockerDeployer() result = await deployer.deploy(config, deployment_profile, certificates) elif deployment_type == "binary": if not target_host: return [TextContent( type="text", text=json.dumps({ "error": "target_host is required for binary deployment" }, indent=2) )] from ..deployment.deployers import BinaryDeployer deployer = BinaryDeployer() result = await deployer.deploy( config, deployment_profile, certificates, target_host=target_host, ssh_user=ssh_user or "root", ssh_key_path=ssh_key_path, ) elif deployment_type == "aws": from ..deployment.deployers import AWSDeployer deployer = AWSDeployer() result = await deployer.deploy(config, deployment_profile, certificates) elif deployment_type == "azure": from ..deployment.deployers import AzureDeployer deployer = AzureDeployer() result = await deployer.deploy(config, deployment_profile, certificates) else: return [TextContent( type="text", text=json.dumps({ "error": f"Unknown deployment type: {deployment_type}", "valid_types": ["docker", "binary", "aws", "azure"] }, indent=2) )] # Return result with password visible (only time it's shown) return [TextContent( type="text", text=json.dumps(result.to_dict(include_secrets=True), indent=2) )] except ImportError as e: return [TextContent( type="text", text=json.dumps({ "error": f"Missing dependency: {str(e)}", "suggestion": "Install required packages with: pip install megaraptor-mcp[deployment]" }, indent=2) )] except ValueError as e: # Validation errors return [TextContent( type="text", text=json.dumps({ "error": str(e), "hint": "Check your deployment parameters" }, indent=2) )] except Exception: # Generic errors - don't expose internals return [TextContent( type="text", text=json.dumps({ "error": "Failed to deploy server", "hint": "Check deployment configuration and try again. Ensure Docker is running for docker deployments." }, indent=2) )]