Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

generate_server_config

Generate Velociraptor server configuration files for digital forensics deployments, supporting YAML or JSON output formats to enable endpoint management and threat hunting workflows.

Instructions

Generate Velociraptor server configuration file.

Args: deployment_id: The deployment to generate config for output_format: Output format - 'yaml' or 'json'

Returns: Server configuration content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
output_formatNoyaml

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function `generate_server_config` implementation in `src/megaraptor_mcp/tools/deployment.py`.
    async def generate_server_config(
        deployment_id: str,
        output_format: str = "yaml",
    ) -> list[TextContent]:
        """Generate Velociraptor server configuration file.
    
        Args:
            deployment_id: The deployment to generate config for
            output_format: Output format - 'yaml' or 'json'
    
        Returns:
            Server configuration content.
        """
        try:
            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 config
            import yaml
            config = {
                "version": {"name": "megaraptor-deployment"},
                "Client": {
                    "server_urls": [info.server_url.replace("/api/", "") + ":8000/"],
                    "ca_certificate": bundle.ca_cert,
                },
                "API": {
                    "bind_address": "0.0.0.0:8889",
                    "bind_scheme": "https",
                },
                "GUI": {
                    "bind_address": "0.0.0.0:8889",
                    "bind_scheme": "https",
                    "public_url": info.server_url,
                },
                "Frontend": {
                    "bind_address": "0.0.0.0:8000",
                },
                "ca_certificate": bundle.ca_cert,
            }
    
            if output_format == "json":
                output = json.dumps(config, indent=2)
            else:
                output = yaml.dump(config, default_flow_style=False)
    
            return [TextContent(
                type="text",
                text=output
            )]
    
        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)
            )]
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the return value ('Server configuration content') but fails to disclose behavioral traits like whether this is a read-only operation, if it accesses remote state, potential error conditions, or performance characteristics.

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?

Uses a structured docstring format (Args/Returns) that is appropriately sized and front-loaded. No redundant sentences, though the Args section duplicates information missing from the schema due to zero coverage, which is necessary but not ideal.

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?

Adequately covers the two parameters and acknowledges the return value, which is sufficient given the presence of an output schema. However, lacks behavioral context and usage guidance that would be necessary for a tool interacting with deployment infrastructure, especially with no annotations provided.

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?

With 0% schema description coverage, the description effectively compensates by documenting both parameters: deployment_id is explained as 'The deployment to generate config for' and output_format specifies valid values ('yaml' or 'json'). Could be improved by noting output_format is optional with a default value.

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

Purpose4/5

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

States the specific action (Generate) and resource (Velociraptor server configuration file) clearly. While the name helps distinguish from sibling 'generate' tools (agent_installer, ansible_playbook), the description itself does not explicitly differentiate use cases from deployment tools like deploy_server.

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?

Provides no guidance on when to use this tool versus alternatives like deploy_server or generate_agent_installer. Does not mention prerequisites such as requiring an existing deployment_id or how the generated config relates to deployment workflows.

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