The Pentest-MCP server provides autonomous penetration testing capabilities through the Model Context Protocol (MCP). It includes network reconnaissance, web application testing, and vulnerability exploitation tools optimized for AI agents.
cd Pentest-MCP
docker-compose up -dVerify it's running:
docker ps | grep kali-mcp
# Should show: kali-mcp running on port 8000Add 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"],
"timeout": 600
}
}
}Restart Claude Desktop completely (not just reload).
Add to ~/.cline/data/settings/cline_mcp_settings.json:
{
"mcpServers": {
"kali-mcp": {
"command": "docker",
"args": ["exec", "-i", "kali-mcp", "python3", "/app/stdio_bridge.py"],
"timeout": 600,
"autoApprove": ["recon"]
}
}
}Restart Cline extension.
Add to your project's .zed/settings.json:
{
"mcp": {
"kali-pentest": {
"command": "docker",
"args": ["exec", "-i", "kali-mcp", "python3", "/app/stdio_bridge.py"]
}
}
}Purpose: Complete web application reconnaissance
Arguments:
target_url(required): Target URL to scandepth(optional): Scan depth -"quick","standard", or"deep"
Returns:
- Detected frameworks (AngularJS, React, Vue, WordPress)
- Parameters (GET/POST/form inputs)
- JavaScript files and secrets
- Attack surface analysis with prioritized vectors
Example:
{
"name": "web_recon",
"arguments": {
"target_url": "https://example.com",
"depth": "quick"
}
}Purpose: Test for web vulnerabilities
Arguments:
target_url(required): Target URLattack_types(optional): Array of["xss", "sqli", "template"]recon_data(optional): Previous reconnaissance results
Capabilities:
- XSS (Reflected/Stored/DOM)
- AngularJS sandbox escape
- CSP bypass techniques
- SQL injection detection
- Template injection (CSTI/SSTI)
Purpose: Network reconnaissance and port scanning
Arguments:
target(required): IP address or hostnamepassive_only(optional): Boolean for passive-only scanning
Returns: Open ports, running services, OS detection, attack surface map
Purpose: Full penetration test workflow
Arguments:
target(required): Target IP/hostnamescope(optional): Array of in-scope targets
Returns: Complete pentest report with all phases
Execute commands directly in Kali container:
{
"name": "run_command_sync",
"arguments": {
"command": "nmap -sV example.com"
}
}
⚠️ WARNING: This tool is stateless. Multi-step web interactions requiring session/cookies will fail. Use a Python script withrequests.Session()for stateful workflows.
For long-running background tasks.
Objective: Detect AngularJS and test for XSS with sandbox escape
Use kali-mcp web_recon to analyze https://your-lab.web-security-academy.net/
Expected Output:
{
"frameworks_detected": ["AngularJS"],
"parameters_discovered": [{"name": "search", "type": "GET"}],
"attack_surface": [{
"type": "Client-Side Template Injection (CSTI)",
"priority": "CRITICAL",
"payloads": ["{{constructor.constructor('alert(document.cookie)')()}}"]
}]
}Use kali-mcp recon_target to scan 10.10.10.50
First use kali-mcp web_recon on https://target.com,
then use web_exploit to test all vulnerabilities found
Fix: Completely restart your MCP client (Claude/Cline), don't just reload.
docker-compose up -d
docker logs kali-mcp # Check for errorsecho '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' | \
docker exec -i kali-mcp python3 /app/stdio_bridge.pyExpected:
{"jsonrpc": "2.0", "id": 1, "result": {"protocolVersion": "2024-11-05", ...}}Working Payloads:
{{constructor.constructor('alert(document.cookie)')()}}
{{constructor.constructor('alert(1)')()}}
{{$on.constructor('alert(1)')()}}'
' OR '1'='1
1' AND 1=1--
' UNION SELECT NULL--- Only use on authorized targets - This is a penetration testing tool
- Container is privileged - Has NET_ADMIN capabilities for network testing
- Credentials - No hardcoded credentials; uses parameter-based testing
- Logging - All actions logged to Docker logs
| Category | Coverage |
|---|---|
| Web XSS | ✅ Reflected, Stored, DOM, AngularJS |
| Web SQLi | ✅ Error-based detection |
| Web Template Injection | ✅ CSTI (AngularJS), SSTI |
| Network Recon | ✅ Port scanning, service enum |
| Network Exploit | 🔄 Coming soon (Metasploit) |
| Binary Pwn | 📋 Planned |
| Forensics | 📋 Planned |
| Crypto | 📋 Planned |
Last Updated: 2026-01-13
Version: 1.3
Status: Production Ready ✅