HP

halilkirazkaya/pentester-mcp

Developer tools
63 stars 9 forks Quality 77 Trend 15MIT

Empower your AI assistants with the ultimate open-source penetration testing arsenal.

Overview

Empower your AI assistants with the ultimate open-source penetration testing arsenal.

README

Pentester-MCP

Empower your AI assistants with the ultimate open-source penetration testing arsenal.

Overview

Pentester-MCP provides Model Context Protocol (MCP) integration for over 200 of the most popular open-source cybersecurity and penetration testing tools.

By adding Pentester-MCP to an AI assistant (like Claude Desktop, Cursor, or specialized agents), the AI gains the autonomous ability to act as a penetration tester:

  • It can run nmap scans, analyze open ports, and automatically decide to run ffuf on discovered web servers.
  • It can execute sqlmap against parameters it identifies as vulnerable.
  • It understands tool arguments, required flags, and syntaxes thanks to AI-optimized documentation strings injected into every MCP tool.

All 217 Python *_mcp.py tools were generated intelligently from cheat sheets to ensure safe execution (e.g., preventing shell injection, enforcing timeouts, and handling huge terminal outputs).

The Arsenal

The tools/ directory includes MCP servers for almost every category:

  • Reconnaissance: nmap, masscan, recon-ng, amass, subfinder, nuclei
  • Web Exploitation: sqlmap, commix, ffuf, gobuster, dirsearch, nikto
  • Active Directory & Network: impacket (full suite), bloodhound, responder, evil-winrm
  • Brute-Forcing & Password: hydra, medusa, john, hashcat, nxc
  • And 180+ more covering WiFi, Cloud, Kubernetes, and reversing.

Installation & Usage

Because of the massive amount of tools, installing everything on your host machine can be messy. Therefore, Pentester-MCP offers two primary ways to run: Docker Sandbox (Recommended) and Local Execution. Both use uv for dependency management — the project is defined in pyproject.toml, locked in uv.lock, and everything lives under src/.

The sandbox is based on Exegol — a well-known, curated set of Docker build recipes for pentesters (shell history, wordlists, custom tool configs). Exegol’s prebuilt Docker Hub tags are stale (frozen at v3.1.6 while upstream is at 3.2), so Pentester-MCP builds Exegol from source: the src/exegol-images git submodule pins the upstream recipe tree, and each src/docker/Dockerfile. runs Exegol’s own entrypoint.sh package installers on top of debian:13-slim. You always get the current Exegol tree — update it with one command and rebuild:

git submodule update --remote src/exegol-images

Variant images live in src/pentester_mcp/docker/ (Dockerfile.) with a matching compose file in src/pentester_mcp/compose-files/ per profile:

Variant Exegol packages Focus Suggested config
example-kali (default) (none) thin Kali base, you pick tools via apt in the Dockerfile — fastest way to try Pentester-MCP pick your own
web base + web + cracking + code analysis web app security web-config.yaml
ad base + ad + c2 + network Active Directory / internal ad-config.yaml
light base + package_most_used essentials only, fastest build pick your own
osint base + osint OSINT recon-config.yaml
full all package_* installers every supported tool any

Build time warning: building Exegol from source compiles the whole toolkit — expect hours and a multi-GB image (light is the fastest). Docker layer caching makes later rebuilds incremental.

The MCP_CONFIG_PATH in each compose file controls which tool wrappers are exposed to the AI; the image determines which binaries are installed. Exposed-but-missing tools simply return a FileNotFoundError the AI can report.

  1. Clone with submodules and select your tools (src/pentester_mcp/configs/*.yaml):

    git clone --recurse-submodules https://github.com/halilkirazkaya/pentester-mcp.git
    cd pentester-mcp
    
  2. Build and Run the Sandbox:

    docker compose -f src/pentester_mcp/compose-files/docker-compose.example-kali.yml up -d --build
    

    For another profile, e.g. web:

    docker compose -f src/pentester_mcp/compose-files/docker-compose.web.yml up -d --build
    

    Your container is now running silently in the background.

  3. Add to your AI Client: Open your MCP client’s configuration (e.g., claude_desktop_config.json) and copy a snippet from src/pentester_mcp/mcp-config-files/.


Method B: Local Execution (Fastest Setup)

If you already have Kali Linux, Parrot OS, or you specifically only want to use the tools already installed on your host system:

  1. Clone and Install with uv:

    git clone https://github.com/halilkirazkaya/pentester-mcp.git
    cd pentester-mcp
    uv sync
    uv run pentester-mcp                                    # default config (example)
    uv run pentester-mcp src/pentester_mcp/configs/web-config.yaml
    uv run python -m pentester_mcp.server src/pentester_mcp/configs/ad-config.yaml
    
  2. Add to your AI Client: Point your MCP client at the console script (.venv/bin/pentester-mcp) or run python -m pentester_mcp.server from your local environment. The active tool set is chosen by (in order): the config path argument, MCP_CONFIG_PATH, or the default src/pentester_mcp/configs/example-config.yaml.

    Note: If the tool binary (e.g., nmap or gobuster) is not installed on your host system, the AI will gracefully receive a FileNotFoundError and inform you.


🔧 Configuring MCP Clients (Claude, Cursor, etc.)

Unlike legacy setups requiring you to register a server per tool out of 217 options, Pentester-MCP now uses a Unified Server Architecture.

  1. Define which tools you want available by editing a configuration file in src/pentester_mcp/configs/ (e.g., example-config.yaml).

  2. Add the single Unified Server to your Claude/Cursor configuration. Ready-to-use MCP client snippets live in src/pentester_mcp/mcp-config-files/ in two sets — same eight tool configs each, one file per tool config:

    • docker/ — runs the server inside the running pentester-mcp container (docker exec ... uv run --no-sync --project /app pentester-mcp configs/.yaml). For use with Method A.
    • local/ — runs the server directly on your host with uv (uv run --no-sync --directory pentester-mcp src/pentester_mcp/configs/.yaml). For use with Method B; replace the /path/to/pentester-mcp placeholder with your clone’s path and run uv sync once first.
    File (in both docker/ and local/) Starts the server with Tools exposed
    mcp-config.json example-config.yaml starter 18-toolkit
    mcp-config.full.json full-config.yaml everything (217)
    mcp-config.web.json web-config.yaml web only
    mcp-config.ad.json ad-config.yaml AD only
    mcp-config.recon.json recon-config.yaml recon only
    mcp-config.pwd.json pwd-config.yaml password attacks
    mcp-config.exploit.json exploit-config.yaml exploitation/C2
    mcp-config.misc.json misc-config.yaml misc/scanning

    Multiple snippets can coexist in one MCP client (distinct mcpServers keys: pentester_mcp, pentester_mcp_web, …), letting the AI pick the right toolset per task. Don’t register the docker/ and local/ version of the same profile together — they use the same server keys.

Claude Desktop Example

Simply copy the contents of src/pentester_mcp/mcp-config-files/docker/mcp-config.json (Method A) or src/pentester_mcp/mcp-config-files/local/mcp-config.json (Method B) into your claude_desktop_config.json file. The docker one looks like this:

{
  "mcpServers": {
    "pentester_mcp": {
      "command": "docker",
      "args": [
        "exec",
        "-i",
        "pentester-mcp",
        "uv",
        "run",
        "--no-sync",
        "--project",
        "/app",
        "pentester-mcp",
        "configs/example-config.yaml"
      ]
    }
  }
}

WARNING: The snippets use docker exec -i pentester-mcp, targeting the running Docker container named pentester-mcp. Ensure the container is running (e.g. docker compose -f src/pentester_mcp/compose-files/docker-compose.example-kali.yml up -d) before using the AI assistant. The configs/.yaml argument is the path inside the container; the same files live locally under src/pentester_mcp/configs/.


Contributing & Architecture

The Python scripts in the src/pentester_mcp/tools/ directory are auto-generated from YAML cheat sheets to guarantee consistent API design (proper timeouts, truncating outputs to >8000 chars, no shell=True vulnerabilities). Only security- and pentest-specific tools are included; generic sysadmin utilities are intentionally excluded (the kubectl wrapper is kept for Kubernetes attack-surface checks like RBAC enumeration and secret viewing).

If you have a request for a new tool to be added, please feel free to open an issue.


Disclaimer

Legal Disclaimer: This project is created strictly for educational purposes, authorized auditing, and ethical hacking. The developers of Pentester-MCP assume no liability and are not responsible for any misuse or damage caused by this software. Never use these tools against environments you do not own or do not have explicit, written permission to test.

Star History

View the full README on GitHub

Install

docker exec -i pentester-mcp uv run --no-sync --project /app pentester-mcp configs/example-config.yaml
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "pentester_mcp": { "command": "docker", "args": [ "exec", "-i", "pentester-mcp", "uv", "run", "--no-sync", "--project", "/app", "pentester-mcp", "configs/example-config.yaml" ] } } }