Skip to main content
Glama
Spritualkb

nuclei-server MCP Server

by Spritualkb

start_scan

Launch security vulnerability scans using Nuclei templates to identify issues on target URLs or IP addresses.

Instructions

Start a new nuclei scan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget URL or IP address
templateNoTemplate to use for scanning
rateLimitNoRate limit per second
templatesDirNoDirectory with templates
severityNo
timeoutNoTimeout in seconds
concurrencyNoConcurrent requests
proxyUrlNoProxy URL (e.g., socks5://127.0.0.1:1080)
proxyTypeNo

Implementation Reference

  • Executes the start_scan tool: checks concurrent scan limit, parses arguments, creates scan ID and entry, builds nuclei command line with options, spawns process, streams stdout for progress, parses JSON findings on close, handles errors.
    if (request.params.name === "start_scan") {
      const activeScans = Object.values(scans).filter(
        (scan) => scan.status === "running"
      ).length;
      if (activeScans >= MAX_CONCURRENT_SCANS) {
        return {
          content: [
            {
              type: "text",
              text: `Reached maximum concurrent scans (${MAX_CONCURRENT_SCANS}), please try again later`,
            },
          ],
          isError: true,
        };
      }
    
      const { target, template, rateLimit, templatesDir, severity, timeout, concurrency, proxyUrl, proxyType } =
        request.params.arguments as {
          target: string;
          template?: string;
          rateLimit?: number;
          templatesDir?: string;
          severity?: string;
          timeout?: number;
          concurrency?: number;
          proxyUrl?: string;
          proxyType?: string;
        };
    
      const scanId = uuidv4();
      scans[scanId] = {
        id: scanId,
        target,
        status: "pending",
        progress: 0,
        findings: [],
      };
    
      let command = `nuclei -u ${target} ${severity ? `-severity ${severity}` : ""} ${
        template ? `-t ${template}` : ""
      } ${rateLimit ? `-rl ${rateLimit}` : ""} ${templatesDir ? `-templates ${templatesDir}` : ""} ${
        timeout ? `-timeout ${timeout}` : ""
      } ${concurrency ? `-c ${concurrency}` : ""} -json`;
    
      if (proxyUrl && proxyType) {
        if (proxyType === "socks5") {
          command += ` -proxy-socks-url ${proxyUrl}`;
        } else {
          command += ` -proxy-url ${proxyUrl}`;
        }
      }
    
      try {
        scans[scanId].status = "running";
    
        const process = spawn(command, {
          shell: true,
          stdio: ["pipe", "pipe", "pipe"],
        });
    
        let output = "";
        process.stdout.on("data", (data) => {
          output += data.toString();
          scans[scanId].progress = Math.min(100, Math.round((output.split("\n").length / 100) * 100));
        });
    
        process.on("close", () => {
          scans[scanId].progress = 100;
          const findings = output
            .split("\n")
            .filter(Boolean)
            .map((line) => {
              try {
                return JSON.parse(line);
              } catch {
                return null;
              }
            })
            .filter(Boolean);
    
          scans[scanId].findings = findings;
          scans[scanId].status = "completed";
        });
    
        scans[scanId].process = process;
    
        return {
          content: [
            {
              type: "text",
              text: `Scan ${scanId} started`,
            },
          ],
        };
      } catch (error) {
        scans[scanId].status = "failed";
        return {
          content: [
            {
              type: "text",
              text: `Scan ${scanId} failed: ${error instanceof Error ? error.message : "Unknown error"}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Defines the input schema and parameters for the start_scan tool.
      name: "start_scan",
      description: "Start a new nuclei scan",
      inputSchema: {
        type: "object",
        properties: {
          target: { type: "string", description: "Target URL or IP address" },
          template: { type: "string", description: "Template to use for scanning" },
          rateLimit: { type: "number", description: "Rate limit per second" },
          templatesDir: { type: "string", description: "Directory with templates" },
          severity: { type: "string", enum: ["info", "low", "medium", "high", "critical"] },
          timeout: { type: "number", description: "Timeout in seconds" },
          concurrency: { type: "number", description: "Concurrent requests" },
          proxyUrl: {
            type: "string",
            description: "Proxy URL (e.g., socks5://127.0.0.1:1080)"
          },
          proxyType: {
            type: "string",
            enum: ["http", "socks5"]
          },
        },
        required: ["target"],
      },
    },
  • src/index.ts:68-109 (registration)
    Registers the start_scan tool by listing it in the tools response.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "start_scan",
            description: "Start a new nuclei scan",
            inputSchema: {
              type: "object",
              properties: {
                target: { type: "string", description: "Target URL or IP address" },
                template: { type: "string", description: "Template to use for scanning" },
                rateLimit: { type: "number", description: "Rate limit per second" },
                templatesDir: { type: "string", description: "Directory with templates" },
                severity: { type: "string", enum: ["info", "low", "medium", "high", "critical"] },
                timeout: { type: "number", description: "Timeout in seconds" },
                concurrency: { type: "number", description: "Concurrent requests" },
                proxyUrl: {
                  type: "string",
                  description: "Proxy URL (e.g., socks5://127.0.0.1:1080)"
                },
                proxyType: {
                  type: "string",
                  enum: ["http", "socks5"]
                },
              },
              required: ["target"],
            },
          },
          {
            name: "cancel_scan",
            description: "Cancel a running scan",
            inputSchema: {
              type: "object",
              properties: {
                scanId: { type: "string", description: "Scan ID to cancel" },
              },
              required: ["scanId"],
            },
          },
        ],
      };
    });
  • Type definition for scan results used by start_scan handler.
    interface ScanResult {
      id: string;
      target: string;
      progress: number;
      status: "pending" | "running" | "completed" | "failed" | "canceled";
      findings: any[];
      process?: any;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool starts a scan but fails to describe what happens during execution (e.g., whether it runs asynchronously, potential impacts on targets, or expected outputs). This leaves critical behavioral traits undocumented for a tool with security implications.

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

Conciseness5/5

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

The description is extremely concise with a single, front-loaded sentence ('Start a new nuclei scan') that directly conveys the core purpose without any wasted words. This efficiency makes it easy to parse, though it may lack depth.

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?

Given the tool's complexity (9 parameters, no annotations, no output schema, and security-related functionality), the description is insufficient. It doesn't cover behavioral aspects, output expectations, or usage context, leaving significant gaps for an AI agent to understand how to invoke it correctly and interpret results.

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?

The schema description coverage is 78%, which is relatively high, setting a baseline of 3. The description adds no additional parameter information beyond what the schema provides, such as explaining the relationship between parameters or typical values. It doesn't compensate for the 22% gap in coverage, but the schema handles most documentation.

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

Purpose4/5

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

The description clearly states the action ('Start a new nuclei scan') with a specific verb ('Start') and resource ('nuclei scan'), making the purpose immediately understandable. However, it doesn't distinguish this from its sibling tool 'cancel_scan' or explain what a 'nuclei scan' entails, which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or context for initiating a scan. While it implies usage for starting scans, there's no explicit advice on timing, constraints, or how it relates to 'cancel_scan'.

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/Spritualkb/nuclei-mcp'

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