Nmap MCP Server
@imjdl
About Nmap MCP Server
This is a Model Control Protocol (MCP) server that provides access to nmap network scanning functionality.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"nmap-mcpserver": {
"command": "python",
"args": [
"-m",
"src.nmap_mcp"
]
}
}
}Tools
2`target`: Target host or network (e.g., 192.168.1.1 or 192.168.1.0/24)
`scan_id`: ID of the scan to retrieve
Overview
What is Nmap MCP Server?
It is a Model Context Protocol (MCP) server that provides access to nmap network scanning functionality, allowing AI models to run scans, retrieve results, and analyze them via prompts.
How to use Nmap MCP Server?
Install Python 3.10+, python‑libnmap, and system‑installed nmap. Run the server with python -m src.nmap_mcp or install the package with pip install -e . and use the nmap-mcp command. A Docker image is also provided for containerized use.
Key features of Nmap MCP Server?
- Run nmap scans with custom target and options
- Store and retrieve scan results
- Analyze scan results using AI prompts
- Access scans via
nmap://scan/{scan_id}resource URIs - List all saved scan results with no parameters
- Docker support for easy deployment
Use cases of Nmap MCP Server?
- Scan a local network to discover live hosts and open ports
- Perform service version detection on specific ports using
-sV - Analyze a scan result with a security‑focused AI prompt
- Retrieve details of a previous scan by its ID
- List all historical scans for auditing or reporting
FAQ from Nmap MCP Server
What dependencies are required?
Python 3.10+ and the python-libnmap package, plus nmap installed on the system (e.g., sudo apt-get install nmap).
How do I run the server?
Directly with python -m src.nmap_mcp from the source directory, or install the package and run the nmap-mcp command. A Docker container can also be built and run.
What security considerations exist?
The server executes nmap commands on your system. Unauthorized scanning may be illegal in some jurisdictions; always scan only networks you own or have permission to scan.
What if nmap is not found or fails?
Ensure nmap is installed and available in your PATH. The server logs the nmap executable being used and will attempt to use the full path to avoid conflicts.
Is Docker usage supported?
Yes. Build the image with docker build -t nmap-mcp-server . and run with docker run -it --rm nmap-mcp-server. This simplifies deployment without worrying about installation dependencies.
Frequently asked questions
What dependencies are required?
Python 3.10+ and the `python-libnmap` package, plus nmap installed on the system (e.g., `sudo apt-get install nmap`).
How do I run the server?
Directly with `python -m src.nmap_mcp` from the source directory, or install the package and run the `nmap-mcp` command. A Docker container can also be built and run.
What security considerations exist?
The server executes nmap commands on your system. Unauthorized scanning may be illegal in some jurisdictions; always scan only networks you own or have permission to scan.
What if nmap is not found or fails?
Ensure nmap is installed and available in your PATH. The server logs the nmap executable being used and will attempt to use the full path to avoid conflicts.
Is Docker usage supported?
Yes. Build the image with `docker build -t nmap-mcp-server .` and run with `docker run -it --rm nmap-mcp-server`. This simplifies deployment without worrying about installation dependencies.
Basic information
More Other MCP servers
Codelf
unbugA search tool helps dev to solve the naming things problem.
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
ghidraMCP
LaurieWiredMCP Server for Ghidra
Awesome Mlops
visengerA curated list of references for MLOps
Comments