Skip to main content
Glama
mohdhaji87

Nmap MCP Server

by mohdhaji87

nmap_ping_scan

Discover live hosts on a network by performing a ping scan with this tool, designed to identify active devices efficiently using specified targets and scan types.

Instructions

Perform ping scan to discover live hosts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ping_typeNoboth
targetsYes

Implementation Reference

  • server.py:221-224 (registration)
    The @app.tool decorator registers the nmap_ping_scan tool with FastMCP, specifying its name and description.
    @app.tool( name="nmap_ping_scan", description="Perform ping scan to discover live hosts" )
  • The handler function executes the ping scan logic: constructs Nmap arguments based on ping_type (icmp/tcp/both), runs the command, and returns formatted output or error.
    async def nmap_ping_scan( targets: str, ping_type: str = "both" ) -> str: """Perform ping scan to discover live hosts.""" if ping_type == "icmp": args = ["-sn", targets] elif ping_type == "tcp": args = ["-PS", targets] else: # both args = ["-sn", "-PS", targets] result = run_nmap_command(args) if result["success"]: return f"Ping scan completed:\n\n{result['stdout']}" else: return f"Ping scan failed:\n\n{result['stderr']}"

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