start_container
Start a stopped Docker container by providing its ID or name to resume application execution.
Instructions
Start a stopped Docker container.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Container ID or name |
Implementation Reference
- src/docker.ts:73-77 (handler)The handler function that implements the start_container tool logic. It gets a Docker container by ID and starts it using the Dockerode API.
export async function startContainer(id: string): Promise<string> { const container = docker.getContainer(id); await container.start(); return `Container ${id} started`; } - src/index.ts:70-78 (registration)Registration of the start_container tool with the MCP server. Defines the tool name, description, input schema, and handler function.
server.tool( "start_container", "Start a stopped Docker container.", { id: z.string().describe("Container ID or name") }, async ({ id }) => { const result = await startContainer(id); return { content: [{ type: "text", text: result }] }; }, ); - src/index.ts:73-73 (schema)Input schema definition for start_container tool using Zod. Validates that the 'id' parameter is a string representing the container ID or name.
{ id: z.string().describe("Container ID or name") },