Logo vun pentestMCP: AI-Powered Penetration Testing via MCP

pentestMCP: AI-Powered Penetration Testing via MCP

Communautéit
RamKansal

pentestMCP: AI-Powered Penetration Testing via MCP, an MCP designed for penetration testers.

EditeurRamKansal
RepositorypentestMCP
SproochPython
Forks
21
Stären
97
Disponibel Tools
0
Transporttypstdio
Kategorien
Linken
  • Tools mat KI-Workflows verbannen

    pentestMCP: AI-Powered Penetration Testing via MCP stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    97 Stären an 21 Forks aus dem verlinkte Repository.

MseeP.ai Security Assessment Badge

pentestMCP: AI-Powered Penetration Testing via MCP

License: MIT

pentestMCP provides a powerful bridge between Large Language Models (LLMs) and practical penetration testing tools through the Model Context Protocol (MCP). This project functions as an MCP Server, exposing a curated suite of over 20 standard security assessment utilities (Nmap, Nuclei, ZAP, SQLMap, etc.) as callable 'tools'. This allows AI agents within MCP-compatible clients (like Claude Desktop or specific VS Code setups) to leverage these utilities for automated and interactive security analysis tasks.

The goal is to enable natural language control over complex security workflows, making pentesting capabilities more accessible and integrated into AI-driven environments. This work is inspired by Laurie Kirk's GhidraMCP.


Table of Contents


Video Demo

https://github.com/user-attachments/assets/930c879a-5cb4-478a-b033-f30df0e770a6

Core Concepts & Architecture

pentestMCP strictly adheres to the MCP specification, functioning solely as an MCP Server. It does not embed or directly communicate with any specific LLM. The interaction flow is mediated by an MCP Client Host application:

  1. Client Host Application (e.g., Claude Desktop, custom agent): Connects to pentestMCP (typically via stdio brokered by Docker), manages user interaction, and interfaces with a chosen LLM.
  2. LLM: Receives user prompts and tool definitions (from pentestMCP via the Client Host). It decides which tools to invoke based on the context.
  3. pentestMCP Server (This Project): Runs within a Docker container. Listens for tools/call requests from the Client Host, executes the corresponding underlying tool (e.g., nmap), and returns the results.
  4. External Tools: The actual command-line utilities encapsulated within the Docker image.

The server is built using the Python MCP SDK (mcp.server.fastmcp.FastMCP) and features:

  • Tool Discovery: Utilizes Python type hints and docstrings for automatic MCP tool schema generation.
  • Concurrency Control: A threading.Semaphore limits simultaneous execution of resource-intensive scans.
  • Asynchronous Scan Pattern: Implements launch/fetch methods for long-running tasks (Nmap, Nuclei, SQLMap, Gobuster) to avoid blocking the MCP connection.

Key Features

  • Comprehensive Toolset: Integrates over 20 essential penetration testing tools via MCP.
  • Standardized Access: Enables any MCP client supporting stdio server launching to utilize complex pentesting workflows.
  • Non-Blocking Scans: Efficiently handles long-running scans without locking up the interaction flow.
  • Resource Management: Implements basic concurrency limiting for scans.
  • Portable & Reproducible: Dockerized environment ensures all dependencies and tools are available consistently across platforms (Windows, macOS, Linux).
  • Web Scanner Integration: Provides direct control over OWASP ZAP Active Scan and AJAX Spider functionalities.

Prerequisites

  • Docker: Requires Docker Desktop (Windows/macOS) or Docker Engine (Linux) to be installed and running. Ensure the Docker daemon is active.
  • Git: Needed only if building the image locally (git clone step).
  • (Optional but Recommended) OWASP ZAP Instance: For using ZAP-related tools (run_zap_*, run_active_scan_*, run_ajax_*). This ZAP instance needs to be running and network-accessible from inside the pentestMCP Docker container (see Client Host Integration section for configuration).

Installation & Setup

We recommend using the pre-built Docker image for the fastest and most reliable setup.

🐳 Using Pre-built Docker Image (Recommended)

Using the pre-built image avoids local build times and ensures all tools (like gofang, nmap, and nuclei) are correctly installed without dependency issues.

  1. Pull the image from Docker Hub:
    bash
    docker pull ramgameer/pentest-mcp:latest

    ℹ️ Note: Depending on your environment, you may need to authenticate or ensure the Docker daemon is running.


🛠️ Building Docker Image Locally

⚠️ IMPORTANT: Building locally is currently most efficient and supported on Linux environments.

If you wish to modify the server's code, use the absolute latest version, or the pre-built image is unavailable, you can build the Docker image locally.

  1. Clone the repository:

    bash
    git clone https://github.com/ramkansal/pentestMCP.git
    cd pentestMCP
  2. Build the Docker image:

    bash
    docker build -t pentest-mcp-server:custom .
  3. Install SecLists (Optional but highly recommended):

    💡 Tip: Several tools (like Gobuster and Fuzzing utilities) rely on massive wordlists. You must clone the SecLists repo for these specific scans to function effectively.

    bash
    git clone https://github.com/danielmiessler/SecLists.git seclists

Client Host Integration

pentestMCP runs inside Docker and communicates with the Client Host via stdio. You configure your host (e.g., Claude Desktop, VS Code) to launch the server using docker run -i ....

Claude Desktop Integration

  1. Locate/Create Config File:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Edit Config: Add/update the mcpServers section. Use the correct image name (ramgameer/pentest-mcp:latest or your custom tag) .

    json
    {
      "mcpServers": {
        "pentestMCP": {
          "command": "docker",
          "args": [
            "run",
            "--rm",
            "-i",
            "ramgameer/pentest-mcp:latest"
          ]
        }
      }
    }
  3. Restart Claude Desktop fully.

  4. Verify: Look for the icon. Clicking it should list the pentesting tools.

  5. Interact: Ask Claude to use the tools (see examples in the draft).

VS Code Copilot Chat Integration

Integration requires configuring VS Code's settings to define the MCP server for Copilot Chat agents that support MCP.

  1. Install Prerequisite: Ensure Github Copilot extension and relevant GitHub Copilot extensions are installed.

  2. Configure VS Code Settings: Open your User or Workspace settings.json file (Command Palette: "Preferences: Open Settings (JSON)"). Add the MCP server configuration under the appropriate path (this path might change depending on the specific Copilot Chat agent implementation, check its documentation):

    json
    "pentest-mcp": {
        "type": "stdio",
        "command": "docker",
        "args": [
            "run",
            "-i",
            "--rm",
            "ramgameer/pentest-mcp:latest"
        ]
    }
  3. Reload VS Code / Agent: Restart VS Code or use relevant commands to reload the Copilot agent's configuration for the changes to take effect. Consult the specific Copilot agent's documentation for details.

  4. Interact: Use the Copilot Chat interface, potentially invoking tools via mentions if the agent supports it, or let the agent invoke them based on your prompts.

Tool Reference

The server exposes a variety of tools categorized by function:

  • Reconnaissance & Enumeration:
    • run_subfinder: Discovers subdomains using ProjectDiscovery's Subfinder.
    • launch_nmap_scan / fetch_nmap_results: Executes Nmap network scans and retrieves results asynchronously.
    • run_gobuster_scan / check_gobuster_status: Performs directory/file/DNS bruteforcing with Gobuster asynchronously.
    • launch_gofang_scan / fetch_gofang_results: Runs gofang, an all-in-one web crawler with extraction superpowers.
    • run_harvester / check_harvester_status: Runs theHarvester asynchronously for OSINT gathering (emails, hosts, ips).
    • run_dig_tool: Executes DNS dig queries.
    • fetch_whois_data: Retrieves WHOIS information for a domain.
    • run_curl_tool: Executes cURL commands for HTTP interaction.
  • Vulnerability Scanning:
    • launch_nuclei_scan / fetch_nuclei_results: Runs template-based vulnerability scans with ProjectDiscovery's Nuclei asynchronously.
  • Web Application Analysis:
    • launch_arjun_scan / fetch_arjun_results: Locates hidden HTTP parameters using Arjun.
  • Exploitation Support:
    • run_searchsploit: Searches the local Exploit-DB database using Searchsploit.
    • run_sqlmap_tool / check_sqlmap_status: Executes SQLmap for SQL injection testing asynchronously.
  • Active Directory Analysis (ad_* tools):
    • Enumeration: ad_user_enum, ad_shares_enum, ad_smb_signing_check, ad_certipy_enum, ad_ldap_dump, ad_bloodhound_collect
    • Attacks/Coercion: ad_asreproast, ad_kerberoast, ad_password_spray, ad_coerce_petitpotam, ad_coerce_printerbug, ad_responder_poison, ad_relay_setup
    • Credential/Domain Operations: ad_check_credentials, ad_secrets_dump, ad_dcsync

Star History Chart

Security Considerations

  • Execution Permissions: Tools run as appuser within Docker, but Docker itself runs with host privileges. Be cautious with tools that modify files or require elevated system access.
  • Target Authorization: CRITICAL: Only use these tools against systems for which you have explicit, prior, written authorization. Unauthorized scanning is illegal and unethical.
  • Network Exposure: If mapping ZAP's port (-p 8888:8888), ensure your host firewall restricts access if the machine is on an untrusted network. The configured ZAP API key provides control over the instance.
  • Input Validation: Although MCP provides structured input, the underlying tools might still be vulnerable to crafted arguments if not handled robustly within the Python wrapper functions.

Contributing

Contributions are highly encouraged! Fork the repository, create a feature branch, and submit a pull request. Please ensure adherence to ethical testing guidelines in all contributions. Bug reports and feature suggestions are welcome via GitHub Issues.

License

This project is distributed under the terms of the MIT License.

Disclaimer

This software is intended SOLELY for educational purposes and authorized, ethical security testing. Any use against systems without explicit permission is strictly prohibited and illegal. The authors and contributors assume NO liability for misuse or damage resulting from this program. Use at your own risk and ensure compliance with all applicable laws and agreements.

Acknowledgements

Profound inspiration for this project comes from Laurie Kirk's groundbreaking work on GhidraMCP.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "ramkansal-pentestmcp": {
      "command": "npx",
      "args": [
        "-y",
        "pentest-mcp"
      ]
    }
  }
}

pentestMCP: AI-Powered Penetration Testing via MCP MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal pentestMCP: AI-Powered Penetration Testing via MCP verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

pentestMCP: AI-Powered Penetration Testing via MCP als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu pentestMCP: AI-Powered Penetration Testing via MCP an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "ramkansal-pentestmcp": {
      "command": "npx",
      "args": [
        "-y",
        "pentest-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu pentestMCP: AI-Powered Penetration Testing via MCP. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu pentestMCP: AI-Powered Penetration Testing via MCP.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat pentestMCP: AI-Powered Penetration Testing via MCP?
pentestMCP: AI-Powered Penetration Testing via MCP
Jo. Ech hunn et gelies.
Dat hunn ech mat pentestMCP: AI-Powered Penetration Testing via MCP fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server pentestMCP: AI-Powered Penetration Testing via MCP benotzt?

pentestMCP: AI-Powered Penetration Testing via MCP ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech pentestMCP: AI-Powered Penetration Testing via MCP MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir pentestMCP: AI-Powered Penetration Testing via MCP mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat pentestMCP: AI-Powered Penetration Testing via MCP MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann pentestMCP: AI-Powered Penetration Testing via MCP verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech pentestMCP: AI-Powered Penetration Testing via MCP MCP mat TypingMind?

pentestMCP: AI-Powered Penetration Testing via MCP leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt pentestMCP: AI-Powered Penetration Testing via MCP MCP an TypingMind zur Verfügung?

pentestMCP: AI-Powered Penetration Testing via MCP stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir pentestMCP: AI-Powered Penetration Testing via MCP MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann pentestMCP: AI-Powered Penetration Testing via MCP eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇