Nmap MCP Server
The Nmap MCP Server provides a Model Control Protocol interface to interact with the nmap network scanner, allowing users to perform, manage, and analyze network scans.
Run nmap scans: Execute scans on specified targets with customizable options
Store and retrieve scan results: Save results and access them by ID
List all scans: View all available scan results
Analyze scan results: Use AI prompts to analyze results for security, services, or overview insights
Access scan results: Use defined URI scheme to access results as resources
Flexible deployment: Run from source, as an installed package, or within a Docker container
Provides integration with CentOS's package management system for installing nmap, enabling network scanning functionality on CentOS systems.
Provides integration with Debian's package management system for installing nmap, enabling network scanning functionality on Debian systems.
Provides integration with Fedora's package management system for installing nmap, enabling network scanning functionality on Fedora systems.
Utilizes Python and its ecosystem for implementing the MCP server, requiring Python 3.10+ for operation.
Provides integration with Ubuntu's package management system for installing nmap, enabling network scanning functionality on Ubuntu systems.
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 Server scan 192.168.1.1 for open ports with -sV option"
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
This is a Model Control Protocol (MCP) server that provides access to nmap network scanning functionality.
Features
Run nmap scans on specified targets with customizable options
Store and retrieve scan results
Analyze scan results using AI prompts
Related MCP server: Nmap MCP Server
Installation
Requirements:
Python 3.10+
python-libnmap
nmap (installed on the system)
pip install python-libnmapMake sure nmap is installed on your system:
# On Debian/Ubuntu
sudo apt-get install nmap
# On Fedora/CentOS
sudo dnf install nmapUsage
Running the Server
To run the server directly from the source code:
python -m src.nmap_mcpTo install the package and run as a command:
pip install -e .
nmap-mcpAvailable Tools
run-nmap-scan
Run an nmap scan on specified targets
Parameters:
target: Target host or network (e.g., 192.168.1.1 or 192.168.1.0/24)options: Nmap options (e.g., -sV -p 1-1000)
get-scan-details
Get detailed information about a specific scan
Parameters:
scan_id: ID of the scan to retrieve
list-all-scans
List all available scan results
No parameters required
Available Prompts
analyze-scan
Analyze an nmap scan result
Parameters:
scan_id: ID of the scan to analyzefocus: Focus area (security/services/overview)
Resources
Scan results are available as resources with the nmap://scan/{scan_id} URI scheme.
Example Workflow
Run a scan:
Call tool: run-nmap-scan Parameters: {"target": "192.168.1.0/24", "options": "-sV -p 22,80,443"}Get scan details:
Call tool: get-scan-details Parameters: {"scan_id": "<scan_id from previous step>"}List all scans:
Call tool: list-all-scansAnalyze scan results:
Get prompt: analyze-scan Parameters: {"scan_id": "<scan_id>", "focus": "security"}
Security Considerations
This server executes nmap commands on your system. Be cautious when scanning networks you don't own or have permission to scan, as unauthorized scanning may be illegal in some jurisdictions.
Troubleshooting
If you encounter errors related to nmap not being found or being executed incorrectly:
Make sure nmap is installed and available in your PATH
Check the logs for which nmap executable is being used
The server will attempt to use the full path to nmap to avoid conflicts
Docker Usage
You can run the MCP server in a Docker container:
# Build the Docker image
docker build -t nmap-mcp-server .
# Run the Docker container
docker run -it --rm nmap-mcp-serverFor integration with the Glama MCP directory, the Docker container allows others to easily use this MCP server without worrying about installation dependencies.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
3 toolsget-scan-detailsC
Get detailed information about a specific scan
Inputs: scan_id (required).
list-all-scansB
List all available scan results
Inputs: no named parameters.
run-nmap-scanC
Run an nmap scan on specified targets
Inputs: target (required), options.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose with no overlap: get-scan-details retrieves specific scan information, list-all-scans shows all available results, and run-nmap-scan performs new scans. The actions (get, list, run) and targets (details, scans, scan) are well-differentiated, making misselection unlikely.
All tools follow a consistent verb-noun pattern with hyphens (get-scan-details, list-all-scans, run-nmap-scan). The naming is predictable and readable, using clear action words and descriptive nouns without any deviations in style or convention.
With only 3 tools, the server feels thin for an nmap domain, which typically involves more operations like managing scan configurations, exporting results, or filtering scans. While the core functions are covered, the limited count may restrict agent flexibility in complex scenarios.
The tools cover the basic lifecycle of running, listing, and retrieving scans, but there are minor gaps such as updating or deleting scans, or handling scan parameters more granularly. Agents can work around these with the existing tools, but the surface is not fully comprehensive.
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Scans remote MCP servers for protocol, security, and TLS issues; exposes scan tools via MCP.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
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-
- 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.617Apache 2.0