mcp-server-nmap
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., "@mcp-server-nmapScan scanme.nmap.org for open ports"
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.
mcp-server-nmap
MCP server that exposes the python-nmap library as MCP tools for network scanning operations.
What is this?
This MCP server wraps the python-nmap library, allowing AI assistants to perform network reconnaissance through MCP tools. It provides three scanning interfaces:
PortScanner (synchronous) - Blocking scans that wait for completion
PortScannerAsync (asynchronous) - Non-blocking scans with callbacks
PortScannerYield (generator) - Streaming results as hosts are discovered
Related MCP server: Nmap MCP Server
Prerequisites
nmap must be installed on the system
Python 3.10+
Install
pip install mcp-server-nmapmcp-name: io.github.daedalus/mcp-server-nmap
MCP Server Registration
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"
}
}
}
}Available Tools
Initialization
Tool | Description |
| Initialize synchronous PortScanner |
| Initialize async PortScannerAsync |
| Initialize generator-based PortScannerYield |
Scanning
Tool | Description |
| Scan hosts with nmap (synchronous) |
| Scan hosts (async, non-blocking) |
| Scan with streaming results |
| List hosts without scanning |
Results & State
Tool | Description |
| Get all scanned hosts |
| Check if host was scanned |
| Get detailed host scan data |
| Get scan configuration info |
| Get scan statistics |
| Get nmap command used |
| Get CSV output |
| Get raw nmap text output |
Async Control
Tool | Description |
| Check if scan in progress |
| Stop running scan |
| Wait for scan to complete |
XML Parsing
Tool | Description |
| Parse existing nmap XML output |
Common Scan Workflows
Basic port scan
# 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")Service version detection
port_scanner_scan(hosts="scanme.nmap.org", arguments="-sV -sC")Scan multiple hosts
port_scanner_scan(hosts="192.168.1.1-254", arguments="-sS -p 22")
port_scanner_all_hosts()Network sweep
port_scanner_scan(hosts="192.168.1.0/24", arguments="-sn")
port_scanner_csv() # Export to CSVnmap Arguments Reference
Argument | Description |
| Ping scan (host discovery) |
| TCP SYN scan |
| TCP connect scan |
| UDP scan |
| Service version detection |
| Default scripts |
| OS detection |
| Port range |
| Output all formats |
Development
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/This server cannot be deployed
Maintenance
Related MCP Connectors
Scans remote MCP servers for protocol, security, and TLS issues; exposes scan tools via MCP.
Free, read-only security scanner for remote MCP servers, before you connect them.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
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.116-
- FlicenseNot gradedqualityDmaintenanceEnables network scanning and security assessment using Nmap through MCP, allowing AI assistants to perform port scans, service detection, and network reconnaissance on specified targets with configurable scan parameters.-
- AlicenseNot gradedqualityDmaintenanceEnables network security scanning using Nmap through MCP protocol. Supports quick port scans, full port scans with service detection, and custom Nmap commands with async task management.3MIT
- AlicenseAqualityDmaintenanceA production-ready MCP server that wraps Nmap to enable AI agents to perform automated network security assessments, including port scanning, host discovery, service detection, OS fingerprinting, and vulnerability scanning.616Apache 2.0