Model Context Protocol (MCP) server for interacting with Nmap network scanner
npm install gc-nmap-mcpA 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
``bashInstall globally
npm install -g gc-nmap-mcp
Configuration
This server requires the path to the Nmap executable to be set via the
NMAP_PATH environment variable.Example:
`bash
Linux/macOS
export NMAP_PATH=/usr/bin/nmapWindows
set NMAP_PATH=C:\Program Files (x86)\Nmap\nmap.exe
`Usage
$3
`bash
With NMAP_PATH environment variable set
npx gc-nmap-mcp
`$3
Add to your
claude_desktop_config.json:`json
{
"mcpServers": {
"nmap": {
"command": "npx",
"args": ["-y", "gc-nmap-mcp"],
"env": {
"NMAP_PATH": "C:\\Program Files (x86)\\Nmap\\nmap.exe"
}
}
}
}
`$3
For other MCP clients, you can configure them to use this server with:
`
NMAP_PATH=/path/to/nmap npx gc-nmap-mcp
`API
The server provides the following tool:
-
do-nmap`: Run Nmap with specified target and argumentsApache-2.0