PentestGPT-MCP logo

PentestGPT-MCP

Community
yuhano

An automated pentesting agent that thinks with an LLM and acts with MCP.

Publisheryuhano
RepositoryPentestGPT-MCP
LanguagePython
Forks
12
Stars
18
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    PentestGPT-MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    18 stars and 12 forks from the linked repository.

PentestGPT-MCP

This project is an advanced penetration testing tool based on the original "PentestGPT" paper. It extends the core capabilities by integrating with Model Context Protocol servers (MCPs) to perform automated, LLM-driven security assessments.

It is based on the PentestGPT project.

🇰🇷 Read this in Korean

Features

  • Dynamic MCP Server Integration: Connects to various tool servers running locally or remotely via a flexible mcp_servers.json configuration file.
  • Automated Task Execution (auto mode): Automatically executes LLM-suggested tasks using tools provided by a connected MCP server.
  • Interactive "Human-in-the-Loop" Mode: Supports user confirmation before each tool execution, enhancing safety and control during automated scans.
  • Flexible Model Support: Works with a wide range of LLM providers, including OpenAI (GPT series) and Google (Gemini series).

Installation

1. Clone the Repository and Set Up a Virtual Environment

bash
git clone https://github.com/your-username/PentestGPT-MCP.git
cd PentestGPT-MCP
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

2. Install Dependencies

Install the required Python packages from requirements.txt.

bash
pip install -r requirements.txt

3. Configure API Keys

PentestGPT-MCP requires API keys to interact with Large Language Models. Set the appropriate environment variables for the model you wish to use.

For OpenAI (e.g., gpt-4o):

bash
export OPENAI_API_KEY="your-openai-api-key"

For Google (e.g., Gemini):

bash
export GOOGLE_API_KEY="your-google-api-key"

4. Set Up MCP Servers

The tool manages connections to MCP servers through a central JSON configuration file.

1. Copy the Example Configuration

Copy the example file from the config/ directory to the project root.

bash
cp config/mcp_servers.json.example ./mcp_servers.json

2. Edit the Configuration File

Open mcp_servers.json and customize it to match your environment.

Configuration Example:

json
{
    "mcpServers": {
        "pentest-tools": {
            "command": "python",
            "args": [
                "mcp_servers/pentest_tools_server.py"
            ]
        },
        "kali_mcp": {
            "command": "python3",
            "args": [
                "/absolute/path/to/mcp_server.py",
                "http://LINUX_IP:5000/"
            ]
        }
    }
}

Configuration Structure:

  • mcpServers: The root object containing all server configurations.
  • "server-name": A unique, user-defined name for each server (e.g., "pentest-tools").
  • command: The command to execute the server (e.g., python, python3, node).
  • args: An array of arguments to pass to the command. The first argument is typically the path to the server script.

Important: The default mcp_servers/pentest_tools_server.py assumes that tools like nmap and dirb are installed and available in the system's PATH. It is highly recommended to run this in an environment where these tools are present, such as Kali Linux.

Usage

1. Running PentestGPT-MCP

Start the application from the project root directory.

bash
python main.py

You can use several command-line arguments to customize the session:

  • Change Models:
    bash
    python main.py --reasoning gpt-4o --parsing gpt-4o
  • List Available Models:
    bash
    python main.py --models
  • Specify a Custom MCP Config Path:
    bash
    python main.py --mcp-config /path/to/your/mcp_servers.json

2. Basic Workflow

  1. Provide Initial Information: When prompted, briefly describe the penetration testing target and objective.

    Please describe the penetration testing task in one line...
    > Penetration test on the web server at http://10.0.2.15
  2. Get Task Suggestions (next or todo):

    • next: Input the results from a manual scan or any text you want to analyze. PentestGPT will process the input and suggest the next steps in the Penetration Testing Tree (PTT).
    • todo: Ask PentestGPT to recommend the next task based on the current PTT.
  3. Execute Automated Tasks (auto):

    • Type auto at the prompt to execute the most recently suggested task via an MCP server.
    • You will be asked to select which configured MCP server to use for the task.
    • Choose the interactive mode (y) to review and confirm each tool command before execution, ensuring a safe and controlled process.

Command Reference

  • next: Submit test results for analysis and receive suggestions for the next task.
  • todo: Ask for a recommendation on what to do next.
  • more: Request a more detailed explanation of the current task.
  • auto: Automatically execute the latest suggested task using a connected MCP server.
  • discuss: Engage in a free-form conversation with PentestGPT.
  • quit: End the current session (you will be prompted to save the session before exiting).

Use PentestGPT-MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once PentestGPT-MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add PentestGPT-MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the PentestGPT-MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "pentestgpt-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the PentestGPT-MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the PentestGPT-MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use PentestGPT-MCP to help me with this task?
PentestGPT-MCP
Sure. I read it.
Here is what I found using PentestGPT-MCP.

Frequently asked questions

What is the PentestGPT-MCP MCP server used for?

PentestGPT-MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use PentestGPT-MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use PentestGPT-MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use PentestGPT-MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With PentestGPT-MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect PentestGPT-MCP MCP to TypingMind?

PentestGPT-MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does PentestGPT-MCP MCP provide in TypingMind?

PentestGPT-MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use PentestGPT-MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If PentestGPT-MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇