A Model Context Protocol (MCP) server for interacting with the Nmap network scanner.
- Run Nmap scans with customizable parameters
- Provides the full power of Nmap to AI assistants
- Supports all Nmap scan types and options
- Easy integration with Claude and other MCP-compatible AI assistants
# Install globally
npm install -g gc-nmap-mcp
# Or run directly without installing
npx gc-nmap-mcp
This server requires the path to the Nmap executable to be set via the NMAP_PATH
environment variable.
Example:
# Linux/macOS
export NMAP_PATH=/usr/bin/nmap
# Windows
set NMAP_PATH=C:\Program Files (x86)\Nmap\nmap.exe
# With NMAP_PATH environment variable set
npx gc-nmap-mcp
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"nmap": {
"command": "npx",
"args": ["-y", "gc-nmap-mcp"],
"env": {
"NMAP_PATH": "C:\\Program Files (x86)\\Nmap\\nmap.exe"
}
}
}
}
For other MCP clients, you can configure them to use this server with:
NMAP_PATH=/path/to/nmap npx gc-nmap-mcp
The server provides the following tool:
-
do-nmap
: Run Nmap with specified target and arguments
Apache-2.0