Get the FREE Ultimate OpenClaw Setup Guide →

nmap

A Model Context Protocol (MCP) server that enables AI assistants to perform network scanning operations using NMAP

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio phialsbasement-nmap-mcp-server node C:\Users\YOUR_USERNAME\Downloads\mcp-nmap-server\dist\index.js

How to use

This MCP server exposes NMAP functionality to AI agents through a standardized run_nmap_scan interface. It enables AI-powered conversations to initiate network scans, retrieve results, and customize scans using common NMAP options. The server acts as a bridge between the AI model and the native NMAP CLI, ensuring operations are invoked securely and consistently from within an MCP workflow. When integrated with an AI assistant, you can request quick scans, full port sweeps, version detection, or tailored timing templates, and receive structured results that the AI can parse and present.

To use it, configure the server in your MCP client (e.g., Claude Desktop) so that it can be invoked via the run_nmap_scan function. The function accepts parameters such as target, ports, scanType, timing, and additionalFlags. For example, you can ask the AI to scan a host for open ports using a quick scan, or perform a comprehensive version-detect sweep with a custom timing profile. The server translates these requests into NMAP CLI invocations and returns the results in a structured format suitable for AI processing.

How to install

Prerequisites:

  • Windows operating system
  • Node.js v18 or higher
  • NMAP installed and accessible from Windows command line
  • TypeScript (for development)

Installation via Smithery:

npx -y @smithery/cli install mcp-nmap-server --client claude

Manual Installation:

  1. Install the package globally using npm:
npm install -g mcp-nmap-server
  1. Or install locally in your project:
npm install mcp-nmap-server
  1. Ensure NMAP is installed and available in your system PATH. Verify by running nmap -version from a command prompt.

  2. Start the MCP NMAP server (example for global install):

npx mcp-nmap-server --help

Note: Adjust the command or paths according to your environment when embedding the server in your MCP client configuration.

Additional notes

Tips and common considerations:

  • Ensure NMAP is installed and accessible from the system PATH on Windows where the server runs.
  • The provided configuration example uses a Windows path to dist/index.js; replace YOUR_USERNAME and the path with your actual installation path.
  • If you run the server locally, you may want to build TypeScript sources (if applicable) before starting the server so dist/index.js exists.
  • In Claude Desktop (or other MCP clients), add the server under mcpServers with the command set to node and the appropriate path to the built index.js.
  • For security, limit network access to the MCP server and validate inputs from AI prompts before invoking NMAP through the server.
  • If you encounter path or permission issues on Windows, run the command prompt as Administrator or adjust file permissions accordingly.
  • You can extend or customize the accepted NMAP flags via the additionalFlags parameter in the run_nmap_scan interface.

Related MCP Servers

Sponsor this space

Reach thousands of developers