container_start
Start a stopped Docker container by providing its ID or name. This tool enables container management through natural language interactions.
Instructions
Start a stopped container
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container | Yes | Container ID or name |
Implementation Reference
- src/servers/mcp.server.ts:145-158 (registration)Registration of the 'container_start' tool including its name, description, and input schema definition.{ name: 'container_start', description: 'Start a stopped container', inputSchema: { type: 'object', properties: { container: { type: 'string', description: 'Container ID or name', }, }, required: ['container'], }, },
- src/servers/mcp.server.ts:257-263 (handler)Handler logic for the 'container_start' tool: parses arguments, calls DockerService.startContainer, and formats the response.case 'container_start': { const { container } = request.params.arguments as { container: string }; const output = await this.dockerService.startContainer(container); return { content: [{ type: 'text', text: `Container started: ${output}` }], }; }
- src/services/docker.service.ts:49-51 (helper)Core implementation of container start: executes the Docker CLI command 'docker start <container-id>'.async startContainer(id: string): Promise<string> { return this.executeCommand(`start ${id}`); }
- src/services/docker.service.ts:8-18 (helper)Utility method to execute Docker CLI commands asynchronously, used by all Docker operations including startContainer.async executeCommand(command: string): Promise<string> { try { const { stdout } = await execAsync(`docker ${command}`); return stdout; } catch (error: any) { throw new McpError( ErrorCode.InternalError, `Docker command failed: ${error.message}` ); } }