Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

export_deployment_docs

Generate comprehensive deployment documentation including server access details, agent deployment guides, security configurations, and troubleshooting guides for forensic investigation workflows.

Instructions

Generate comprehensive deployment documentation.

Creates documentation including:

  • Server access details

  • Agent deployment guides

  • Security configuration

  • Troubleshooting guides

Args: deployment_id: The deployment to document output_path: Optional path for documentation files

Returns: Path to generated documentation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
output_pathNo

Implementation Reference

  • Implementation of the export_deployment_docs tool handler which generates deployment documentation.
    async def export_deployment_docs(
        deployment_id: str,
        output_path: Optional[str] = None,
    ) -> list[TextContent]:
        """Generate comprehensive deployment documentation.
    
        Creates documentation including:
        - Server access details
        - Agent deployment guides
        - Security configuration
        - Troubleshooting guides
    
        Args:
            deployment_id: The deployment to document
            output_path: Optional path for documentation files
    
        Returns:
            Path to generated documentation.
        """
        try:
            from pathlib import Path
            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)
    
            # Create output directory
            if output_path:
                output_dir = Path(output_path)
            else:
                output_dir = Path(os.environ.get("LOCALAPPDATA", "~")).expanduser() / "megaraptor-mcp" / "docs" / deployment_id
    
            output_dir.mkdir(parents=True, exist_ok=True)
    
            # Generate main README
            readme = f"""# Velociraptor Deployment Documentation
    
    **Deployment ID**: {deployment_id}
    **Profile**: {info.profile}
    **Target**: {info.target}
    **Created**: {info.created_at}
    
    ## Server Access
    
    - **GUI URL**: {info.server_url}
    - **API URL**: {info.api_url}
    - **CA Fingerprint**: {bundle.ca_fingerprint if bundle else 'N/A'}
    
    ## Quick Start
    
    ### Access the GUI
    
    1. Open {info.server_url} in your browser
    2. Accept the self-signed certificate
    3. Log in with the admin credentials provided at deployment
    
    ### Connect MCP
    
    Set the following environment variable:
    ```bash
    export VELOCIRAPTOR_CONFIG_PATH=/path/to/api_client.yaml
    ```
    
    ### Deploy Agents
    
    Use the MCP tools to generate and deploy agents:
    - `generate_agent_installer` - Create platform installers
    - `deploy_agents_winrm` - Push to Windows
    - `deploy_agents_ssh` - Push to Linux/macOS
    - `generate_gpo_package` - Create GPO deployment bundle
    - `generate_ansible_playbook` - Create Ansible playbook
    
    ## Security Notes
    
    - All communications use mTLS encryption
    - CA certificate is pinned in all agent configurations
    - Admin password was shown only at creation time
    {f"- Auto-destruction scheduled: {info.auto_destroy_at}" if info.auto_destroy_at else ""}
    
    ## Support
    
    For issues, see the troubleshooting guide or contact your administrator.
    """
    
            readme_file = output_dir / "README.md"
            readme_file.write_text(readme)
    
            # Save CA certificate for reference
            if bundle:
                ca_file = output_dir / "ca.crt"
                ca_file.write_text(bundle.ca_cert)
    
            return [TextContent(
                type="text",
                text=json.dumps({
                    "success": True,
                    "output_directory": str(output_dir),
                    "files": [
                        str(readme_file),
                        str(ca_file) if bundle else None,
                    ],
                }, 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