Skip to main content
Glama
LT7T
by LT7T

pentestthinkingMCP

Plan penetration testing attack paths with AI reasoning using Beam Search or MCTS strategies to guide CTF and HTB challenge progression.

Instructions

Advanced reasoning tool with multiple strategies including Beam Search and Monte Carlo Tree Search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attackStepYesCurrent attack step or action in the penetration test
attackStepNumberYesCurrent step number in the attack chain
totalAttackStepsYesTotal expected steps in the attack chain
nextAttackStepNeededYesWhether another attack step is needed
strategyTypeNoAttack strategy to use (beam_search or mcts)

Implementation Reference

  • Core handler for CallToolRequestSchema that executes the pentestthinkingMCP tool logic: checks tool name, processes and validates input, invokes Reasoner.processAttackStep, retrieves stats, formats response as JSON.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      if (request.params.name !== "pentestthinkingMCP") {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({ error: "Unknown tool", success: false })
          }],
          isError: true
        };
      }
    
      try {
        // Process and validate input
        const step = processInput(request.params.arguments);
    
        // Process attack step with selected strategy
        const response = await reasoner.processAttackStep({
          attackStep: step.attackStep,
          attackStepNumber: step.attackStepNumber,
          totalAttackSteps: step.totalAttackSteps,
          nextAttackStepNeeded: step.nextAttackStepNeeded,
          strategyType: step.strategyType
        });
    
        // Get attack chain stats
        const stats = await reasoner.getStats();
    
        // Return enhanced response
        const result = {
          attackStepNumber: step.attackStepNumber,
          totalAttackSteps: step.totalAttackSteps,
          nextAttackStepNeeded: step.nextAttackStepNeeded,
          attackStep: step.attackStep,
          nodeId: response.nodeId,
          score: response.score,
          strategyUsed: response.strategyUsed,
          stats: {
            totalNodes: stats.totalNodes,
            averageScore: stats.averageScore,
            maxDepth: stats.maxDepth,
            branchingFactor: stats.branchingFactor,
            strategyMetrics: stats.strategyMetrics
          }
        };
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result)
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: error instanceof Error ? error.message : String(error),
              success: false
            })
          }],
          isError: true
        };
      }
    });
  • Input schema definition for the pentestthinkingMCP tool, specifying properties, types, descriptions, and required fields.
    inputSchema: {
      type: "object",
      properties: {
        attackStep: {
          type: "string",
          description: "Current attack step or action in the penetration test"
        },
        attackStepNumber: {
          type: "integer",
          description: "Current step number in the attack chain",
          minimum: 1
        },
        totalAttackSteps: {
          type: "integer",
          description: "Total expected steps in the attack chain",
          minimum: 1
        },
        nextAttackStepNeeded: {
          type: "boolean",
          description: "Whether another attack step is needed"
        },
        strategyType: {
          type: "string",
          enum: Object.values(ReasoningStrategy),
          description: "Attack strategy to use (beam_search or mcts)"
        }
      },
      required: ["attackStep", "attackStepNumber", "totalAttackSteps", "nextAttackStepNeeded"]
    }
  • src/index.ts:49-83 (registration)
    Registers the pentestthinkingMCP tool with the MCP server via ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [{
        name: "pentestthinkingMCP",
        description: "Advanced reasoning tool with multiple strategies including Beam Search and Monte Carlo Tree Search",
        inputSchema: {
          type: "object",
          properties: {
            attackStep: {
              type: "string",
              description: "Current attack step or action in the penetration test"
            },
            attackStepNumber: {
              type: "integer",
              description: "Current step number in the attack chain",
              minimum: 1
            },
            totalAttackSteps: {
              type: "integer",
              description: "Total expected steps in the attack chain",
              minimum: 1
            },
            nextAttackStepNeeded: {
              type: "boolean",
              description: "Whether another attack step is needed"
            },
            strategyType: {
              type: "string",
              enum: Object.values(ReasoningStrategy),
              description: "Attack strategy to use (beam_search or mcts)"
            }
          },
          required: ["attackStep", "attackStepNumber", "totalAttackSteps", "nextAttackStepNeeded"]
        }
      }]
    }));
  • Helper function to process and validate input arguments for the pentestthinkingMCP tool.
    function processInput(input: any) {
      const result = {
        attackStep: String(input.attackStep || ""),
        attackStepNumber: Number(input.attackStepNumber || 0),
        totalAttackSteps: Number(input.totalAttackSteps || 0),
        nextAttackStepNeeded: Boolean(input.nextAttackStepNeeded),
        strategyType: input.strategyType as ReasoningStrategy | undefined
      };
    
      // Validate
      if (!result.attackStep) {
        throw new Error("attackStep must be provided");
      }
      if (result.attackStepNumber < 1) {
        throw new Error("attackStepNumber must be >= 1");
      }
      if (result.totalAttackSteps < 1) {
        throw new Error("totalAttackSteps must be >= 1");
      }
    
      return result;
    }
  • Core method in Reasoner class that delegates tool logic to the selected strategy (Beam Search or MCTS) and adds strategy metadata.
    public async processAttackStep(request: ReasoningRequest): Promise<ReasoningResponse> {
      // Switch strategy if requested
      if (request.strategyType && this.strategies.has(request.strategyType as ReasoningStrategy)) {
        this.currentStrategy = this.strategies.get(request.strategyType as ReasoningStrategy)!;
      }
    
      // Process attack step using current strategy
      const response = await this.currentStrategy.processAttackStep(request);
    
      // Add strategy information to response
      return {
        ...response,
        strategyUsed: this.getCurrentStrategyName()
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral information. It mentions strategy types but doesn't describe what the tool returns, whether it's read-only or has side effects, how long it might take to execute, or what kind of reasoning output it produces. For a tool with 5 parameters and no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with just one sentence, but it's front-loaded with the core concept. However, it could be more efficient by specifying what the tool actually produces rather than just describing it as a 'reasoning tool.'

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how the reasoning is applied, or what value it provides in penetration testing. The agent would be left guessing about the tool's output format and practical application.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description doesn't add any meaningful parameter information beyond what's in the schema - it mentions strategy types but the schema already defines the enum values and their purpose. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states it's an 'Advanced reasoning tool with multiple strategies' which provides a general purpose, but it's vague about what it actually does - it doesn't specify what the tool outputs or how it helps with penetration testing. It mentions strategy types but doesn't explain what the tool produces or how it aids decision-making.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There's no guidance on when to use this tool versus alternatives or what context it's appropriate for. The description mentions strategy types but doesn't explain when to choose beam_search versus mcts or what problems this tool is designed to solve in penetration testing workflows.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LT7T/SecMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server