Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

docker_start

Start one or more stopped Docker containers by name or ID to resume their operation in your development environment.

Instructions

Start one or more stopped containers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containersYesContainer name(s) or ID(s)
cwdNoWorking directory

Implementation Reference

  • Main handler function that constructs and executes the 'docker start' command on specified containers using the executeDockerCommand helper.
    export async function dockerStart(args: z.infer<typeof dockerStartSchema>): Promise<ToolResponse> { const containers = Array.isArray(args.containers) ? args.containers.join(' ') : args.containers; return executeDockerCommand(`docker start ${containers}`, args.cwd); }
  • Zod schema for input validation of docker_start tool parameters (containers and optional cwd).
    export const dockerStartSchema = z.object({ containers: z.union([z.string(), z.array(z.string())]).describe('Container name(s) or ID(s)'), cwd: z.string().optional().describe('Working directory') });
  • MCP tool definition/registration in dockerTools array, including name, description, and JSON inputSchema for the docker_start tool.
    { name: 'docker_start', description: 'Start one or more stopped containers', inputSchema: { type: 'object', properties: { containers: { oneOf: [ { type: 'string' }, { type: 'array', items: { type: 'string' } } ], description: 'Container name(s) or ID(s)' }, cwd: { type: 'string', description: 'Working directory' } }, required: ['containers'] } },
  • Top-level dispatch handler in MCP server that matches tool name 'docker_start', validates arguments, and invokes the dockerStart function.
    if (name === 'docker_start') { const validated = dockerStartSchema.parse(args); return await dockerStart(validated);
  • Core helper utility that executes any Docker command via child_process.execAsync, handles output/error formatting, and returns standardized ToolResponse.
    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 }; } }

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