Skip to content

Vasanthadithya-mundrathi/Pentest-MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‰ Pentest-MCP: Autonomous Penetration Testing Agent

Kali Linux MCP Protocol HexStrike AI License: MIT

A production-grade Model Context Protocol (MCP) server for autonomous penetration testing, featuring intelligent tool routing and the "Blood-Red" HexStrike AI engine.


οΏ½ Table of Contents


οΏ½πŸš€ Overview

This project provides a fully dockerized autonomous pentesting environment that exposes powerful security tools to AI agents (like Claude, Cline, or your own LLM) via the Model Context Protocol (MCP).

It integrates Kali Linux tools with HexStrike AI, a specialized offensive intelligence engine that manages 150+ tools, optimizing parameters and strategies in real-time.


✨ Features

Category Capabilities
Autonomous Recon Smart sub-domain enumeration, technology detection, attack surface mapping
Intelligent Exploitation Auto-routing complex tasks (SQLi, XSS) to HexStrike for deep analysis
AngularJS Sandbox Escapes Specialized payloads for modern web framework exploitation
Stateful Operations Persistent sessions for multi-step exploits (Store-then-Deliver attacks)
Universal Bridge Works with any MCP-compliant client (Claude Desktop, VS Code/Cline, Zed)
150+ Security Tools Nmap, SQLMap, Nikto, Masscan, Gobuster, Hydra, and more via HexStrike

πŸ—οΈ Architecture

The system uses a Unified Gateway architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   AI Client     β”‚ ───▢ β”‚   kali-mcp       β”‚ ───▢ β”‚   hexstrike-mcp    β”‚
β”‚ (Claude/Cline)  β”‚      β”‚   (Gateway)      β”‚      β”‚   (150+ Tools)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                      β”‚  Local Kali      β”‚
                      β”‚  Tools (Fallback)β”‚
                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. AI Client sends request to kali-mcp.
  2. ToolExecutor analyzes the request.
  3. If complex (e.g., sqlmap) β†’ Routes to HexStrike AI container.
  4. If simple or HexStrike unavailable β†’ Executes locally on Kali.

πŸ“‹ Prerequisites

  • Docker: v20.10+
  • Docker Compose: v2.0+
  • Python: 3.10+ (for local test scripts)
  • Git: For cloning the repository

βš™οΈ Installation

Step 1: Clone the Repository

git clone https://github.com/Vasanthadithya-Mundrathi/Pentest-MCP.git
cd Pentest-MCP

Step 2: Understand the Docker Base Images

This project uses the following Docker images:

Container Base Image Purpose
kali-mcp kalilinux/kali-rolling MCP Server, core security tools
hexstrike-mcp kalilinux/kali-rolling HexStrike AI engine (150+ tools)

Note: The kalilinux/kali-rolling image is the official, minimal Kali Linux Docker image. It does not include a GUI. For more information, see the Official Kali Linux Docker Documentation.

Step 3: Build and Start the Environment

docker-compose up -d --build

This command builds both containers and starts them in the background.

Step 4: Verify Running Containers

docker ps

You should see two containers running:

  • kali-mcp on port 8000
  • hexstrike-mcp on port 8001 (internal: 8888)

πŸ”Œ Connecting Your AI

Claude Desktop

Add this to your claude_desktop_config.json:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "kali-mcp": {
      "command": "docker",
      "args": ["exec", "-i", "kali-mcp", "python3", "/app/stdio_bridge.py"]
    }
  }
}

Cline (VS Code Extension)

  1. Open Cline Settings β†’ MCP Servers tab.
  2. Click "Edit MCP Settings".
  3. Paste the configuration above.

For more details, see CONNECT_LOCALLY.md.


⚑ Usage

Once connected, your AI assistant has access to these tools:

Tool Description
recon_target Full network & web reconnaissance
web_exploit Targeted XSS/SQLi/CSTI exploitation
run_command_sync Quick shell commands (ls, whoami)
start_job / check_job_status Long-running background scans

Example Prompts

"Use kali-mcp to scan example.com for vulnerabilities."
"Run web_recon on https://target.com and identify all parameters."
"Test https://target.com?search=test for XSS vulnerabilities."

For a complete guide, see MCP_SETUP_GUIDE.md.


πŸ“‚ Project Structure

Pentest-MCP/
β”œβ”€β”€ README.md               # You are here
β”œβ”€β”€ MCP_SETUP_GUIDE.md      # Detailed usage guide
β”œβ”€β”€ CONNECT_LOCALLY.md      # AI client connection instructions
β”œβ”€β”€ docker-compose.yml      # Container orchestration
β”œβ”€β”€ kali/                   # Kali MCP server source
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ mcp_server.py       # FastAPI MCP server
β”‚   β”œβ”€β”€ stdio_bridge.py     # MCP stdio protocol handler
β”‚   └── skills/             # Autonomous skill modules
β”‚       β”œβ”€β”€ recon_skill.py
β”‚       β”œβ”€β”€ web_recon_skill.py
β”‚       β”œβ”€β”€ web_exploitation_skill.py
β”‚       └── tool_executor.py  # Intelligent routing
β”œβ”€β”€ hexstrike/              # HexStrike AI integration
β”‚   └── Dockerfile
β”œβ”€β”€ docs/                   # Additional documentation
└── tests/                  # Test scripts and utilities

πŸ™ Credits & Acknowledgements

This project stands on the shoulders of giants:


βš–οΈ License & Disclaimer

License: MIT License

⚠️ Legal Disclaimer

FOR EDUCATIONAL AND AUTHORIZED PENTESTING PURPOSES ONLY.

This tool is designed for security professionals, ethical hackers, and researchers. You are solely responsible for your actions. Use of this tool against targets without prior mutual consent is illegal. The authors assume absolutely no liability for misuse or any damages that may arise.

By using this software, you agree to:

  1. Obtain proper authorization before testing any system.
  2. Comply with all applicable local, state, national, and international laws.
  3. Use this tool responsibly and ethically.

Built with ❀️ by Vasanthadithya

About

πŸ‰ Autonomous Penetration Testing Agent powered by MCP (Model Context Protocol) with Kali Linux and HexStrike AI integration. Exposes 150+ security tools to AI assistants for intelligent vulnerability assessment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors