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
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:
- Clone the repository:
git clone https://github.com/0xPratikPatil/NmapMCP.git
cd NmapMCP
- Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create a Python virtual environment with uv:
uv venv
- Install Python dependencies from pyproject.toml:
uv pip install -r pyproject.toml
- 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
jupyter
🪐 🔧 Model Context Protocol (MCP) Server for Jupyter.
mcp-security-hub
A growing collection of MCP servers bringing offensive security tools to AI assistants. Nmap, Ghidra, Nuclei, SQLMap, Hashcat and more.
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
falcon
Connect AI agents to CrowdStrike Falcon for automated security analysis and threat hunting
beemcp
BeeMCP: an unofficial Model Context Protocol (MCP) server that connects your Bee wearable lifelogger to AI via the Model Context Protocol
MCP-MultiServer-Interoperable-Agent2Agent-LangGraph-AI-System
This project demonstrates a decoupled real-time agent architecture that connects LangGraph agents to remote tools served by custom MCP (Modular Command Protocol) servers. The architecture enables a flexible and scalable multi-agent system where each tool can be hosted independently (via SSE or STDIO), offering modularity and cloud-deployable execut