Get the FREE Ultimate OpenClaw Setup Guide →

NmapMCP

NmapMCP is a robust integration of the Nmap scanning tool with the Model Context Protocol (MCP), enabling seamless network scanning capabilities within MCP-compatible environments

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio 0xpratikpatil-nmapmcp uv --directory /path/to/NmapMCP run main.py

How to use

NmapMCP exposes Nmap scanning capabilities inside an MCP-compatible environment. It aggregates a variety of network discovery and assessment features, including top ports scanning, DNS brute force, OS and version detection, several scan techniques (SYN, FIN, Idle, UDP, Ping, and TCP Connect), as well as host discovery methods like ARP and list/port scans. This enables you to perform targeted network assessments or inventory tasks directly through MCP tooling. To use it, configure the MCP interface to point at the NmapMCP server entry (as shown in the example configuration) and invoke the available scan commands via the MCP tools. The server leverages uv (Python) to run the underlying Python-based Nmap integration, making it suitable for environments that standardize on uv/pip-based workflows.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • uv (Python virtual environment manager) available or installable per instructions
  • Access to the repository containing NmapMCP

Manual installation steps:

  1. Clone the repository:
git clone https://github.com/0xPratikPatil/NmapMCP.git
cd NmapMCP
  1. Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create a Python virtual environment with uv:
uv venv
  1. Install Python dependencies from pyproject.toml:
uv pip install -r pyproject.toml
  1. Ensure your environment is configured to run the NmapMCP server using the provided configuration snippet. You may need to adjust paths in claude_desktop_config.json to point to your project location.

Additional notes

Notes:

  • The configuration example assumes you run the MCP server via uv with a main.py entry point. Adjust the --directory and main.py path to reflect your actual project layout.
  • If you require DNS resolution to be disabled during scans to speed up results, explore the Nmap options within the NmapMCP implementation and configure them accordingly.
  • Ensure you have appropriate permissions and legal authorization before performing network scans on target hosts.
  • If you encounter environment-related issues, confirm that Python and uv are correctly installed and that the working directory contains the expected main.py and dependencies from pyproject.toml.

Related MCP Servers

Sponsor this space

Reach thousands of developers