Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

deploy_agents_winrm

Deploy Velociraptor agents to Windows systems using WinRM for endpoint management and forensic investigation workflows.

Instructions

Push Velociraptor agents to Windows systems via WinRM.

Args: deployment_id: The deployment to connect agents to targets: List of target hostnames or IPs username: Windows username (DOMAIN\user or user@domain) password: Windows password labels: Labels to apply to deployed agents use_ssl: Use HTTPS for WinRM (default True) port: WinRM port (default 5986 for HTTPS)

Returns: Deployment results for each target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
targetsYes
usernameYes
passwordYes
labelsNo
use_sslNo
portNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `deploy_agents_winrm` tool implementation in `src/megaraptor_mcp/tools/deployment.py`.
    async def deploy_agents_winrm(
        deployment_id: str,
        targets: list[str],
        username: str,
        password: str,
        labels: Optional[list[str]] = None,
        use_ssl: bool = True,
        port: int = 5986,
    ) -> list[TextContent]:
        """Push Velociraptor agents to Windows systems via WinRM.
    
        Args:
            deployment_id: The deployment to connect agents to
            targets: List of target hostnames or IPs
            username: Windows username (DOMAIN\\user or user@domain)
            password: Windows password
            labels: Labels to apply to deployed agents
            use_ssl: Use HTTPS for WinRM (default True)
            port: WinRM port (default 5986 for HTTPS)
    
        Returns:
            Deployment results for each target.
        """
        try:
            from ..deployment.agents import WinRMDeployer
            from ..deployment.agents.winrm_deployer import WinRMCredentials, DeploymentTarget as WinRMTarget
            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-winrm-deploy"},
            })
    
            # Create credentials and targets
            creds = WinRMCredentials(
                username=username,
                password=password,
                use_ssl=use_ssl,
                port=port,
            )
    
            winrm_targets = [
                WinRMTarget(hostname=t, port=port, credentials=creds)
                for t in targets
            ]
    
            # Deploy
            winrm_deployer = WinRMDeployer(default_credentials=creds)
            results = await winrm_deployer.deploy_to_multiple(
                winrm_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": "pywinrm not installed",
                    "suggestion": "pip install pywinrm"
                }, 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 discloses connection behavior (HTTPS default, port 5986) but fails to mention that this is a destructive/write operation requiring administrative privileges on targets, or what happens if agents already exist.

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 docstring format (one-line summary, Args, Returns) efficiently organizes information with the most critical detail (WinRM method) front-loaded. The Args list is necessary given the lack of schema descriptions.

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?

The description adequately covers parameter semantics and basic return type, but given the complexity of remote agent deployment, it is incomplete regarding error handling, credential security warnings, and prerequisite conditions (e.g., WinRM service enabled on targets).

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

Parameters5/5

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

Despite 0% schema description coverage, the Args section fully compensates by documenting all 7 parameters with semantic meaning, including critical format hints for username (DOMAIN\user or user@domain) and default values for use_ssl and port that are not explicit in the schema.

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 opens with a specific action ('Push'), resource ('Velociraptor agents'), target platform ('Windows systems'), and method ('via WinRM'), clearly distinguishing it from the sibling tool deploy_agents_ssh.

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

Usage Guidelines3/5

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

While the WinRM/Windows specificity implicitly guides selection, the description lacks explicit guidance on when to use this versus deploy_agents_ssh, and omits prerequisites like required target configuration or administrative privileges.

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