nmap
MCP server for AI-powered network scanning with Nmap. Port scanning, service detection, OS fingerprinting, and vulnerability scanning for AI agents. By Vorota AI.
claude mcp add --transport stdio vorota-ai-nmap-mcp docker run --rm -i nmap-mcp \ --env NMAP_BINARY="Path to the Nmap binary (default: nmap)" \ --env NMAP_MAX_TARGETS="Maximum number of target hosts per scan (default: 256)" \ --env FASTMCP_LOG_LEVEL="Logging level (DEBUG, INFO, WARNING, ERROR) (default: WARNING)" \ --env NMAP_SCAN_TIMEOUT="Maximum scan duration in seconds (default: 600)"
How to use
nmap-mcp exposes six scanning tools that wrap Nmap for AI-driven network assessment within MCP workflows. The tools include discover-hosts for host discovery, quick-scan for rapid port surveying, scan-ports for configurable port scanning across multiple scan types and timing templates, detect-services to identify service versions, detect-os for OS fingerprinting, and scan-vulnerabilities to run NSE scripts in safe categories. Use these tools in sequence to perform a structured security assessment: start by discovering live hosts, followed by a quick overview, then deeper port scanning, service detection, OS fingerprinting (where root access is available), and finally vulnerability checks with NSE. The server is Docker-based, making it easy to integrate with any MCP client like Claude, Cursor, Windsurf, or VS Code Copilot. Each tool supports input validation and sensible defaults to keep usage safe in autonomous workflows.
How to install
Prerequisites:
- Docker installed and running
- Optional: Python 3.10+ if you prefer building from source, and Nmap installed on PATH if you plan to run locally outside Docker
Installation steps (Docker, recommended):
- Build the Docker image
docker build -t nmap-mcp https://github.com/vorotaai/nmap-mcp.git
- Run the container (example):
docker run --rm -i nmap-mcp
- Configure MCP client to connect to this server (example configuration):
{
"mcpServers": {
"nmap-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "nmap-mcp"]
}
}
}
If you prefer building from source (requires Python 3.10+, Nmap on PATH, and uv):
- Clone the repository
git clone https://github.com/vorotaai/nmap-mcp.git
cd nmap-mcp
- Install/run with uv (advanced users)
uv sync --all-groups
nmap-mcp
- Ensure Nmap is accessible via PATH and environment variables are configured as needed.
Additional notes
Environment variables allow tuning and safety controls:
- NMAP_BINARY: path to the Nmap binary (default: nmap)
- NMAP_SCAN_TIMEOUT: maximum duration per scan (default: 600 seconds)
- NMAP_MAX_TARGETS: max number of targets per scan (default: 256)
- FASTMCP_LOG_LEVEL: logging level (DEBUG, INFO, WARNING, ERROR; default: WARNING)
Common issues:
- Ensure you have explicit authorization to scan the target network.
- If OS fingerprinting (detect-os) requires root, run with appropriate privileges.
- For large networks, adjust NMAP_MAX_TARGETS and NMAP_SCAN_TIMEOUT to avoid timeouts or excessive load.
- When using Docker, ensure the image name matches and the container has network access to targets.
Configuration tips:
- Use the provided example mcpServers config blocks to wire the server into MCP clients.
- You can override environment variables via the docker run -e options when embedding in client configs.
Related MCP Servers
mcp-security-hub
A growing collection of MCP servers bringing offensive security tools to AI assistants. Nmap, Ghidra, Nuclei, SQLMap, Hashcat and more.
agentql
Model Context Protocol server that integrates AgentQL's data extraction capabilities.
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
unity-api
Instant, accurate Unity API lookups instead of expensive source file reads, saving your agent tokens, context, and hallucinations
shodan
Shodan MCP server for Claude, Cursor & VS Code. 20 tools for passive reconnaissance, CVE/CPE intelligence, DNS analysis, and device search. 4 tools work free without an API key. OSINT and vulnerability research from your IDE.
mcp-spotify-player
MCP server to manage Spotify from MCP clients