Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

docker_compose_up

Start and run Docker containers from your docker-compose.yml file to launch development environments and services with options for background operation, selective services, and custom compose files.

Instructions

Create and start containers defined in docker-compose.yml

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detachNoDetached mode: run in background
buildNoBuild images before starting
servicesNoOnly start specific services
fileNoPath to compose file (default: docker-compose.yml)
cwdNoWorking directory (where docker-compose.yml is located)

Implementation Reference

  • The core handler function that constructs and executes the 'docker compose up' command using dynamic flags based on input arguments and the executeDockerCommand helper.
    export async function dockerComposeUp(args: z.infer<typeof dockerComposeUpSchema>): Promise<ToolResponse> {
      const detachFlag = args.detach ? '-d' : '';
      const buildFlag = args.build ? '--build' : '';
      const services = args.services ? args.services.join(' ') : '';
      const fileFlag = args.file ? `-f ${args.file}` : '';
      const composeCmd = await getComposeCmd();
    
      return executeDockerCommand(
        `${composeCmd} ${fileFlag} up ${detachFlag} ${buildFlag} ${services}`.trim(),
        args.cwd
      );
    }
  • Zod schema defining the input validation for the docker_compose_up tool parameters.
    export const dockerComposeUpSchema = z.object({
      detach: z.boolean().optional().default(true).describe('Detached mode: run in background'),
      build: z.boolean().optional().default(false).describe('Build images before starting'),
      services: z.array(z.string()).optional().describe('Only start specific services'),
      file: z.string().optional().describe('Path to compose file (default: docker-compose.yml)'),
      cwd: z.string().optional().describe('Working directory (where docker-compose.yml is located)')
    });
  • Tool registration entry in the dockerTools array, providing the MCP-compatible tool definition with name, description, and JSON input schema.
    {
      name: 'docker_compose_up',
      description: 'Create and start containers defined in docker-compose.yml',
      inputSchema: {
        type: 'object',
        properties: {
          detach: { type: 'boolean', default: true, description: 'Detached mode: run in background' },
          build: { type: 'boolean', default: false, description: 'Build images before starting' },
          services: { type: 'array', items: { type: 'string' }, description: 'Only start specific services' },
          file: { type: 'string', description: 'Path to compose file (default: docker-compose.yml)' },
          cwd: { type: 'string', description: 'Working directory (where docker-compose.yml is located)' }
        }
      }
    },
  • src/index.ts:483-486 (registration)
    Dynamic tool dispatch handler in the main MCP server that routes calls to 'docker_compose_up' by validating arguments with the schema and invoking the handler function.
    if (name === 'docker_compose_up') {
      const validated = dockerComposeUpSchema.parse(args);
      return await dockerComposeUp(validated);
    }
  • Core helper function that executes shell commands (used by dockerComposeUp) and formats output as ToolResponse with success/error handling.
    async function executeDockerCommand(command: string, cwd?: string): Promise<ToolResponse> {
      try {
        const { stdout, stderr } = await execAsync(command, {
          cwd: cwd || process.cwd(),
          shell: '/bin/bash',
          maxBuffer: 10 * 1024 * 1024, // 10MB buffer for logs
          timeout: 60000 // 60 second timeout for builds
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: true,
                command: command,
                stdout: stdout.trim(),
                stderr: stderr.trim(),
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                command: command,
                stdout: error.stdout?.trim() || '',
                stderr: error.stderr?.trim() || error.message,
                exitCode: error.code || 1,
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ],
          isError: true
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Create and start') but lacks critical details: it doesn't mention that this may require Docker/Docker Compose installation, appropriate permissions, or network access; it doesn't describe what happens if containers already exist (e.g., restart vs. recreate); and it omits information on output (e.g., container IDs, logs) or error handling. For a mutation tool with zero annotation coverage, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information.

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?

Given the complexity of a Docker Compose operation (mutating system state, multiple parameters) with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects (e.g., side effects, prerequisites), usage context, and what to expect upon execution. For a tool that creates and starts containers, this minimal description leaves too many unknowns for effective agent use.

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?

The input schema has 100% description coverage, with all 5 parameters well-documented in the schema itself (e.g., 'detach' for background mode, 'build' for building images). The description adds no parameter-specific information beyond implying the use of docker-compose.yml, which aligns with the 'file' parameter's default. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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?

The description clearly states the action ('Create and start containers') and the resource ('defined in docker-compose.yml'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like docker_compose_down (which stops containers) or docker_start (which starts existing containers), though the 'create' aspect provides some implicit distinction.

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. The description doesn't mention prerequisites (e.g., needing a docker-compose.yml file), when not to use it (e.g., for single containers vs. multi-service setups), or direct comparisons to siblings like docker_compose_down for stopping services or docker_build for building images without starting.

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/ConnorBoetig-dev/mcp2'

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