PenTest MCP
# ๐ก๏ธ PenTest MCP
**AI-Powered Security Scanning via Model Context Protocol (MCP)**
PenTest MCP is a specialized MCP server that exposes 25+ professional security tools to AI agents like Claude Desktop. It enables security researchers and developers to orchestrate penetration testing through natural language, automating complex tool chains and generating professional reports.
[](https://www.python.org/)
[](https://modelcontextprotocol.io/)
[](LICENSE)
---
## ๐ Quick Start (Claude Desktop)
1. **Install dependencies:**
```bash
pip install -e .
```
2. **Configure Claude Desktop:**
Add the following to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"pentest": {
"command": "python3",
"args": [
"-m",
"pentest_mcp.mcp_server"
],
"cwd": "/absolute/path/to/pentest-mcp"
}
}
}
```
3. **Restart Claude Desktop** and start scanning:
- "Initialize a security assessment for http://localhost:3001"
- "Run a quick scan on http://localhost:3001 with consent"
- "Check if the site has a WAF"
- "Generate the final security report"
---
- **Claude Desktop Integration** - Full orchestration via the Model Context Protocol.
- **25+ Security Tools** - Including `nmap`, `sqlmap`, `nuclei`, `ffuf`, `nikto`, `testssl`, and more.
- **Natural Language Orchestration** - Ask security questions, Claude picks the right tools.
- **Preset Scan Modes** - Quick Triage and Extensive Assessment modes.
- **AI-Generated Reports** - Professional markdown reports powered by Gemini AI.
- **CVE Enrichment** - Findings are automatically cross-referenced with CVE data.
---
## ๐ ๏ธ Supported Tools (25)
| Category | Tools |
|----------|-------|
| **Reconnaissance** | `subfinder`, `wafw00f`, `nmap`, `whatweb`, `amass`, `dnsrecon`, `theharvester` |
| **Vulnerability Scanning** | `nuclei`, `sqlmap`, `dalfox`, `nikto`, `retire`, `commix`, `corscanner`, `graphql_cop` |
| **Web Fuzzing** | `ffuf`, `gobuster`, `wfuzz`, `arjun` |
| **TLS/SSL** | `sslyze`, `testssl` |
| **Advanced/OSINT** | `masscan`, `trufflehog`, `git_dumper`, `jwt_tool` |
---
## ๐ง Installation & Setup
### Prerequisites
- Python 3.11+
- [Gemini API Key](https://aistudio.google.com/apikey) (for reports and analysis)
- (Recommended) External tools installed: `nmap`, `sqlmap`, `ffuf`, `nuclei`, etc.
### Configuration
Create a `.env` file in the project root:
```bash
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-flash-lite-latest
```
---
## ๐ Project Structure
```
pentest-mcp/
โโโ pentest_mcp/
โ โโโ mcp_server.py # Main MCP server entry point
โ โโโ scan_modes.py # Quick & Extensive scan logic
โ โโโ session.py # Session & DB management
โ โโโ report_engine.py # AI report generation
โ โโโ llm_providers.py # Gemini API integration
โ โโโ tools/ # Tool wrappers & logic
โ โโโ models.py # Pydantic data models
โโโ vulnerable-app/ # Local test target (Node.js)
โโโ reports/ # Generated scan reports
โโโ pyproject.toml # Project dependencies
```
---
## ๐ Security Notice
**This tool is for authorized security testing only.**
- Always obtain explicit written permission before scanning any target.
- Unauthorized testing is illegal and unethical.
- The `consent` flag is a mandatory requirement for all active scanning tools.
---
**Built with** ๐ Python ยท ๐ง Gemini AI ยท ๐ก๏ธ MCP
TDQS
Scored across 31 tools
Many tools have overlapping purposes: nmap/masscan both scan ports, sslyze/testssl both audit TLS, ffuf/gobuster/wfuzz all fuzz for directories, and subfinder/amass/dnsrecon all do subdomain/DNS enumeration. The descriptions are lean and don't clarify when to choose one over the other.
The tool names are a mix of raw external tool names (nmap, sqlmap, gobuster) and server-specific snake_case verbs (init_session, get_report, quick_scan). This makes the naming pattern unpredictable and inconsistent across the API surface.
31 tools is too many for a focused MCP server, especially when several are near-duplicates (subfinder/amass/dnsrecon, ffuf/gobuster/wfuzz, sslyze/testssl). A consolidated surface with fewer, higher-level scan operations would be easier for an agent to use.
The server covers reconnaissance, scanning, web fuzzing, TLS testing, secret detection, and report generation, which is solid for web-focused pentesting. However, session lifecycle support is thin (init_session/get_report only) and there are no explicit post-exploitation or broader infrastructure testing tools, leaving noticeable gaps for a general 'PenTest' role.