# ๐Ÿ›ก๏ธ Pentest-MCP **A Production-Ready Penetration Testing Toolkit for AI Agents** Pentest-MCP is a powerful, enterprise-grade framework that exposes penetration testing tools to Large Language Models (LLMs) through both REST API and Model Context Protocol (MCP). Built with Docker containerization, intelligent caching, and comprehensive security policies, it enables AI agents to perform automated security assessments safely and efficiently. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?logo=docker&logoColor=white)](https://www.docker.com/) [![FastAPI](https://img.shields.io/badge/FastAPI-005571?logo=fastapi)](https://fastapi.tiangolo.com/) --- ## โ–ถ๏ธ Demo [![PentestMCP](https://img.youtube.com/vi/6X1dZ02Oum4/0.jpg)](https://youtu.be/6X1dZ02Oum4) ## ๐ŸŒŸ Features ### ๐ŸŽฏ Dual Protocol Support - **REST API**: Traditional HTTP endpoints for maximum compatibility - **MCP Native**: First-class support for Claude Desktop, Cline, and other MCP clients - **Unified Core**: Single codebase powers both interfaces ### ๐Ÿ”’ Enterprise Security - **Policy Engine**: Network restrictions, rate limiting, and authorization controls - **API Key Authentication**: Secure access control for all endpoints - **Network Isolation**: Only private RFC 1918 networks allowed by default - **Audit Logging**: Complete execution history with JSON logging ### ๐Ÿณ Docker Architecture - **Isolated Execution**: Each tool runs in dedicated Kali Linux containers - **Automatic Building**: Smart image caching and dependency management - **Shared Resources**: Common wordlists and results volumes - **Network Access**: Controlled host network mode for scanning ### ๐Ÿง  AI-Optimized Design - **Rich Descriptions**: Every tool includes context, examples, and usage hints - **Structured Output**: Automatic parsing of tool output (nmap, gobuster, etc.) - **Input Validation**: Pydantic models ensure type safety - **Intelligent Caching**: Results cached for 1 hour to reduce redundant scans ### ๐Ÿ› ๏ธ Included Tools - **nmap**: Network discovery and vulnerability scanning - **gobuster**: Web content and vhost enumeration - **enum4linux**: SMB/Active Directory enumeration - **crackmapexec**: Post-exploitation and lateral movement testing --- ## ๐Ÿ“‹ Table of Contents - [Quick Start](#-quick-start) - [Architecture](#-architecture) - [Installation](#-installation) - [Configuration](#-configuration) - [Usage](#-usage) - [REST API](#rest-api) - [MCP Integration](#mcp-integration) - [Tool Development](#-tool-development) - [Security](#-security) - [API Reference](#-api-reference) - [Contributing](#-contributing) - [License](#-license) --- ## ๐Ÿš€ Quick Start ### Prerequisites - Docker & Docker Compose - Python 3.11+ - Make (usually pre-installed on Linux/macOS) - 4GB+ RAM recommended ### Installation (Using Makefile - Recommended) ```bash # Clone the repository git clone https://github.com/sasaga/PentestMCP.git cd pentest-mcp # See all available commands make help # Complete setup in one command make setup # Create directories cp .env.example .env # Copy environment template nano .env # Configure your API_KEY # Build all Docker images make build-all # Builds base image + all tool images # Start services make up # Starts REST API + MCP Server # Verify installation make test # Run system tests ``` ### Alternative: Manual Installation ```bash # Set up environment cp .env.example .env nano .env # Build images ./build_images.sh # Start services docker-compose up -d # Verify curl http://localhost:8085/health ``` ### First Scan ```bash # List available tools curl http://localhost:8085/tools | jq # Run an nmap scan curl -X POST http://localhost:8085/invoke \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "name": "nmap", "mode": "nmap_host_discovery", "args": {"target": "192.168.1.0/24"} }' | jq ``` ### ๐ŸŽฏ Makefile Commands Reference The Makefile is the **central management tool** for this project. Key commands: | Command | Description | |----------|-------------| | `make help` | Show this help message | | `make setup` | Create required directories (e.g., `wordlists` and `results`) | | `make build-base` | Build the base Kali Linux image | | `make build-app` | Build the main application image (FastAPI / MCP) | | `make build-` | Build specific tool (e.g., `make build-nmap`) | | `make build-tools` | Build all tool images defined in YAML files | | `make build-all` | Build all images (base + app + tools) | | `make check-images` | Verify which Docker images are built | | `make list-images` | List all Pentest-MCP Docker images | | `make clean-images` | Remove all Pentest-MCP Docker images | | `make clean-containers` | Remove all Pentest-MCP containers | | `make clean` | Perform a full cleanup (containers + images) | | `make up` | Start all services using Docker Compose | | `make down` | Stop all running services | | `make logs` | View logs from all running services | | `make restart` | Restart services (rebuild app if changes detected) | | `make test` | Run full system tests (uses `.env` configuration) | | `make test-api` | Perform a quick REST API health test | | `make validate-yaml` | Validate syntax of all YAML configuration files | | `make fix-yaml-paths` | Fix or normalize Docker paths in YAML files | | `make show-docker-config` | Display Docker configuration detected in YAMLs | | `make dev` | Start the system in development mode | | `make dev-mcp` | Run the MCP server in standalone mode | | `make info` | Display detailed system and environment information | **See full Makefile documentation below.** --- ## ๐Ÿ—๏ธ Architecture ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Client Layer โ”‚ โ”‚ Claude Desktop โ”‚ Cline โ”‚ HTTP Clients โ”‚ Custom Integrationsโ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ MCP โ”‚ โ”‚ REST API โ”‚ โ”‚ Server โ”‚ โ”‚ (FastAPI) โ”‚ โ”‚ :8090 โ”‚ โ”‚ :8085 โ”‚ โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Core Engine โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Loader โ”‚ โ”‚ YAML โ†’ Pydantic Models โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ Policy โ”‚ โ”‚ Security Validation โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ Executor โ”‚ โ”‚ Docker Management โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ Parser โ”‚ โ”‚ Output Structuring โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Docker Manager โ”‚ โ”‚ - Image Build โ”‚ โ”‚ - Container Run โ”‚ โ”‚ - Volume Mount โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Tool Containers โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ nmap โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ gobuster โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚enum4linuxโ”‚ โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ cme โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### Key Components 1. **Server Layer** (`server.py`, `mcp_server.py`) - Dual protocol support (REST + MCP) - Request validation and routing - Authentication and rate limiting 2. **Core Engine** (`core/`) - **Loader**: Converts YAML tool definitions to Pydantic models - **Policy**: Enforces network restrictions and security rules - **Executor**: Manages Docker containers and command execution - **Parser**: Extracts structured data from tool output 3. **Docker Manager** (`docker_manager.py`) - Automatic image building with caching - Ephemeral container lifecycle - Volume management for wordlists and results 4. **Tool Definitions** (`tools/*.yaml`) - Declarative tool configuration - Schema generation for AI agents - Examples and usage hints --- ## ๐Ÿ“ฆ Installation ### Option 1: Quick Install with Makefile (Recommended) ```bash # Clone and enter directory git clone https://github.com/sasaga/PentestMCP.git cd pentest-mcp # View all available commands make help # Setup directories make setup # Configure environment cp .env.example .env nano .env # Set your API_KEY # Build everything make build-all # Start services make up # Verify installation make test ``` ### Option 2: Docker Compose (Manual) ```bash # Clone and configure git clone https://github.com/sasaga/PentestMCP.git cd pentest-mcp cp .env.example .env # Edit configuration nano .env # Build and start docker-compose up -d # Check logs docker-compose logs -f ``` ### Option 3: Manual Setup (Development) ```bash # Install Python dependencies pip install -r requirements.txt # Build Docker images ./build_images.sh # Download wordlists (optional) mkdir -p wordlists cd wordlists wget https://github.com/danielmiessler/SecLists/raw/master/Discovery/Web-Content/common.txt # Start services uvicorn server:app --host 0.0.0.0 --port 8085 & python mcp_server.py & ``` **๐Ÿ’ก Pro Tip:** Use `make help` to see all available commands at any time. --- ## โš™๏ธ Configuration ### Environment Variables Create a `.env` file: ```bash # Security API_KEY=your-secret-api-key-here # Server Ports REST_PORT=8085 MCP_PORT=8090 MCP_PROXY_PORT=8091 # Paths TOOLS_DIR=/app/tools WORDLISTS_DIR=/app/wordlists RESULTS_DIR=/app/results # Docker KALI_IMAGE=pentest-kali-base # Caching ENABLE_CACHE=true CACHE_TTL_HOURS=1 # Logging LOG_LEVEL=INFO ``` ### Network Policies Edit `tools/*.yaml` to configure allowed networks: ```yaml policy: allowed_networks: - "10.0.0.0/8" - "172.16.0.0/12" - "192.168.0.0/16" max_hosts: 4096 blocked_ports: [] ``` --- ## ๐ŸŽฎ Usage ### REST API #### List Available Tools ```bash curl http://localhost:8085/tools | jq ``` #### Execute a Tool ```bash curl -X POST http://localhost:8085/invoke \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "name": "nmap", "mode": "nmap_tcp_ports_syn_scan", "args": { "target": "192.168.1.100" } }' | jq ``` #### List Wordlists ```bash curl http://localhost:8085/wordlists | jq ``` #### Check Health ```bash curl http://localhost:8085/health | jq ``` ### MCP Integration #### Claude Desktop Add to `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json { "mcpServers": { "PentestMCP": { "command": "python3", "args": ["/path/to/pentest-mcp/mcp_wrapper.py"], "env": { "MCP_SERVER_URL": "http://127.0.0.1:8091/mcp", "API_KEY": "your-api-key-here" } } } } ``` #### Cline (VSCode Extension) Add to `.vscode/settings.json`: ```json { "cline.mcpServers": { "PentestMCP": { "type": "http", "url": "http://127.0.0.1:8091/mcp", "headers": { "x-api-key": "your-api-key-here" } } } } ``` #### 5ire client MCP ```json { "name": "PentestMCP", "key": "PentestMCP", "url": "http://127.0.0.1:8091/mcp", "headers": { "x-api-key": "your-api-key-here" }, "approvalPolicy": "always" } ``` #### Warp MCP Config ```json { "PentestMCP": { "command": "python3", "args": [ "/path/mcp_wrapper.py" ], "env": { "API_KEY": "your-api-key-here", "MCP_SERVER_URL": "http://127.0.0.1:8091/mcp" }, "working_directory": null } } ``` #### Cursor MCP Config ```json { "mcpServers": { "PentestMCP": { "type": "http", "url": "http://127.0.0.1:8091/mcp", "headers": { "x-api-key": "your-api-key-here" } } } } ``` #### Direct MCP Client ```bash # HTTP transport TRANSPORT=http python mcp_server.py # stdio transport (for direct integration) TRANSPORT=stdio python mcp_server.py ``` --- ## ๐Ÿ› ๏ธ Makefile - Complete Reference The Makefile is the **central management interface** for Pentest-MCP. It provides a unified, user-friendly way to build, test, deploy, and manage the entire system. ### Design Philosophy The Makefile is **dynamic** and **self-discovering**: - Automatically detects tools from YAML definitions - No hardcoded tool names - Generates targets on-the-fly - Color-coded output for better UX ### Core Commands #### Setup & Installation ```bash # Create required directories (wordlists, results) make setup # Show system information make info ``` #### Docker Image Management ```bash # Build everything (recommended for first setup) make build-all # Builds base + all tool images # Build only base image make build-base # Kali Linux base # Build specific tool make build-nmap # Just nmap make build-gobuster # Just gobuster make build-enum4linux # Just enum4linux make build-crackmapexec # Just crackmapexec # Verify what's built make check-images # Shows โœ…/โŒ for each image # List all pentest images make list-images ``` #### Service Management ```bash # Start all services (REST API + MCP Server) make up # Stop services make down # Restart services (useful after code changes) make restart # View live logs make logs ``` #### Testing & Validation ```bash # Run complete system test suite make test # Quick API health check make test-api # Validate YAML syntax make validate-yaml # Show Docker configuration from YAMLs make show-docker-config ``` #### Development ```bash # Start REST API in development mode (with auto-reload) make dev # Start MCP server in stdio mode make dev-mcp # Fix YAML Docker paths (if needed) make fix-yaml-paths ``` #### Cleanup ```bash # Remove containers make clean-containers # Remove all pentest images make clean-images # Full cleanup (containers + images) make clean ``` ### Advanced Usage #### Building Specific Tool After YAML Changes ```bash # After modifying tools/nmap.yaml make build-nmap # After modifying tools/gobuster.yaml make build-gobuster ``` #### Incremental Builds The Makefile is smart about dependencies: ```bash # This will check if base exists, build it if not, then build nmap make build-nmap # This rebuilds base, then all tools make build-all ``` #### Parallel Testing ```bash # Run tests in background, continue working make test & # Monitor logs in another terminal make logs ``` ### Makefile Architecture ``` Makefile โ”œโ”€โ”€ Variables โ”‚ โ”œโ”€โ”€ PYTHON := python3 โ”‚ โ”œโ”€โ”€ COMPOSE := docker-compose โ”‚ โ”œโ”€โ”€ DOCKER := docker โ”‚ โ”œโ”€โ”€ TOOLS_DIR := . โ”‚ โ””โ”€โ”€ DOCKERFILES_DIR := ./dockerfiles โ”‚ โ”œโ”€โ”€ Auto-Discovery โ”‚ โ””โ”€โ”€ TOOLS_WITH_DOCKER (scans YAMLs for docker: config) โ”‚ โ”œโ”€โ”€ Static Targets โ”‚ โ”œโ”€โ”€ help, setup, info โ”‚ โ”œโ”€โ”€ build-base, build-all โ”‚ โ”œโ”€โ”€ up, down, restart, logs โ”‚ โ”œโ”€โ”€ test, test-api โ”‚ โ””โ”€โ”€ clean, clean-images โ”‚ โ””โ”€โ”€ Dynamic Targets โ””โ”€โ”€ build-% (e.g., build-nmap) โ”œโ”€โ”€ Validates tool exists in YAML โ”œโ”€โ”€ Builds base if needed โ””โ”€โ”€ Builds specific tool image ``` ### Color Coding The Makefile uses colors for better readability: - ๐ŸŸข **GREEN**: Success messages - ๐ŸŸก **YELLOW**: Info and warnings - ๐Ÿ”ด **RED**: Errors - ๐Ÿ”ต **BLUE**: Headers and titles ### Environment Integration The Makefile respects `.env` variables: ```bash # Example: Change log level for development echo "LOG_LEVEL=DEBUG" >> .env make dev ``` ### Tips & Tricks #### 1. Quick Status Check ```bash make info check-images ``` #### 2. Rebuild After Tool Addition ```bash # After creating tools/mytool.yaml and dockerfiles/Dockerfile.mytool make build-mytool make restart make test-api ``` #### 3. Development Workflow ```bash # Terminal 1: Development server make dev # Terminal 2: Logs make logs # Terminal 3: Testing make test-api ``` #### 4. Production Deployment ```bash make setup make build-all make up make test ``` ### Troubleshooting with Makefile ```bash # Check what images exist make check-images # Verify services are running make up docker-compose ps # View detailed logs make logs # Full rebuild (if things are broken) make clean make build-all make up ``` ### Customization The Makefile is designed to be extended. Add your own targets: ```makefile # Example: Add to Makefile .PHONY: backup backup: ## Backup results and wordlists @echo "Creating backup..." tar -czf pentest-backup-$(shell date +%Y%m%d).tar.gz results/ wordlists/ @echo "โœ… Backup created" ``` ### CI/CD Integration The Makefile works great in CI/CD pipelines: ```yaml # Example: GitHub Actions - name: Build and Test run: | make setup make build-all make test ``` ### Why Makefile? **Benefits:** - โœ… **Single source of truth** for all operations - โœ… **Self-documenting** with `make help` - โœ… **Cross-platform** (Linux, macOS, WSL) - โœ… **Dependency management** (base image before tools) - โœ… **Developer friendly** (simple, memorable commands) - โœ… **CI/CD ready** (easy to automate) **vs Docker Compose alone:** - Makefile provides higher-level abstractions - Better error handling and feedback - Testing and validation built-in - Dynamic target generation **vs Shell Scripts:** - Better dependency tracking - Parallel execution support - Standard, well-known tool --- ## ๐Ÿ”ง Tool Development ### Adding a New Tool 1. **Create YAML Definition** (`tools/your_category/tool_name.yaml`) ```yaml name: mytool category: reconnaissance description: | Brief description of what the tool does. **Use cases:** - Use case 1 - Use case 2 docker: image: pentest-mytool:latest build: context: ./dockerfiles dockerfile: Dockerfile.mytool functions: scan: description: | Detailed description of this function. command: "mytool {target} {options}" parameters: target: type: string format: ipv4 description: Target to scan examples: - "192.168.1.10" - "10.0.0.0/24" options: type: string description: Additional options default: "-v" timeout: 300 examples: - description: "Basic scan" input: function: scan args: target: "192.168.1.10" options: "-v" policy: allowed_networks: - "10.0.0.0/8" - "172.16.0.0/12" - "192.168.0.0/16" max_hosts: 1024 hints: - "Start with basic options" - "Use verbose mode for debugging" ``` 2. **Create Dockerfile** (`dockerfiles/Dockerfile.mytool`) ```dockerfile FROM pentest-kali-base:latest RUN apt-get update && apt-get install -y \ mytool \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* WORKDIR /workspace LABEL tool="mytool" LABEL category="reconnaissance" ``` 3. **Build and Test** ```bash # Build image ./build_images.sh # Test via REST API curl -X POST http://localhost:8085/invoke \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "name": "mytool", "mode": "scan", "args": {"target": "192.168.1.10"} }' | jq ``` --- ## ๐Ÿ” Security ### Best Practices 1. **Always use API keys** in production 2. **Restrict networks** via policy configuration 3. **Monitor audit logs** (`results/executions.log`) 4. **Review Docker privileges** (NET_ADMIN/NET_RAW required for scanning) 5. **Use HTTPS** in production with reverse proxy ### Network Isolation By default, tools can only target private networks (RFC 1918): - `10.0.0.0/8` - `172.16.0.0/12` - `192.168.0.0/16` - `127.0.0.0/8` ### Rate Limiting Configure in your reverse proxy (nginx, traefik) or use FastAPI middleware. ### Audit Trail Every execution is logged: ```bash tail -f results/executions.log ``` --- ## ๐Ÿ“š API Reference ### REST Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/` | API information | | GET | `/health` | System health check | | GET | `/tools` | List all available tools | | POST | `/invoke` | Execute a tool | | GET | `/wordlists` | List available wordlists | | POST | `/reload` | Reload tool definitions | | GET | `/cache/stats` | Cache statistics | | DELETE | `/cache/clear` | Clear result cache | ### MCP Resources - `pentest://tools` - Tool catalog - `pentest://wordlists` - Wordlist inventory ### MCP Tools All tools are automatically exposed as MCP functions with the format: `{tool_name}_{function_name}` Example: `nmap_tcp_ports_syn_scan`, `gobuster_directory_bruteforce` --- ## ๐Ÿค Contributing Contributions are welcome! Here's how: 1. Fork the repository 2. Create a feature branch (`git checkout -b feature/amazing-tool`) 3. Commit your changes (`git commit -m 'Add amazing tool'`) 4. Push to the branch (`git push origin feature/amazing-tool`) 5. Open a Pull Request ### Adding New Tools Please ensure: - Complete YAML definition with examples - Dockerfile with minimal dependencies - Security policy configuration - Documentation in README --- ## ๐Ÿ› Troubleshooting ### Docker Issues ```bash # Rebuild all images ./build_images.sh # Check Docker connectivity docker ps # View container logs docker logs pentest-mcp-app ``` ### Port Conflicts ```bash # Change ports in .env REST_PORT=8086 MCP_PORT=8091 # Restart services docker-compose restart ``` ### Permission Errors ```bash # Fix volume permissions sudo chown -R $(id -u):$(id -g) wordlists results ``` --- ## ๐Ÿ“„ License MIT License - see [LICENSE](LICENSE) file for details. ``` Copyright (c) 2025 Samir Sanchez Garnica Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` --- ## ๐Ÿ‘ค Author **Samir Sanchez Garnica** - Email: samir.sanchez@hawktesters.com - GitHub: [@sasaga](https://github.com/sasaga) --- ## ๐Ÿ™ Acknowledgments - [FastMCP](https://github.com/jlowin/fastmcp) - Modern MCP server framework - [FastAPI](https://fastapi.tiangolo.com/) - High-performance web framework - [Nmap](https://nmap.org/) - Network discovery tool - [Gobuster](https://github.com/OJ/gobuster) - Directory/DNS busting - [CrackMapExec](https://github.com/byt3bl33d3r/CrackMapExec) - Post-exploitation tool - [enum4linux-ng](https://github.com/cddmp/enum4linux-ng) - SMB enumeration --- ## ๐Ÿ“Š Project Stats ![GitHub stars](https://img.shields.io/github/stars/sasaga/pentest-mcp?style=social) ![GitHub forks](https://img.shields.io/github/forks/sasaga/pentest-mcp?style=social) ![GitHub watchers](https://img.shields.io/github/watchers/sasaga/pentest-mcp?style=social) --- **โš ๏ธ Disclaimer**: This tool is intended for authorized security testing only. Users are responsible for complying with all applicable laws and regulations. The authors assume no liability for misuse.