Skip to main content
Glama

nuclei_scan

Scan web applications and networks for security vulnerabilities using customizable templates and severity filters to identify potential threats.

Instructions

Run Nuclei vulnerability scanner

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget URL or IP
templatesNoSpecific templates to run
severityNoMinimum severity level

Implementation Reference

  • Core handler function that executes the Nuclei vulnerability scanner. Constructs the command line with target, optional templates and severity filters, runs it via child_process.exec, parses JSONL output into structured results, handles errors, and returns formatted ScanResult.
    async nucleiScan(target: string, templates?: string[], severity?: string): Promise<ScanResult> {
      try {
        let command = `nuclei -target ${target} -json`;
        
        if (templates && templates.length > 0) {
          command += ` -t ${templates.join(',')}`;
        }
        
        if (severity) {
          command += ` -severity ${severity}`;
        }
        
        // Add rate limiting and timeout
        command += ' -rate-limit 10 -timeout 10';
        
        console.error(`Executing: ${command}`);
        
        const { stdout, stderr } = await execAsync(command, { 
          timeout: 600000, // 10 min timeout
          maxBuffer: 1024 * 1024 * 10 // 10MB buffer
        });
        
        const vulnerabilities: VulnerabilityResult[] = [];
        
        // Parse JSON output line by line
        const lines = stdout.split('\n').filter(line => line.trim());
        for (const line of lines) {
          try {
            const result = JSON.parse(line);
            vulnerabilities.push({
              id: result.info?.name || result.templateID || 'Unknown',
              name: result.info?.name || 'Unknown Vulnerability',
              severity: result.info?.severity || 'info',
              description: result.info?.description || 'No description available',
              solution: result.info?.remediation,
              references: result.info?.reference || [],
              cvss_score: result.info?.['cvss-score'],
              cve: result.info?.classification?.['cve-id'],
              affected_url: result.matched_at || target
            });
          } catch (e) {
            // Skip invalid JSON lines
          }
        }
        
        return {
          target,
          timestamp: new Date().toISOString(),
          tool: 'nuclei',
          results: {
            vulnerabilities,
            total_found: vulnerabilities.length,
            severity_breakdown: this.categorizeBySeverity(vulnerabilities),
            raw_output: stdout
          },
          status: 'success'
        };
      } catch (error) {
        return {
          target,
          timestamp: new Date().toISOString(),
          tool: 'nuclei',
          results: {},
          status: 'error',
          error: error instanceof Error ? error.message : String(error)
        };
      }
    }
  • Input schema definition for the nuclei_scan tool, specifying parameters: target (required), templates (array of strings), severity (enum). Registered in the MCP tool list.
      name: "nuclei_scan",
      description: "Run Nuclei vulnerability scanner",
      inputSchema: {
        type: "object",
        properties: {
          target: { type: "string", description: "Target URL or IP" },
          templates: { type: "array", items: { type: "string" }, description: "Specific templates to run" },
          severity: { type: "string", enum: ["info", "low", "medium", "high", "critical"], description: "Minimum severity level" }
        },
        required: ["target"]
      }
    },
  • src/index.ts:518-519 (registration)
    Tool registration in the MCP server request handler switch statement. Maps 'nuclei_scan' calls to the VulnScanTools.nucleiScan method with parsed arguments.
    case "nuclei_scan":
      return respond(await this.vulnScanTools.nucleiScan(args.target, args.templates, args.severity));
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool runs a vulnerability scanner, implying it performs read-only scanning, but it doesn't disclose critical traits like whether it's passive/active, potential impact on targets, authentication needs, rate limits, or output format. For a security tool with no annotation coverage, this is a significant gap.

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 a single, efficient sentence with zero waste—'Run Nuclei vulnerability scanner'—front-loading the core action and tool name appropriately. It's appropriately sized for the tool's complexity.

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 complexity of a vulnerability scanner, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, usage context, and what to expect from the scan results, making it inadequate for an agent to understand the tool's full implications and use it correctly in a security testing workflow.

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 (target, templates, severity) with descriptions and an enum for severity. The description adds no additional meaning beyond what the schema provides, such as explaining how templates are selected or what the scan entails. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'Run Nuclei vulnerability scanner' clearly states the action (run) and the tool/resource (Nuclei vulnerability scanner). It distinguishes this tool from siblings like nmap_scan or nikto_scan by specifying the particular scanner, but it doesn't explicitly differentiate its purpose from other vulnerability scanners in the list (e.g., burp_active_scan).

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. With many sibling tools for scanning and testing (e.g., nmap_scan, nikto_scan, burp_active_scan), there's no indication of scenarios where Nuclei is preferred, prerequisites, or exclusions, leaving usage context entirely implicit.

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/adriyansyah-mf/mcp-pentest'

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