container_start
Start the Kali Linux Docker container to enable security testing tools like nmap, sqlmap, and metasploit. Required before executing any commands in the environment.
Instructions
Start the Kali Linux Docker container. Must be called before running any commands.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/container.ts:8-28 (registration)Tool registration for "container_start" in src/tools/container.ts.
server.tool( "container_start", "Start the Kali Linux Docker container. Must be called before running any commands.", {}, async () => { try { const message = await docker.startContainer(); return { content: [{ type: "text", text: message }] }; } catch (err) { return { content: [ { type: "text", text: `Failed to start container: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } ); - src/docker-manager.ts:43-74 (handler)Implementation handler for "container_start" in DockerManager class within src/docker-manager.ts.
async startContainer(): Promise<string> { // Check if container already exists const existing = await this.getContainer(); if (existing) { const info = await existing.inspect(); if (info.State.Running) { return "Kali container is already running."; } // Container exists but stopped — start it await existing.start(); return "Kali container started."; } // Check if image exists if (!(await this.imageExists())) { return "Kali Docker image not found. Please build it first: cd docker && docker-compose build"; } // Create and start a new container const container = await this.docker.createContainer({ Image: IMAGE_NAME, name: CONTAINER_NAME, Tty: true, OpenStdin: true, WorkingDir: "/workspace", HostConfig: { NetworkMode: "bridge", }, }); await container.start(); return "Kali container created and started."; }