A production-grade Model Context Protocol (MCP) server for autonomous penetration testing, featuring intelligent tool routing and the "Blood-Red" HexStrike AI engine.
- π Pentest-MCP: Autonomous Penetration Testing Agent
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.
| 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 |
The system uses a Unified Gateway architecture:
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββββ
β AI Client β ββββΆ β kali-mcp β ββββΆ β hexstrike-mcp β
β (Claude/Cline) β β (Gateway) β β (150+ Tools) β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β Local Kali β
β Tools (Fallback)β
ββββββββββββββββββββ
- AI Client sends request to
kali-mcp. - ToolExecutor analyzes the request.
- If complex (e.g.,
sqlmap) β Routes to HexStrike AI container. - If simple or HexStrike unavailable β Executes locally on Kali.
- Docker: v20.10+
- Docker Compose: v2.0+
- Python: 3.10+ (for local test scripts)
- Git: For cloning the repository
git clone https://github.com/Vasanthadithya-Mundrathi/Pentest-MCP.git
cd Pentest-MCPThis 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-rollingimage is the official, minimal Kali Linux Docker image. It does not include a GUI. For more information, see the Official Kali Linux Docker Documentation.
docker-compose up -d --buildThis command builds both containers and starts them in the background.
docker psYou should see two containers running:
kali-mcpon port8000hexstrike-mcpon port8001(internal:8888)
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"]
}
}
}- Open Cline Settings β MCP Servers tab.
- Click "Edit MCP Settings".
- Paste the configuration above.
For more details, see CONNECT_LOCALLY.md.
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 |
"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.
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
This project stands on the shoulders of giants:
- HexStrike AI by @0x4m4: The "Blood-Red" offensive intelligence engine providing 150+ integrated security modules.
- Kali Linux by Offensive Security: The industry-standard penetration testing distribution.
- Model Context Protocol (MCP): The open standard enabling AI-tool interoperability.
- PortSwigger Web Security Academy: For providing the labs used to test and validate exploitation payloads.
License: MIT License
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:
- Obtain proper authorization before testing any system.
- Comply with all applicable local, state, national, and international laws.
- Use this tool responsibly and ethically.
Built with β€οΈ by Vasanthadithya