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.
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
Installation
Requirements:
- Python 3.10+
- python-libnmap
- nmap (installed on the system)
Make sure nmap is installed on your system:
Usage
Running the Server
To run the server directly from the source code:
To install the package and run as a command:
Available 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:
- Get scan details:
- List all scans:
- Analyze scan results:
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:
For 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.
local-only server
The server can only run on the client's local machine because it depends on local resources.
A Model Control Protocol server that provides access to nmap network scanning functionality, allowing users to run customizable scans, store results, and analyze network security using AI prompts.
Related MCP Servers
- -securityAlicense-qualityEnables AI assistants to perform network scanning operations using NMAP, offering a standardized interface for network analysis and security assessments through AI conversations.Last updated -25025JavaScriptMIT License
Semgrep MCP Serverofficial
AsecurityAlicenseAqualityAn MCP server that provides a comprehensive interface to Semgrep, enabling users to scan code for security vulnerabilities, create custom rules, and analyze scan results through the Model Context Protocol.Last updated -6325PythonMIT License- -securityAlicense-qualityA Model Context Protocol server that provides network analysis tools for security professionals, enabling AI models like Claude to perform tasks such as ASN lookups, DNS analysis, WHOIS retrieval, and IP geolocation for security investigations.Last updated -1PythonApache 2.0
- -securityAlicense-qualitySecure network administration MCP server that enables AI assistants to safely execute networking commands like SSH, ping, and DNS lookups inside a Docker container sandbox.Last updated -18PythonMIT License