Skip to main content
Glama
run-as-root

Warden Magento MCP Server

by run-as-root

warden_magento_cli

Execute Magento CLI commands within Warden-managed development environments to manage and automate Magento 2 operations directly from AI assistants.

Instructions

Run bin/magento command inside the php-fpm container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the project directory
commandYesMagento CLI command (without 'bin/magento' prefix)
argsNoAdditional arguments for the command

Implementation Reference

  • Main handler function that runs the Magento CLI command (bin/magento) inside the Warden php-fpm container by constructing a warden env exec command and delegating to executeWardenCommand.
    async runMagentoCli(args) {
      const { project_path, command, args: commandArgs = [] } = args;
    
      const wardenCommand = [
        "env",
        "exec",
        "-T",
        "php-fpm",
        "php",
        "bin/magento",
        command,
        ...commandArgs,
      ];
    
      return await this.executeWardenCommand(
        project_path,
        wardenCommand,
        `Running Magento CLI: bin/magento ${command}`,
      );
    }
  • Tool schema definition in the ListTools response, specifying name, description, and inputSchema with required project_path and command, optional args array.
    {
      name: "warden_magento_cli",
      description: "Run bin/magento command inside the php-fpm container",
      inputSchema: {
        type: "object",
        properties: {
          project_path: {
            type: "string",
            description: "Path to the project directory",
          },
          command: {
            type: "string",
            description:
              "Magento CLI command (without 'bin/magento' prefix)",
          },
          args: {
            type: "array",
            description: "Additional arguments for the command",
            items: {
              type: "string",
            },
            default: [],
          },
        },
        required: ["project_path", "command"],
      },
    },
  • server.js:335-336 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement, mapping the tool name to the runMagentoCli method.
    case "warden_magento_cli":
      return await this.runMagentoCli(request.params.arguments);

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/run-as-root/warden-mcp-server'

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