container_status
Check if the Kali Linux Docker container is running to verify environment availability for security testing tools.
Instructions
Check the status of the Kali Linux Docker container.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/container.ts:52-74 (handler)The container_status tool handler, which calls docker.getStatus() and formats the output.
server.tool( "container_status", "Check the status of the Kali Linux Docker container.", {}, async () => { try { const status = await docker.getStatus(); return { content: [{ type: "text", text: JSON.stringify(status, null, 2) }], }; } catch (err) { return { content: [ { type: "text", text: `Failed to get status: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } ); - src/tools/container.ts:4-75 (registration)The function registerContainerTools registers the container_status tool with the MCP server.
export function registerContainerTools( server: McpServer, docker: DockerManager ) { 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, }; } } ); server.tool( "container_stop", "Stop and remove the Kali Linux Docker container.", {}, async () => { try { const message = await docker.stopContainer(); return { content: [{ type: "text", text: message }] }; } catch (err) { return { content: [ { type: "text", text: `Failed to stop container: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } ); server.tool( "container_status", "Check the status of the Kali Linux Docker container.", {}, async () => { try { const status = await docker.getStatus(); return { content: [{ type: "text", text: JSON.stringify(status, null, 2) }], }; } catch (err) { return { content: [ { type: "text", text: `Failed to get status: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } ); }