Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

deploy_agents_ssh

Deploy Velociraptor agents to Linux and macOS systems using SSH connections for digital forensics and incident response management.

Instructions

Push Velociraptor agents to Linux/macOS systems via SSH.

Args: deployment_id: The deployment to connect agents to targets: List of target hostnames or IPs username: SSH username key_path: Path to SSH private key (preferred) password: SSH password (if not using key) target_os: Target OS - 'linux' or 'macos' labels: Labels to apply to deployed agents port: SSH port (default 22)

Returns: Deployment results for each target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
targetsYes
usernameYes
key_pathNo
passwordNo
target_osNolinux
labelsNo
portNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool implementation for `deploy_agents_ssh` is in `src/megaraptor_mcp/tools/deployment.py`. It handles the logic for SSH-based agent deployment.
    async def deploy_agents_ssh(
        deployment_id: str,
        targets: list[str],
        username: str,
        key_path: Optional[str] = None,
        password: Optional[str] = None,
        target_os: str = "linux",
        labels: Optional[list[str]] = None,
        port: int = 22,
    ) -> list[TextContent]:
        """Push Velociraptor agents to Linux/macOS systems via SSH.
    
        Args:
            deployment_id: The deployment to connect agents to
            targets: List of target hostnames or IPs
            username: SSH username
            key_path: Path to SSH private key (preferred)
            password: SSH password (if not using key)
            target_os: Target OS - 'linux' or 'macos'
            labels: Labels to apply to deployed agents
            port: SSH port (default 22)
    
        Returns:
            Deployment results for each target.
        """
        try:
            from ..deployment.agents import SSHDeployer
            from ..deployment.agents.ssh_deployer import SSHCredentials, DeploymentTarget as SSHTarget
            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)
                )]
    
            # Generate client config
            import yaml
            client_config = yaml.dump({
                "Client": {
                    "server_urls": [info.server_url.replace("/api/", "") + ":8000/"],
                    "ca_certificate": bundle.ca_cert,
                    "nonce": secrets.token_hex(8),
                    "labels": labels or [],
                },
                "version": {"name": "megaraptor-ssh-deploy"},
            })
    
            # Create credentials and targets
            creds = SSHCredentials(
                username=username,
                key_path=key_path,
                password=password,
                port=port,
            )
    
            ssh_targets = [
                SSHTarget(hostname=t, credentials=creds, target_os=target_os)
                for t in targets
            ]
    
            # Deploy
            ssh_deployer = SSHDeployer(default_credentials=creds)
            results = await ssh_deployer.deploy_to_multiple(
                ssh_targets, client_config, labels=labels
            )
    
            return [TextContent(
                type="text",
                text=json.dumps({
                    "total": len(results),
                    "successful": sum(1 for r in results if r.success),
                    "failed": sum(1 for r in results if not r.success),
                    "results": [r.to_dict() for r in results],
                }, indent=2)
            )]
    
        except ImportError:
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "paramiko not installed",
                    "suggestion": "pip install paramiko"
                }, 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)
            )]
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It adds valuable operational hints (key_path is 'preferred' over password, default port), but fails to disclose critical behavioral traits for a deployment tool: idempotency (can it be re-run?), failure modes (partial success behavior?), privilege requirements, or whether it overwrites existing agent installations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The structure is logical with a clear one-sentence purpose followed by 'Args' and 'Returns' sections. While the Args list is lengthy, it is necessary given the schema's lack of descriptions. The 'Returns' line is appropriately brief since an output schema exists to detail the structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutative deployment tool with 8 parameters and zero annotations, the description covers parameter semantics adequately but leaves significant gaps in operational safety and prerequisites. The presence of an output schema reduces the need for return value documentation, but guidance on rollback, idempotency, or agent versioning is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage, the description compensates effectively by documenting all 8 parameters with semantic meaning (e.g., 'deployment_id' connects agents to a deployment, 'targets' accepts hostnames or IPs). It adds constraints ('linux' or 'macos') and preference indicators ('preferred') that the schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Push'), resource ('Velociraptor agents'), target platforms ('Linux/macOS'), and method ('SSH'). It effectively distinguishes itself from the sibling tool 'deploy_agents_winrm' through OS scope and protocol specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus 'deploy_agents_winrm' or other deployment methods, nor does it mention prerequisites like SSH connectivity requirements, firewall rules, or privilege escalation needs (e.g., sudo).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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