Sandbox
@zebbern/zebbern-kali-mcp

MCP server for Kali Linux pentesting tools

This repo exposes a large Kali Linux toolset to MCP-capable agents through a host client and a Kali container backend. The client modules in `mcp_tools/` turn agent requests into HTTP calls, and the container side runs the actual scanners, AD tools, pivots, payload helpers, and parsers.

47 stars12 forksPythonUpdated 12d ago
Who it's for

Builders who want an agent to use Kali Linux tools from Claude, Copilot, or another MCP-capable client.

What it delivers

You can let your agent run pentesting workflows without leaving the chat or re-typing tool commands.

What it does

Large Kali tool surface

Provides 121+ tools for scanning, web testing, Active Directory work, pivoting, payloads, proxies, and parsing.

MCP client to Kali API bridge

Translates MCP tool calls in `mcp_tools/` into HTTP requests against the Flask server inside the Kali container.

Profile-based tool loading

Supports `auto`, `core`, `recon`, `web`, `ad`, `ctf`, `trim`, and `full` tool profiles, plus module exclusion.

Isolated container execution

Runs the real security tools inside Docker with network and VPN support instead of on the host.

Callback and output helpers

Includes a built-in callback listener and structured output parsing for agent-friendly workflows.

How to get it

  1. 11. Start the Kali backend
    # Clone the source and build the local image.
    git clone https://github.com/zebbern/zebbern-kali-mcp.git
    cd zebbern-kali-mcp
    docker compose up -d --build
  2. 2Host networking: Native Docker Engine on Linux and the current Windows Docker Desktop…
    docker compose -f docker-compose.yml -f docker-compose.host.yml up -d

README

Zebbern Kali MCP Server

A Docker-based Model Context Protocol (MCP) server that gives AI agents (GitHub Copilot, Claude, etc.) direct access to a full Kali Linux penetration testing toolkit. The AI agent calls MCP tools, which forward requests to a Flask API running inside a Kali container — every tool executes in an isolated, pre-configured environment.

License Python MCP Tools Base Image


Architecture

The project is a two-part client → server system:

┌──────────────────────────────────┐          HTTP           ┌──────────────────────────────────────┐
│          Windows / Host          │        (port 5000)      │         Docker Container             │
│                                  │                         │         (kalilinux/kali-rolling)     │
│  AI Agent (Copilot / Claude)     │                         │                                      │
│          │                       │                         │  Flask API Server                    │
│          ▼                       │                         │    ├── api/blueprints/*.py  (routes) │
│  MCP Client  (mcp_tools/*.py)    │ ──── POST /tools/* ───► │    └── core/*.py           (logic)  │
│    └── KaliToolsClient           │                         │              │                       │
│        (HTTP requests)           │                         │              ▼                       │
│                                  │                         │  Kali tools (nmap, sqlmap, …)        │
└──────────────────────────────────┘                         └──────────────────────────────────────┘
ComponentLocationRuns onRole
MCP Clientmcp_tools/Host (Windows/Linux/macOS)Exposes tool definitions to AI agents via the MCP protocol. Each tool call is translated into an HTTP request to the Flask server.
Flask Serverzebbern-kali/Inside Docker containerReceives HTTP requests, dispatches them through Flask blueprints (api/blueprints/) to core logic (core/), and executes the actual Kali tools.
Entrypointentrypoint.shInside Docker containerInitializes networking (routes, /etc/hosts, TUN interfaces, IP forwarding) before launching the Flask server.

Request flow: AI Agent → MCP tool function → KaliToolsClient HTTP request → Flask blueprint → Core logic → tool execution on Kali → JSON response back.


Quick Start

Source checkout + uvx

1. Start the Kali backend:

# Clone the source and build the local image.
git clone https://github.com/zebbern/zebbern-kali-mcp.git
cd zebbern-kali-mcp
docker compose up -d --build

Or build and run directly:

docker build -t zebbern-kali-mcp .
docker run -d --name zebbern-kali \
  --cap-add NET_RAW --cap-add NET_ADMIN \
  --device /dev/net/tun:/dev/net/tun \
  --sysctl net.ipv4.ip_forward=1 \
  -p 127.0.0.1:5000:5000 \
  -p 127.0.0.1:1080:1080 \
  -v zebbern-kali-tmp:/app/tmp \
  -v "$(pwd)/vpn:/vpn:ro" \
  zebbern-kali-mcp

Host networking: Native Docker Engine on Linux and the current Windows Docker Desktop 4.84 setup are qualified host-network platforms. Run:

docker compose -f docker-compose.yml -f docker-compose.host.yml up -d

On Docker Desktop 4.34 or later, enable host networking in Settings > Resources > Network and restart Docker Desktop before running the overlay. The current Windows Docker Desktop 4.84 setup is qualified with that opt-in. Desktop support is limited to TCP and UDP (layer 4), does not work with Enhanced Container Isolation, supports Linux containers only, and cannot bind a specific host-interface IP. Native Linux Docker Engine retains direct host-network semantics.

2. Add to VS Code (.vscode/mcp.json or global MCP config):

{
  "servers": {
    "kali-tools": {
      "command": "uvx",
      "args": ["zebbern-kali-mcp"]
    }
  }
}

Restart VS Code — done. uvx auto-downloads the MCP client from PyPI.

Docker is the supported install path. See the setup sections below for env vars, VPN/SOCKS proxy, image variants, and networking details.


MCP Tool Modules

17 MCP client modules in mcp_tools/, each with a corresponding Flask blueprint in zebbern-kali/api/blueprints/ and core logic in zebbern-kali/core/:

#ModuleDescription
1kali_toolsNmap, Nikto, Gobuster, Dirb, WPScan, SQLMap, Hydra, John, enum4linux, Subfinder, httpx, Arjun, Fierce, ssh-audit, FFuf, Nuclei, and more
2ad_toolsActive Directory attacks — netexec, BloodHound, impacket, certipy, bloodyAD, Kerberoasting, Pass-the-Hash, LDAP
3command_execArbitrary command execution on the Kali container
4ssh_managerSSH session lifecycle — connect, execute, tunnel, disconnect
5reverse_shellReverse shell listeners and session management
6metasploitMetasploit Framework integration — modules, sessions, exploits
7network_pivotChisel, Ligolo-ng, SSH tunnels, ProxyChains, SOCKS proxy
8vpnWireGuard & OpenVPN management with auto SOCKS5 proxy
9api_securityGraphQL introspection, JWT analysis, FFUF fuzzing
10web_fingerprinterTechnology detection and web fingerprinting
11exploit_suggesterExploit suggestion based on scan results
12payload_generatorPayload generation for various platforms
13file_operationsFile upload/download between host and container
14callback_catcherBuilt-in HTTP + DNS callback listener for isolated networks
15ctf_platformCTFd & rCTF API — challenges, flags, scoreboard
16hosts_management/etc/hosts management inside the container
17output_parserStructured parsing of tool output for AI consumption

The default auto profile starts with the complete full tool set. With a valid capability schema version 1 response, it omits only public tools explicitly reported as unavailable. Unknown, malformed, older, or unreachable capability data fails open and keeps the complete tool set. Discovery is a startup snapshot; restart the MCP client to refresh it.

auto omits any tool the manifest reports as unavailable, so the backend owns that list rather than the client keeping a parallel copy of it. Core tools are never omitted: command execution, file operations, host management and output parsing stay registered even if a manifest marks them unavailable. That floor exists because the two failure directions are not symmetric — a tool that is present but broken fails once and the agent adapts, while a tool wrongly hidden is invisible for the life of the process, since discovery is a startup snapshot. On a lean image this omits the persistent Metasploit session tools and the two msfvenom payload tools. Use a focused profile only when a smaller tool list helps the agent choose tools more reliably:

ProfileFocus
coreCommand execution, files, hosts, and output parsing
reconCore plus scanners, fingerprinting, and exploit suggestions
webCore plus web/API testing and callback capture
adCore plus AD, pivoting, SSH, shells, payloads, and VPN
ctfCore plus scanners, CTF platforms, payloads, shells, VPN, and callbacks
trimAll modules except callback_catcher and output_parser; 123 tools
fullAll 17 modules; complete operator override

The explicit profiles are core, recon, web, ad, ctf, trim, and full. Select one with --profile web or MCP_TOOL_PROFILE=web. Use --profile full to register every current MCP tool regardless of discovery results. An invalid profile fails during startup.

Excluding modules from any profile

--exclude-module (or MCP_EXCLUDE_MODULES) subtracts named modules from whichever profile is selected, so you can tune the surface without waiting for a new profile. Use it when another MCP server in your setup already covers a capability — a hosted webhook/interactsh service makes callback_catcher redundant, and an agent that parses stdout itself does not need output_parser.

zebbern-kali-mcp --profile web --exclude-module callback_catcher      # 57 tools
zebbern-kali-mcp --profile full --exclude-module callback_catcher,output_parser  # 123, same as trim
MCP_EXCLUDE_MODULES=callback_catcher zebbern-kali-mcp --profile ctf    # 75 tools

Names are case-insensitive and whitespace-tolerant; an unknown module name fails at startup with the full list of valid names. Exclusion composes with auto, applying after capability discovery.

trim is the full tool set minus the two modules that duplicate capabilities most MCP hosts already provide: callback_catcher (9 tools, overlapping hosted webhook/interactsh services) and output_parser (1 tool, duplicating the agent's own stdout parsing). It registers 123 of the 133 tools. Prefer full when the host has no webhook capability of its own, or when the engagement runs on an isolated network with no egress — the built-in callback listener is the only one that works there.


Installed Tools

The image installs the tools below. Core tool failures stop the build. Explicitly optional extras may be skipped with a warning; check /ready and the relevant tool-status endpoint for runtime availability.

Network Scanning

ToolDescription
nmapPort scanning, service/version detection, NSE scripts
masscanHigh-speed port scanner
sslscanSSL/TLS configuration analysis

Web Application Scanning

ToolDescription
niktoWeb server vulnerability scanner
gobusterDirectory/file/DNS brute-forcing
dirbWeb content scanner
wpscanWordPress vulnerability scanner
sqlmapAutomated SQL injection
ffufFast web fuzzer
nucleiTemplate-based vulnerability scanner
katanaWeb crawler (v1.1.0 pre-built binary)
amassAttack surface mapping
commixCommand injection exploitation
ghauriAdvanced SQL injection detection

Subdomain & DNS Enumeration

ToolDescription
subfinderPassive subdomain discovery
httpxHTTP probing and technology detection
assetfinderSubdomain discovery via various sources
waybackurlsFetch URLs from the Wayback Machine
amassDNS enumeration and network mapping
massdnsHigh-performance DNS resolver
fierceDNS reconnaissance
mapcidrCIDR range manipulation
subzySubdomain takeover checking

Brute Force & Password Cracking

ToolDescription
hydraNetwork login brute-forcer
johnJohn the Ripper password cracker
hashcatGPU-accelerated hash cracking

Active Directory

ToolDescription
netexecPrimary SMB/LDAP/WinRM tool (replaces crackmapexec)
impacket (0.13.0)Python AD attack toolkit — ~50 scripts symlinked as impacket-* in PATH (secretsdump, psexec, wmiexec, etc.)
bloodhound.pyAD relationship graphing — data collector
bloodyADAD privilege escalation framework
certipy-adAD Certificate Services (ADCS) exploitation
responderLLMNR/NBT-NS/MDNS poisoner
evil-winrmWinRM shell with upload/download
krbrelayxKerberos relay and delegation abuse
gMSADumperGroup Managed Service Account password dumper
PetitPotamNTLM relay coercion via EFS RPC
coercerCoerce Windows authentication
dementorSpoolService abuse for relay attacks
winrmexecWinRM command execution
pywhiskerShadow Credentials attack tool
ldapdomaindumpLDAP domain information dumper

Exploitation

ToolDescription
metasploit-frameworkFull Metasploit Framework
commixCommand injection exploitation
ghauriAdvanced SQL injection
dalfoxXSS scanning and exploitation
byp4xx403 Forbidden bypass techniques
exploitdbExploit database (searchsploit)

JavaScript Analysis

ToolDescription
getJSExtract JavaScript files from pages
jsluiceExtract URLs, paths, and secrets from JS
xnLinkFinderLink and parameter discovery from JS
SecretFinderFind API keys and secrets in JS files
TruffleHogSecret scanning across repos and files
js-beautifyJavaScript deobfuscation/beautification
webcrackWebpack bundle unpacking (npm)
ParamSpiderParameter discovery from web archives

API Testing

ToolDescription
jwt-toolJWT token analysis and exploitation
graphw00fGraphQL engine fingerprinting
clairvoyanceGraphQL schema introspection

Proxy & Interception

ToolDescription
mitmproxyScriptable HTTP/HTTPS proxy (mitmdump)
OWASP ZAPAutomated web app security scanner (zaproxy)
CaidoOptional modern web proxy (CLI); readiness key: caido-cli

Forensics & CTF

ToolDescription
binwalkFirmware analysis and file extraction
steghideSteganography tool
stegseekFast steghide cracker (wordlist-based)
zstegPNG/BMP steganography detector (Ruby)
exiftoolMetadata reader/writer
foremostFile carving/recovery
volatility3Memory forensics framework (Python)
sleuthkitDisk forensics — mmls, fls, icat, blkcat
gdbGNU Debugger
radare2Reverse engineering framework (disassembly, debugging, patching)
imagemagickImage manipulation and analysis
tesseract-ocrOptical character recognition

Binary Analysis (Python)

ToolDescription
angrBinary analysis framework
pwntoolsCTF exploitation library

Crypto & Math (Python)

ToolDescription
pycryptodomeCryptographic primitives
gmpy2High-precision math
z3-solverSMT constraint solver
sympySymbolic mathematics
SageMathNot bundled in the current Kali rolling image
RsaCtfToolRSA attack automation (/opt/RsaCtfTool/)
cado-nfsInteger factorization for large keys (/opt/cado-nfs/)

Networking

ToolDescription
scapyPacket crafting and sniffing (Python)
tcpdumpPacket capture
socatMultipurpose relay / socket tool
netcatTCP/UDP networking utility
proxychains4Proxy routing for arbitrary tools
openvpnVPN client
wireguard-toolsWireGuard VPN

Pivoting

ToolDescription
chiselTCP/UDP tunnel over HTTP (Go binary + Windows .exe in /opt/windows-tools/)
ligolo-ng (v0.7.5)Tunneling — proxy + agents for Linux & Windows (in /opt/ligolo-ng/)
socatPort forwarding and relay

Privilege Escalation

ToolDescriptionLocation
LinPEASLinux privilege escalation audit script/opt/privesc-tools/linpeas.sh
WinPEASWindows privilege escalation audit (x64, x86, .bat)/opt/privesc-tools/
MimikatzWindows credential extraction/opt/windows-tools/mimikatz/
RunasCs.exeWindows runas with explicit credentials/opt/windows-tools/RunasCs.exe

Tunneling & Remote Access

ToolDescription
cloudflaredOptional Cloudflare Tunnel client; readiness key: cloudflared
ngrokInstant public URLs for local services

Media & Containers

ToolDescription
ffmpegAudio/video processing and conversion
soxSound processing and analysis (+ all format plugins)
podmanRootless container engine (needs --privileged at runtime)
numpyNumerical computing (Python)
scipyScientific computing (Python)

Callback Catcher

A custom built-in HTTP + DNS callback listener for isolated networks where external services like webhook.site can't reach your targets. Managed via the callback_catcher MCP module.

The default listeners use TCP 8888 and UDP 5353. A target can reach them directly through a VPN interface inside the container or with Linux host networking. In bridge mode, publish the selected callback ports on an address reachable by the target, for example 8888:8888/tcp and 5353:5353/udp; these ports are not published by default.

Browser Automation

ToolDescription
Playwright (Chromium)Headless browser for SPA testing, screenshots, JS-rendered pages

Wordlists

Pre-installed: rockyou.txt (decompressed), SecLists, and symlinked wordlists at /usr/share/wordlists/dirb/ for tool compatibility.


Python Dependencies

From requirements.txt — installed inside the container:

Flask, Werkzeug            # API server
requests                   # HTTP client
paramiko                   # SSH
mcp                        # MCP protocol (client)
playwright                 # Browser automation
pwntools                   # Binary exploitation
sympy, gmpy2               # Math
pycryptodome, z3-solver    # Crypto & SMT solving
angr                       # Binary analysis
scapy                      # Packet crafting
Pillow                     # Image processing (stego)
beautifulsoup4             # HTML parsing
impacket==0.13.0           # AD attacks (pinned)
ldapdomaindump, pywinrm    # AD support
pexpect                    # Terminal automation
python-dotenv              # Environment config

Additional pip packages installed during build: bloodyAD, certipy-ad, bloodhound, pywhisker, coercer, fierce, arjun, dementor, commix, ghauri, jwt-tool, graphw00f, clairvoyance, xnLinkFinder, paramspider, mitmproxy, waymore, ssh-audit, volatility3, numpy, scipy.


Configuration

Environment Variables

VariableDefaultDescription
API_PORT5000Flask server port
API_BIND_ADDRESS127.0.0.1Host address used by the Compose API port publication
API_LISTEN_HOST0.0.0.0API listener inside bridge mode; host-network mode defaults to 127.0.0.1
DEBUG_MODE0Enable debug logging
KALI_API_TOKENOptional shared API token; required on /api/* only when configured
REQUIRED_TOOLSComma-separated binaries that must exist for /ready to return ready
JOB_MAX_COUNT256Maximum retained background jobs
JOB_OUTPUT_MAX_LINES2000Maximum retained output events per job
JOB_OUTPUT_MAX_CHARS2097152Maximum retained output characters per job
JOB_OUTPUT_MAX_LINE_CHARS4096Maximum retained characters per output event
JOB_INPUT_MAX_BYTES65536Maximum input bytes accepted per job request
JOB_INPUT_QUEUE_SIZE16Maximum queued input requests per job
JOB_OUTPUT_MAX_WAIT30Maximum long-poll wait for job output
CTF_MAX_DOWNLOAD_BYTES104857600Maximum CTF file download size; calls can request a lower limit
HTB_ROUTESComma-separated CIDRs to route (e.g. 10.129.0.0/16,10.10.0.0/16)
EXTRA_HOSTSComma-separated hostname:ip pairs added to /etc/hosts
VPN_DIR./vpnHost directory mounted at /vpn (read-only) for VPN configs
SOCKS_BIND_ADDRESS127.0.0.1Host address used by the Compose SOCKS port publication
SOCKS_PORT1080Published host SOCKS port
SOCKS_LISTEN_HOST0.0.0.0SOCKS listener inside bridge mode; host-network mode defaults to 127.0.0.1
KALI_API_URLhttp://127.0.0.1:5000MCP client: URL of the Kali Flask server
MCP_TOOL_PROFILEautoMCP profile: auto (capability-aware default), core, recon, web, ad, ctf, trim, or full
MCP_EXCLUDE_MODULES(empty)Comma-separated tool modules to drop from the selected profile, e.g. callback_catcher,output_parser
INCLUDE_METASPLOITtrueBuild argument: true creates the full default; false creates lean
INCLUDE_CADO_NFStrueBuild argument: capability default; false is a faster development build without only CADO-NFS

Docker Compose

# Standard (bridge networking, port-mapped)
docker compose up -d

# Host networking (qualified on native Linux Docker Engine and Windows Docker Desktop 4.84)
docker compose -f docker-compose.yml -f docker-compose.host.yml up -d

# Lean qualified variant; both qualified variants include CADO-NFS
INCLUDE_METASPLOIT=false INCLUDE_CADO_NFS=true docker compose build

# Faster development build without only CADO-NFS
INCLUDE_CADO_NFS=false docker compose build

The Compose build defaults are INCLUDE_METASPLOIT=true and INCLUDE_CADO_NFS=true. Both qualified full and lean variants include CADO-NFS. When INCLUDE_CADO_NFS=true, source retrieval, build, or executable verification failure stops the image build. Setting it to false intentionally removes only CADO-NFS.

The Kali base image, Go modules, Git sources, and moving standalone downloads are pinned. Kali rolling APT packages and Python transitive dependency resolution are not bit-identical snapshots.

The compose file grants NET_RAW + NET_ADMIN capabilities and provides /dev/net/tun for VPN and Ligolo support. In bridge mode, API and SOCKS publications bind to loopback. In host-network mode, both services listen on loopback. Native Linux Docker Engine and the current Windows Docker Desktop 4.84 setup are qualified. Docker Desktop requires version 4.34 or later, an explicit host-networking opt-in and restart, and Linux containers; it supports TCP and UDP only, cannot use Enhanced Container Isolation, and cannot bind a specific host-interface IP. Native Linux Docker Engine retains direct host-network semantics. Set the corresponding bind or listen variable when another host must connect.

For a remote API, set the same KALI_API_TOKEN value in the backend and MCP client environments. You can also pass --api-token to the MCP client. Direct REST clients send this value in the X-API-Key header. Health endpoints remain unauthenticated for Docker and orchestrator checks.

Updating pinned build inputs

  1. Resolve an authoritative upstream version or commit.
  2. Update one Docker argument and its checksum when present.
  3. Run Docker contract tests and docker build --check ..
  4. Build full and lean with CADO-NFS enabled.
  5. Run image, bridge, AD, native Linux host-network, and current Windows Docker Desktop host-network smoke.
  6. Compare tool names, image IDs/sizes, and common layers before accepting the update.

Live qualification fixtures

Run the qualified fixtures against the specified locally built images:

python tests/integration/run_smoke.py --image zebbern-kali-mcp:goal-full --network-mode bridge --expect-variant full
python tests/integration/run_ad_lab.py --image zebbern-kali-mcp:goal-lean
python tests/integration/run_smoke.py --image zebbern-kali-mcp:goal-full --network-mode host --expect-variant full

Add --check-trim to any run_smoke.py invocation to additionally assert the live trim pro

Files in the repo

Repository payload22 top-level entries
  • .github
  • .vscode
  • docker
  • mcp_tools
  • scripts
  • tests
  • vpn
  • zebbern-kali
  • .dockerignore
  • .gitignore
  • .pylintrc
  • CLAUDE.md
  • docker-compose.host.yml
  • docker-compose.yml
  • Dockerfile
  • entrypoint.sh
  • LICENSE
  • mcp_server.py
  • pyproject.toml
  • README.md
  • requirements.txt
  • scratch_plan_tail.txt

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k

x64dbg-MCP Server is a native MCP (Model Context Protocol) plugin for x64dbg that exposes the debugger's full functionality over HTTP. Connect any MCP-compatible AI assistant and control x64dbg programmatically: set breakpoints, step through code, read memory, dump registers, and more. Built with Zig — zero dependencies, single-binary output, cros

1.9k

Minimal Coding Agent Harness on MCP for ChatGPT, Claude, Hermes, Grok Bot, OpenClaw

4.6k