Skip to content
Conduit

mcp server

pentesting-mcp-setup

This project contains necessary guides to get a mcp centric pentesting setup up.

hassanaftab93/pentesting-mcp-setupcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 23, 2026

Kali Docker MCP Setup Guide

A comprehensive setup guide for the kali-docker-mcp server - a Model Context Protocol (MCP) server that provides command execution capabilities in a containerized Kali Linux environment for semi-automated penetration testing and security research.

Disclaimer

This tool is provided for educational and authorized security testing purposes only. Use at your own risk. Always ensure you have proper authorization before conducting security assessments.


Prerequisites

  • Docker & Docker Compose installed and running
  • MCP-compatible client (Claude Desktop, Claude Code, Gemini CLI, VS Code with Copilot, etc.)
  • Brave API Key (optional) - for web search capabilities (Get one)
  • Azure credentials (optional) - for Azure cloud integration
  • Basic familiarity with command-line tools

Setup Instructions

Step 1: Clone the Repository

cd /path/to/your/projects
git clone https://github.com/hassanaftab93/kali-docker-mcp
cd kali-docker-mcp

Step 2: Configure API Tokens (Optional but Recommended)

Edit config.toml to add your API tokens for enhanced reconnaissance capabilities:

nano config.toml

Available services to configure:

ServiceDescriptionGet Token At
GitHubRepository and code intelligence mininghttps://github.com/settings/tokens
ShodanInfrastructure and exposed service discoveryhttps://account.shodan.io/
CensysCertificate and subdomain discoveryhttps://censys.io/account/api
VirusTotalPassive DNS and malware intelligencehttps://www.virustotal.com/gui/my-apikey
SecurityTrailsHistorical DNS and subdomain datahttps://securitytrails.com/app/account/credentials
Hunter.ioEmail enumeration and breach datahttps://hunter.io/api_keys
DeHashedCredential breach searcheshttps://dehashed.com/profile
Wayback MachineHistorical URL and content miningNo API key required

Set enabled = true for services you want to use.

Step 3: Build and Start the Kali Container

docker compose up --build -d

Step 3b: Pull Additional MCP Docker Images (Optional)

If you want to use the Brave Search or Azure MCP servers:

# Brave Search MCP
docker pull mcp/brave-search

# Azure MCP
docker pull mcp/azure

Step 4: Verify the Container is Running

docker ps | grep kali-mcp-server

You should see kali-mcp-server in the output.

Step 5: Configure Your MCP Client

⚠️ IMPORTANT: Disable any built-in terminal or command execution tools in your MCP client to prevent commands from being unintentionally executed on your host system instead of the Kali container.

See the MCP Configuration section below for client-specific setup.


MCP Configuration

The mcp-settings.json file contains configurations for multiple MCP servers:

ServerDescriptionRequirements
kali-mcp-serverKali Linux pentesting environmentDocker container running
braveBrave Search API for web searchesBRAVE_API_KEY (Get one)
azureAzure cloud services integrationAzure credentials configured

Claude Desktop / Claude Code

Add each server individually:

# Kali MCP Server
claude mcp add --transport stdio kali-mcp-server "docker exec -i kali-mcp-server python3 /app/kali_server.py"

# Brave Search (set your API key)
claude mcp add brave "docker run -i --rm -e BRAVE_MCP_TRANSPORT=stdio -e BRAVE_API_KEY=your-api-key mcp/brave-search"

# Azure
claude mcp add azure "docker run -i --rm mcp/azure server start"

Gemini CLI

# Kali MCP Server
gemini mcp add kali-mcp-server "docker exec -i kali-mcp-server python3 /app/kali_server.py"

# Brave Search
gemini mcp add brave "docker run -i --rm -e BRAVE_MCP_TRANSPORT=stdio -e BRAVE_API_KEY=your-api-key mcp/brave-search"

# Azure
gemini mcp add azure "docker run -i --rm mcp/azure server start"

VS Code (Copilot)

Create or edit .vscode/mcp.json in your workspace:

{
  "servers": {
    "kali-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": ["exec", "-i", "kali-mcp-server", "python3", "/app/kali_server.py"]
    },
    "brave": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "BRAVE_MCP_TRANSPORT", "-e", "BRAVE_API_KEY", "mcp/brave-search"],
      "env": {
        "BRAVE_MCP_TRANSPORT": "stdio",
        "BRAVE_API_KEY": "your-api-key"
      }
    },
    "azure": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "mcp/azure", "server", "start"]
    }
  }
}

Other MCP Clients

See mcp-settings.json for the full JSON configuration format.


Available Tools

Core MCP Tools

  • run_kali_command - Execute commands in Kali environment
  • get_job_status - Check background job status
  • list_background_jobs - List all running jobs
  • cancel_job - Cancel a running job
  • get_workspace_info - Get workspace configuration

Interactsh Tools (Out-of-Band Detection)

  • start_interactsh - Start out-of-band interaction monitoring
  • get_interactsh_status - Check interactsh worker status
  • poll_interactsh - Retrieve recorded interactions
  • stop_interactsh - Stop interactsh worker

Service Management

  • get_service_tokens - Get configured API service tokens

Pre-installed Security Tools

CategoryTools
Network Scanningnmap, masscan
Web Testingdirb, ffuf, gobuster, nikto, whatweb, wfuzz, nuclei
DNS/Domaindig, whois, dnsrecon, dnsenum, amass, subfinder
Exploitationmetasploit-framework, sqlmap
Password Attacksjohn, hashcat, hydra
SSL/TLSsslscan, testssl.sh
SMB/Windowsenum4linux, smbclient
Utilitiescurl, wget, jq, exiftool, swaks
WordlistsSecLists

Workspace Structure

All pentest artifacts are organized in /app/workspace/{date_target}/:

workspace/
└── {date_target}/
    ├── recon/        # Reconnaissance data
    ├── scans/        # Scan results
    ├── exploits/     # Exploit artifacts
    ├── evidence/     # Evidence collection
    ├── reports/      # Generated reports
    ├── logs/         # Activity logs
    └── screenshots/  # Screenshots

Common Commands

Managing the Container

# Start the container
docker compose up -d

# Stop the container
docker compose down

# View container logs
docker logs kali-mcp-server

# Rebuild after changes
docker compose up --build -d

# Enter the container manually
docker exec -it kali-mcp-server /bin/bash

Testing MCP Connection

# Test the MCP server directly
docker exec -i kali-mcp-server python3 /app/kali_server.py

Troubleshooting

Container Not Starting

# Check Docker logs
docker logs kali-mcp-server

# Ensure Docker is running
docker info

MCP Client Not Connecting

  1. Verify the container is running: docker ps | grep kali-mcp-server
  2. Restart your MCP client after configuration changes
  3. Check that no other tools are intercepting commands

Permission Issues

The container runs with elevated privileges for security tools. If you encounter permission issues:

# Rebuild the container
docker compose down
docker compose up --build -d

Security Notes

  • Container runs with necessary privileges (NET_ADMIN, NET_RAW, SYS_ADMIN) for security tools
  • All command execution is contained within the Docker environment
  • Network mode is set to host for full network access
  • API tokens should be configured securely - never commit them to version control
  • Resource limits are set to 8GB RAM and 4 CPUs

License

This project is an independent open-source contribution and is not affiliated with, endorsed by, or associated with OffSec or Kali Linux. Kali Linux is a trademark of Offensive Security.

↑↓ navigate openesc close