Skip to main content
Glama
mohdhaji87

Nmap MCP Server

by mohdhaji87

nmap_vulnerability_scan

Identify vulnerabilities on network targets using predefined detection scripts. Specify targets, ports, and categories to pinpoint security weaknesses for assessment.

Instructions

Run vulnerability detection scripts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portsNocommon
targetsYes
vuln_categoryNoall

Implementation Reference

  • The main handler function for the nmap_vulnerability_scan tool. It constructs Nmap arguments for vulnerability scanning based on the provided targets, ports, and vulnerability category, executes the scan using run_nmap_command, and returns the results or error message.
    async def nmap_vulnerability_scan( targets: str, ports: str = "common", vuln_category: str = "all" ) -> str: """Run vulnerability detection scripts.""" if vuln_category == "all": scripts = "vuln" else: scripts = f"vuln and {vuln_category}" args = [f"--script={scripts}", "-p", ports, targets] result = run_nmap_command(args, timeout=600) if result["success"]: return f"Vulnerability scan completed:\n\n{result['stdout']}" else: return f"Vulnerability scan failed:\n\n{result['stderr']}"
  • server.py:268-271 (registration)
    The @app.tool decorator that registers the nmap_vulnerability_scan tool with the FastMCP app, specifying its name and description.
    @app.tool( name="nmap_vulnerability_scan", description="Run vulnerability detection scripts" )

Other Tools

Related 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/mohdhaji87/Nmap-MCP-Server'

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