Skip to main content
Glama
dockergiant

RollDev MCP Server

by dockergiant

rolldev_composer

Execute Composer commands such as install, update, or require packages inside the php-fpm container by specifying the project path and command.

Instructions

Run Composer commands inside the php-fpm container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the project directory
commandYesComposer command to execute (e.g., 'install', 'update', 'require symfony/console', 'require-commerce')
save_output_to_fileNoSave full output to a log file for later investigation (useful for long output)

Implementation Reference

  • server.js:239-263 (registration)
    Tool registration for 'rolldev_composer' within the ListToolsRequestSchema handler. Defines the tool name, description, and input schema requiring 'project_path' (string) and 'command' (string), with optional 'save_output_to_file' (boolean, default false).
    {
      name: "rolldev_composer",
      description: "Run Composer commands inside the php-fpm container",
      inputSchema: {
        type: "object",
        properties: {
          project_path: {
            type: "string",
            description: "Path to the project directory",
          },
          command: {
            type: "string",
            description:
              "Composer command to execute (e.g., 'install', 'update', 'require symfony/console', 'require-commerce')",
          },
          save_output_to_file: {
            type: "boolean",
            description:
              "Save full output to a log file for later investigation (useful for long output)",
            default: false,
          },
        },
        required: ["project_path", "command"],
      },
    },
  • Handler dispatch: the 'rolldev_composer' case in the CallToolRequestSchema switch statement calls this.runComposer(request.params.arguments).
    case "rolldev_composer":
      return await this.runComposer(request.params.arguments);
  • Actual implementation of the runComposer method. Validates inputs (project_path exists, command exists, directory exists), constructs and executes 'roll composer {command}' via executeCommand with a 10-minute timeout, formats response with output previews and optional log-file saving.
      async runComposer(args) {
        const { project_path, command, save_output_to_file = false } = args;
    
        if (!project_path) {
          throw new Error("project_path is required");
        }
    
        if (!command) {
          throw new Error("command is required");
        }
    
        const normalizedProjectPath = project_path.replace(/\/+$/, "");
        const absoluteProjectPath = resolve(normalizedProjectPath);
    
        if (!existsSync(absoluteProjectPath)) {
          throw new Error(
            `Project directory does not exist: ${absoluteProjectPath}`,
          );
        }
    
        try {
          // Parse the command string to handle arguments properly
          const commandParts = command.trim().split(/\s+/);
          const rollCommand = [
            "composer",
            ...commandParts,
          ];
    
          // 10 minute timeout for composer operations (can be slow)
          const timeoutMs = 600000;
    
          const result = await this.executeCommand(
            "roll",
            rollCommand,
            absoluteProjectPath,
            timeoutMs,
          );
    
          const commandStr = `roll composer ${command}`;
          const isSuccess = result.code === 0;
    
          // Save output to file only when explicitly requested
          const logFilePath = save_output_to_file
            ? this.saveOutputToFile(result.stdout, result.stderr, commandStr, absoluteProjectPath)
            : null;
    
          let responseText;
          if (logFilePath) {
            const outputPreview = (result.stdout || "").substring(0, 500);
            const stderrPreview = (result.stderr || "").substring(0, 500);
            responseText = `Composer command ${isSuccess ? "completed successfully" : "failed"}!
    
    Command: ${commandStr}
    Working directory: ${absoluteProjectPath}
    Exit Code: ${result.code}${result.timedOut ? " (TIMED OUT)" : ""}
    
    📁 Full output saved to file:
    ${logFilePath}
    
    Output Preview (first 500 chars):
    ${outputPreview || "(no output)"}${(result.stdout || "").length > 500 ? "\n...(truncated)" : ""}
    
    Errors Preview (first 500 chars):
    ${stderrPreview || "(no errors)"}${(result.stderr || "").length > 500 ? "\n...(truncated)" : ""}`;
          } else {
            responseText = `Composer command ${isSuccess ? "completed successfully" : "failed"}!
    
    Command: ${commandStr}
    Working directory: ${absoluteProjectPath}
    Exit Code: ${result.code}${result.timedOut ? " (TIMED OUT)" : ""}
    
    Output:
    ${result.stdout || "(no output)"}
    
    Errors:
    ${result.stderr || "(no errors)"}`;
          }
    
          return {
            content: [
              {
                type: "text",
                text: responseText,
              },
            ],
            isError: !isSuccess,
          };
        } catch (error) {
          const commandStr = `roll composer ${command}`;
    
          // Save error output to file only when explicitly requested
          const logFilePath = save_output_to_file
            ? this.saveOutputToFile(error.stdout, error.stderr, commandStr, absoluteProjectPath)
            : null;
    
          let responseText;
          if (logFilePath) {
            responseText = `Failed to execute Composer command:
    
    Command: ${commandStr}
    Working directory: ${absoluteProjectPath}
    Error: ${error.message}
    
    📁 Full output saved to file:
    ${logFilePath}`;
          } else {
            responseText = `Failed to execute Composer command:
    
    Command: ${commandStr}
    Working directory: ${absoluteProjectPath}
    Error: ${error.message}
    
    Output:
    ${error.stdout || "(no output)"}
    
    Errors:
    ${error.stderr || "(no errors)"}`;
          }
    
          return {
            content: [
              {
                type: "text",
                text: responseText,
              },
            ],
            isError: true,
          };
        }
      }
Behavior2/5

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

No annotations are present, so the description carries full burden. It fails to disclose side effects, error handling, permissions, or dependencies (e.g., does the container have Composer installed?).

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 description is a single concise sentence, but it omits necessary details, so it earns a 4 for being efficient but not optimally informative.

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 only one sentence, the description lacks context on return values, typical use cases, or how to handle long outputs (despite a parameter for saving output).

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 no additional meaning. Baseline 3 applies, as the schema already documents parameters adequately.

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 specifies the tool's action ('Run') and resource ('Composer commands inside the php-fpm container'), which is distinct from sibling tools like rolldev_magento_cli or rolldev_php_script.

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 is provided on when to use this tool versus alternatives, nor any exclusions or prerequisites. Sibling tools exist but are not referenced.

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