MCP server for python-nmap network scanning
SaferSkills independently audited mcp-server-nmap (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
MCP server that exposes the python-nmap library as MCP tools for network scanning operations.
This MCP server wraps the python-nmap library, allowing AI assistants to perform network reconnaissance through MCP tools. It provides three scanning interfaces:
pip install mcp-server-nmapmcp-name: io.github.daedalus/mcp-server-nmap
Add this to your MCP settings file:
{
"mcpServers": {
"mcp-server-nmap": {
"command": "mcp-server-nmap"
}
}
}Or with custom nmap path:
{
"mcpServers": {
"mcp-server-nmap": {
"command": "mcp-server-nmap",
"env": {
"PATH": "/custom/path:$PATH"
}
}
}
}| Tool | Description |
|---|---|
port_scanner_init | Initialize synchronous PortScanner |
port_scanner_async_init | Initialize async PortScannerAsync |
port_scanner_yield_init | Initialize generator-based PortScannerYield |
| Tool | Description |
|---|---|
port_scanner_scan | Scan hosts with nmap (synchronous) |
port_scanner_async_scan | Scan hosts (async, non-blocking) |
port_scanner_yield_scan | Scan with streaming results |
port_scanner_listscan | List hosts without scanning |
| Tool | Description |
|---|---|
port_scanner_all_hosts | Get all scanned hosts |
port_scanner_has_host | Check if host was scanned |
port_scanner_get_item | Get detailed host scan data |
port_scanner_scaninfo | Get scan configuration info |
port_scanner_scanstats | Get scan statistics |
port_scanner_command_line | Get nmap command used |
port_scanner_csv | Get CSV output |
port_scanner_last_output | Get raw nmap text output |
| Tool | Description |
|---|---|
port_scanner_async_still_scanning | Check if scan in progress |
port_scanner_async_stop | Stop running scan |
port_scanner_async_wait | Wait for scan to complete |
| Tool | Description |
|---|---|
port_scanner_analyse_xml | Parse existing nmap XML output |
# Initialize scanner
port_scanner_init()
# Scan target
port_scanner_scan(hosts="192.168.1.1", ports="22,80,443", arguments="-sV")
# Get results
port_scanner_get_item(host="192.168.1.1")port_scanner_scan(hosts="scanme.nmap.org", arguments="-sV -sC")port_scanner_scan(hosts="192.168.1.1-254", arguments="-sS -p 22")
port_scanner_all_hosts()port_scanner_scan(hosts="192.168.1.0/24", arguments="-sn")
port_scanner_csv() # Export to CSV| Argument | Description |
|---|---|
-sn | Ping scan (host discovery) |
-sS | TCP SYN scan |
-sT | TCP connect scan |
-sU | UDP scan |
-sV | Service version detection |
-sC | Default scripts |
-O | OS detection |
-p | Port range |
-oA | Output all formats |
git clone https://github.com/daedalus/mcp-server-nmap.git
cd mcp-server-nmap
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.