Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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,
          };
        }
      }
    );
  • 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.";
    }

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/Hannes221/kali-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server