Skip to main content
Glama
dockergiant

RollDev MCP Server

by dockergiant

rolldev_magento2_init

Initialize a new Magento 2 project with automatic version configuration. Specify project name and optionally set Magento version and target directory.

Instructions

Initialize a new Magento 2 project using RollDev's magento2-init command with automatic version configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYesName of the Magento 2 project (lowercase letters, numbers, and hyphens only)
magento_versionNoMagento version to install (default: 2.4.x). Examples: 2.4.x, 2.4.7, 2.4.7-p3, 2.4.82.4.x
target_directoryNoDirectory to create project in (optional, defaults to current directory). Project will be created in a subdirectory named after the project.

Implementation Reference

  • server.js:264-288 (registration)
    Tool definition and input schema registration for rolldev_magento2_init in ListToolsRequestSchema handler
    {
      name: "rolldev_magento2_init",
      description:
        "Initialize a new Magento 2 project using RollDev's magento2-init command with automatic version configuration",
      inputSchema: {
        type: "object",
        properties: {
          project_name: {
            type: "string",
            description: "Name of the Magento 2 project (lowercase letters, numbers, and hyphens only)",
          },
          magento_version: {
            type: "string",
            description: "Magento version to install (default: 2.4.x). Examples: 2.4.x, 2.4.7, 2.4.7-p3, 2.4.8",
            default: "2.4.x",
          },
          target_directory: {
            type: "string",
            description: "Directory to create project in (optional, defaults to current directory). Project will be created in a subdirectory named after the project.",
            default: "",
          },
        },
        required: ["project_name"],
      },
    },
  • Router case dispatching CallToolRequestSchema to magento2Init handler method
    case "rolldev_magento2_init":
  • Main handler method for rolldev_magento2_init - executes 'roll magento2-init' command with project_name, magento_version, and target_directory arguments, with a 15-minute timeout
    async magento2Init(args) {
      try {
        const {
          project_name,
          magento_version = "2.4.x",
          target_directory = "",
        } = args;
    
        // Build the command arguments
        const rollCommand = ["magento2-init", project_name];
        
        if (magento_version) {
          rollCommand.push(magento_version);
        }
        
        if (target_directory) {
          rollCommand.push(target_directory);
        }
    
        // Determine working directory (current directory or target_directory)
        const workingDir = target_directory ? resolve(target_directory) : process.cwd();
    
        // 15 minute timeout for full Magento 2 initialization (very long-running)
        const timeoutMs = 900000;
    
        // Execute the magento2-init command
        const result = await this.executeCommand(
          "roll",
          rollCommand,
          workingDir,
          timeoutMs,
        );
    
        const commandStr = `roll ${rollCommand.join(" ")}`;
        const isSuccess = result.code === 0;
    
        if (isSuccess) {
          const projectPath = target_directory ? 
            `${resolve(target_directory)}/${project_name}` : 
            `${process.cwd()}/${project_name}`;
    
          return {
            content: [
              {
                type: "text",
                text: `Magento 2 project '${project_name}' initialized successfully!\n\nCommand: ${commandStr}\nMagento Version: ${magento_version}\nProject Path: ${projectPath}\n\nThe command has automatically:\n- Configured compatible software versions\n- Set up the Docker environment\n- Generated SSL certificates\n- Installed Magento via Composer\n- Configured database, Redis, and search engine\n- Created admin user with 2FA\n- Set developer mode\n\nAccess URLs:\n- Frontend: https://app.${project_name}.test/\n- Admin Panel: https://app.${project_name}.test/shopmanager/\n\nAdmin credentials are saved in admin-credentials.txt in the project directory.\n\nOutput:\n${result.stdout}`,
              },
            ],
            isError: false,
          };
        } else {
          return {
            content: [
              {
                type: "text",
                text: `Failed to initialize Magento 2 project '${project_name}'!\n\nCommand: ${commandStr}\nExit Code: ${result.code}\n\nError: ${result.stderr || "Unknown error"}\n\nOutput:\n${result.stdout || "(no output)"}`,
              },
            ],
            isError: true,
          };
        }
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to execute Magento 2 initialization:\n\nProject Name: ${args.project_name}\nMagento Version: ${args.magento_version || "2.4.x"}\nError: ${error.message}\n\nOutput:\n${error.stdout || "(no output)"}\n\nErrors:\n${error.stderr || "(no errors)"}`,
            },
          ],
          isError: true,
        };
      }
    }
Behavior2/5

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

No annotations provided, and the description only mentions 'automatic version configuration' without elaborating on side effects, prerequisites, or potential destructive actions like overwriting files.

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

Conciseness3/5

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

The description is a single sentence that is succinct but lacks structure. It is not verbose but could be more informative without being lengthy.

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

Completeness2/5

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

With no output schema and no annotations, the description should provide more context about the initialization process, but it only mentions version configuration. Missing details about project structure creation, network calls, or prerequisites.

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

Parameters3/5

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

Schema coverage is 100%, so the description adds little beyond what the schema already provides. Baseline 3 is appropriate; no additional clarifications over schema descriptions.

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 it initializes a new Magento 2 project using a specific command with automatic version configuration, distinguishing it from sibling tools like rolldev_magento_cli and rolldev_composer.

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?

No guidance on when to use this tool versus alternatives (e.g., rolldev_start_project) or when not to use it. The description lacks contextual usage hints.

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/dockergiant/rolldev-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server