nmap-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nmap-mcp discover live hosts in 192.168.1.0/24"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Nmap MCP Server by Vorota AI
nmap-mcp is a production-ready Model Context Protocol (MCP) server that wraps Nmap, the industry-standard network scanner, to enable AI agents to perform automated network security assessments. Built by Vorota AI, it provides 6 scanning tools, 9 scan types, and 6 timing templates -- making it the most comprehensive Nmap integration for AI-powered security workflows available today.
Quick Start
Build and run nmap-mcp with Docker (includes Nmap):
docker build -t nmap-mcp https://github.com/vorotaai/nmap-mcp.git
docker run --rm -i nmap-mcpThen add to any MCP client:
{
"mcpServers": {
"nmap-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "nmap-mcp"]
}
}
}Related MCP server: nmap-mcp
Features
nmap-mcp from Vorota AI exposes 6 specialized scanning tools to any MCP-compatible AI agent:
Port Scanning -- TCP Connect, SYN stealth, UDP, FIN, XMAS, NULL, and ACK scan types with configurable port ranges and timing templates (T0 through T5).
Host Discovery -- Ping-sweep an entire subnet to find live hosts before deeper scanning.
Service Detection -- Identify running services and their exact versions on open ports with adjustable probe intensity (0-9).
OS Fingerprinting -- Determine operating systems through TCP/IP stack analysis.
Vulnerability Scanning -- Run Nmap Scripting Engine (NSE) scripts in safe categories to detect known vulnerabilities.
Quick Scan -- Fast top-N port scan with aggressive timing for rapid reconnaissance.
All tools include built-in input validation, network size limits, and timeout enforcement to prevent misuse.
Recommended Workflow
For a thorough AI-powered security assessment, nmap-mcp tools are designed to be used in sequence:
Discover Hosts -- Use
discover-hoststo find live targets on the network.Quick Scan -- Run
quick-scanon discovered hosts for a fast overview of open ports.Port Scan -- Use
scan-portswith specific scan types for deeper port analysis.Detect Services -- Run
detect-serviceson open ports to identify software versions.Detect OS -- Use
detect-osto fingerprint the operating system (requires root).Scan Vulnerabilities -- Run
scan-vulnerabilitiesto check for known security issues.
AI agents like Claude, Cursor, and VS Code Copilot can orchestrate this entire workflow automatically in a single conversation.
Installation
Docker (recommended -- includes Nmap)
docker build -t nmap-mcp https://github.com/vorotaai/nmap-mcp.gitFrom source
Requires Python 3.10+, Nmap on PATH, and uv:
git clone https://github.com/vorotaai/nmap-mcp.git
cd nmap-mcp
uv sync --all-groups
nmap-mcpUsage with MCP Clients
nmap-mcp is compatible with all major MCP clients: Claude Desktop, Claude Code, Cursor, VS Code Copilot, Windsurf, and Cline.
First, build the Docker image:
docker build -t nmap-mcp https://github.com/vorotaai/nmap-mcp.gitClaude Desktop
Add to your Claude Desktop configuration file (claude_desktop_config.json):
{
"mcpServers": {
"nmap-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "nmap-mcp"]
}
}
}Claude Code
claude mcp add nmap-mcp -- docker run --rm -i nmap-mcpCursor
Or add manually to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"nmap-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "nmap-mcp"]
}
}
}VS Code / VS Code Insiders
Add to your VS Code settings (.vscode/mcp.json):
{
"servers": {
"nmap-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "nmap-mcp"]
}
}
}Windsurf / Cline
Use the same server configuration as Claude Desktop above. Refer to your client's documentation for the config file location.
Available Tools
Tool | Description | Key Parameters | Root Required |
| Port scan with configurable scan type, port range, and timing |
| Some types |
| Find live hosts on a network using ping scan (-sn) |
| No |
| Identify services and versions on open ports (-sV) |
| No |
| OS fingerprinting via TCP/IP stack analysis (-O) |
| Yes |
| Run NSE vulnerability detection scripts in safe categories |
| No |
| Fast top-N port scan with aggressive timing |
| No |
Scan Types
The scan-ports tool supports 7 scan types, each suited for different scenarios:
Scan Type | Flag | Root Required | Description |
|
| No | Full TCP handshake; reliable but detectable |
|
| Yes | SYN stealth scan; fast and less detectable |
|
| Yes | UDP port scan; slower but finds UDP services |
|
| Yes | FIN scan; stealthy, bypasses some firewalls |
|
| Yes | XMAS scan; sets FIN, PSH, URG flags |
|
| Yes | NULL scan; sends no flags |
|
| Yes | ACK scan; maps firewall rulesets |
Timing Templates
Template | Name | Use Case |
T0 | Paranoid | IDS evasion |
T1 | Sneaky | IDS evasion |
T2 | Polite | Reduced bandwidth usage |
T3 | Normal | Default speed |
T4 | Aggressive | Fast, reliable networks |
T5 | Insane | Fastest, may lose accuracy |
Configuration
nmap-mcp is configured through environment variables:
Variable | Default | Description |
|
| Path to the Nmap binary |
|
| Maximum scan duration in seconds |
|
| Maximum number of target hosts per scan (max /24 subnet) |
|
| Logging level (DEBUG, INFO, WARNING, ERROR) |
Example with custom configuration via Docker:
{
"mcpServers": {
"nmap-mcp": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "NMAP_SCAN_TIMEOUT=120",
"-e", "NMAP_MAX_TARGETS=128",
"-e", "FASTMCP_LOG_LEVEL=ERROR",
"nmap-mcp"
]
}
}
}Security
Authorization is required. nmap-mcp is a security tool that performs network scanning. You must ensure:
You have explicit authorization to scan any target network or host.
You comply with all applicable laws and organizational policies.
You use this tool only in environments where you have permission to conduct security assessments.
Safety Measures
nmap-mcp by Vorota AI implements multiple layers of security to prevent misuse:
Input validation -- All inputs are validated against a set of forbidden characters (
;,|,&,$,`,(,),{,},<,>, newlines) to prevent command injection attacks.Network size limits -- Scans are limited to a maximum of 256 hosts by default (equivalent to a /24 subnet). This is configurable via
NMAP_MAX_TARGETS.Restricted NSE categories -- Only safe script categories are allowed:
auth,default,discovery,safe,version, andvuln. Dangerous categories likeexploit,dos, andintrusiveare blocked.Configurable timeouts -- All scans have a configurable timeout with a hard maximum of 600 seconds to prevent runaway processes.
No shell execution -- All Nmap commands are executed using Python's
subprocessmodule with argument lists, never through a shell. This eliminates shell injection vectors entirely.
FAQ
What is nmap-mcp?
nmap-mcp is a Model Context Protocol (MCP) server built by Vorota AI that enables AI agents to perform Nmap network scans. It wraps the full power of Nmap -- port scanning, host discovery, service detection, OS fingerprinting, and vulnerability scanning -- into 6 structured tools that AI assistants like Claude, Cursor, and VS Code Copilot can call directly.
How do I use Nmap with AI agents?
Build the nmap-mcp Docker image and configure it as an MCP server in your AI client (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, or Cline). Once connected, you can ask the AI to scan networks, detect services, fingerprint operating systems, and find vulnerabilities using natural language. The AI agent will call the appropriate nmap-mcp tools and interpret the results for you.
Is nmap-mcp safe to use?
Yes. nmap-mcp includes multiple safety mechanisms: input validation to prevent command injection, network size limits to avoid scanning overly broad ranges, restricted NSE script categories that exclude dangerous scripts, configurable timeouts, and no shell execution. However, network scanning itself requires authorization -- always ensure you have permission before scanning any target.
What MCP clients are supported?
nmap-mcp works with all MCP-compatible clients, including Claude Desktop, Claude Code, Cursor, VS Code (via GitHub Copilot), Windsurf, and Cline. Any client that supports the Model Context Protocol's stdio transport can connect to nmap-mcp.
Contributing
Contributions are welcome. To set up the development environment:
git clone https://github.com/vorotaai/nmap-mcp.git
cd nmap-mcp
uv sync --all-groupsRunning Tests
uv run pytestCode Quality
uv run ruff check .
uv run ruff format .Please open an issue or pull request on GitHub for bugs, feature requests, or improvements.
License
This project is licensed under the Apache License 2.0.
Copyright (c) Vorota AI
Available Tools
6 toolsdetect-osA
Detect the operating system of a target host.
Uses nmap TCP/IP stack fingerprinting (-O) to identify the target's operating system. NOTE: This typically requires elevated privileges (root/sudo).
IMPORTANT: Only scan targets you are authorized to scan.
Returns: ScanResult with OS detection matches for the target host.
Inputs: target (required), timeout. Returns: Complete nmap scan result.
detect-servicesA
Detect services and versions running on open ports.
Uses nmap's service detection probes (-sV) to identify software names, versions, and CPE identifiers for services running on open ports.
IMPORTANT: Only scan targets you are authorized to scan.
Returns: ScanResult with service information for each open port.
Inputs: target (required), ports, intensity, timing, +1 more. Returns: Complete nmap scan result.
discover-hostsA
Discover live hosts on a network without performing a port scan.
Uses nmap ping scan (-sn) to identify which hosts are up on the target network. This is typically the first step in a network assessment.
IMPORTANT: Only scan networks you are authorized to scan.
Returns: HostDiscoveryResult with lists of hosts that are up and down.
Inputs: target (required), timing, timeout. Returns: Result of a host discovery scan.
quick-scanA
Perform a fast scan of the most common ports.
Scans the top N most frequently used ports with aggressive timing for quick results. Good for getting a fast security overview of a target.
IMPORTANT: Only scan targets you are authorized to scan.
Returns: ScanResult with discovered hosts and open ports.
Inputs: target (required), top_ports, service_detection, timeout. Returns: Complete nmap scan result.
scan-portsA
Scan ports on a target host or network.
Performs a port scan using nmap with the specified parameters. Validates all inputs to prevent command injection.
IMPORTANT: Only scan targets you are authorized to scan.
Returns: ScanResult with discovered hosts, ports, and their states.
Inputs: target (required), ports, scan_type, timing, +2 more. Returns: Complete nmap scan result.
scan-vulnerabilitiesA
Scan for known vulnerabilities using Nmap Scripting Engine (NSE).
Runs NSE vulnerability detection scripts against the target. Uses safe script categories by default. Results include CVE identifiers when available.
IMPORTANT: Only scan targets you are authorized to scan. Vulnerability scanning may trigger security alerts on the target network.
Returns: VulnScanResult with discovered vulnerabilities and their details.
Inputs: target (required), ports, scripts, timing, +1 more. Returns: Complete vulnerability scan result.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: host discovery, OS detection, service detection, quick port scan, comprehensive port scan, and vulnerability scanning. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern using lowercase and hyphens (e.g., detect-os, scan-ports). The only slight deviation is 'quick-scan' (adjective-verb), but it remains clear and predictable.
With 6 tools, the set is well-scoped for network scanning. It covers the essential nmap operations without being excessive or too sparse.
The tool surface covers the full lifecycle of network reconnaissance: host discovery, OS fingerprinting, service version detection, port scanning (both quick and thorough), and vulnerability scanning. No obvious gaps for typical use cases.
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Security scanner for AI agents and MCP servers: injection, jailbreak, tool abuse.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- FlicenseBqualityDmaintenanceExposes Nmap network scanning capabilities through a Model Context Protocol (MCP) server, allowing users to perform various types of network scans including vulnerability assessment, service detection, and OS fingerprinting.117-
- AlicenseNot gradedqualityDmaintenanceAn nmap MCP server for AI-assisted network security auditing, providing 14 purpose-built tools with structured JSON output.5MIT
- FlicenseNot gradedqualityDmaintenanceA production-style MCP server providing AI models with cybersecurity tools including port scanning, WHOIS, DNS, threat intelligence, CVE lookup, and more.-
- FlicenseNot gradedqualityDmaintenanceMCP server that wraps the nmap CLI to let agents run network scans (ping sweeps, TCP/UDP/service/OS scans, vulnerability and script scans, stealth and timing scans) and returns structured JSON results parsed from nmap XML output, with target validation and timeouts.-