Nmap MCP Server

MIT License
2
  • Linux

Integrations

  • 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.

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)
pip install python-libnmap

Make sure nmap is installed on your system:

# On Debian/Ubuntu sudo apt-get install nmap # On Fedora/CentOS sudo dnf install nmap

Usage

Running the Server

To run the server directly from the source code:

python -m src.nmap_mcp

To install the package and run as a command:

pip install -e . nmap-mcp

Available Tools

  1. 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)
  2. get-scan-details
    • Get detailed information about a specific scan
    • Parameters:
      • scan_id: ID of the scan to retrieve
  3. list-all-scans
    • List all available scan results
    • No parameters required

Available Prompts

  1. analyze-scan
    • Analyze an nmap scan result
    • Parameters:
      • scan_id: ID of the scan to analyze
      • focus: Focus area (security/services/overview)

Resources

Scan results are available as resources with the nmap://scan/{scan_id} URI scheme.

Example Workflow

  1. Run a scan:
    Call tool: run-nmap-scan Parameters: {"target": "192.168.1.0/24", "options": "-sV -p 22,80,443"}
  2. Get scan details:
    Call tool: get-scan-details Parameters: {"scan_id": "<scan_id from previous step>"}
  3. List all scans:
    Call tool: list-all-scans
  4. Analyze 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:

  1. Make sure nmap is installed and available in your PATH
  2. Check the logs for which nmap executable is being used
  3. 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-server

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.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

  1. Features
    1. Installation
      1. Usage
        1. Running the Server
        2. Available Tools
        3. Available Prompts
        4. Resources
      2. Example Workflow
        1. Security Considerations
          1. Troubleshooting
            1. Docker Usage
              1. License

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables AI assistants to perform network scanning operations using NMAP, offering a standardized interface for network analysis and security assessments through AI conversations.
                  Last updated -
                  11
                  3
                  JavaScript
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server implementation that allows AI models to interact with and manage Spinnaker deployments, pipelines, and applications through a standardized interface.
                  Last updated -
                  14
                  TypeScript
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Control Protocol server that enables AI assistants to interact with Metabase databases, allowing models to explore database schemas, retrieve metadata, visualize relationships, and execute actions.
                  Last updated -
                  1
                  Python
                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server that integrates essential penetration testing tools (Nmap, Gobuster, Nikto, John the Ripper) into a unified natural language interface, allowing security professionals to execute and chain multiple tools through conversational commands.
                  Last updated -
                  8
                  1
                  TypeScript
                  • Linux
                  • Apple

                View all related MCP servers

                ID: gcgprpoj1q