mcp-server-nmap
Click on "Install 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
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/daedalus/mcp-server-nmap'
If you have feedback or need assistance with the MCP directory API, please join our Discord server