
Nmap-MCP
An agent-based network scanning system that uses Nmap for network discovery and leverages DeepSeek API to analyze scan results for security vulnerabilities and recommendations.
README
Nmap-MCP: Agent-Based Network Scanning with DeepSeek API
Mô tả dự án
Dự án này triển khai một agent sử dụng Nmap để quét mạng và DeepSeek API (thông qua OpenRouter) để phân tích kết quả quét. Agent được thiết kế theo mô hình MCP (Multi-Agent Control Protocol), trong đó agent điều phối các tác vụ quét và phân tích. Các tính năng chính:
- Quét mạng bằng Nmap (TCP SYN, phát hiện dịch vụ, hệ điều hành).
- Phân tích kết quả quét bằng DeepSeek API để phát hiện lỗ hổng bảo mật và đưa ra khuyến nghị.
- Lưu kết quả quét vào tệp (results/scan_results.txt).
Dự án được phát triển bằng Python và chạy trên Visual Studio Code, sử dụng môi trường ảo (venv) để quản lý thư viện.
Cấu trúc dự án
Nmap-MCP/ ├── venv/ # Môi trường ảo Python ├── src/ │ ├── main.py # Script chính điều phối agent │ ├── nmap_scanner.py # Module xử lý quét Nmap │ ├── deepseek_analyzer.py # Module gọi DeepSeek API │ └── config.py # Cấu hình API key và IP mục tiêu ├── results/ │ └── scan_results.txt # Kết quả quét ├── requirements.txt # Danh sách thư viện └── README.md # Hướng dẫn này
Mội trường thực hiện
- Hệ điều hành: Windows 11 .
- Python 3.12.
- Cài sẵn Nmap.
- Cài sẵn Visual Studio Code
- DeepSeek API Key
Thiết lập môi trường
#2. Tạo và kích hoạt môi trường ảo
- Tạo môi trường ảo: cd D:\Nmap-MCP python -m venv venv
- Kích hoạt môi trường ảo:
.\venv\Scripts\activate.bat
- Nếu gặp lỗi The term '.\venv\Scripts\activate' is not recognized:
- Kiểm tra thư mục venv\Scripts\ có tệp activate.bat không.
- Xóa và tạo lại venv: powershell Remove-Item -Recurse -Force .\venv python -m venv venv .\venv\Scripts\activate.bat
- Nếu gặp lỗi The term '.\venv\Scripts\activate' is not recognized:
Cài đặt thư viện
Cài đặt các thư viện từ requirements.txt: pip install -r requirements.txt
Cấu hình API Key và IP mục tiêu
- Mở src/config.py.
- Cập nhật:
- DEEPSEEK_API_KEY: Thay bằng API key từ OpenRouter.
- TARGET_IP: Thay bằng IP bạn có quyền quét (ví dụ: 192.168.1.1).
Chạy chương trình
Kích hoạt môi trường ảo: .\venv\Scripts\activate.bat
- Nếu terminal tự động kích hoạt (do .vscode/settings.json), bạn sẽ thấy (venv). Chạy chương trình
- Chạy script chính: python src\main.py
- Nếu Nmap yêu cầu quyền quản trị (cho các lệnh như -sS hoặc -O):
- Mở PowerShell với quyền admin:
- Nhấn Win + X, chọn Windows PowerShell (Admin).
- Điều hướng và kích hoạt venv: powershell cd D:\Nmap-MCP .\venv\Scripts\activate.bat
- Chạy script: powershell python src\main.py
- Mở PowerShell với quyền admin:
Kiểm tra kết quả
- Kết quả quét: Lưu tại results/scan_results.txt.
- Phân tích từ DeepSeek: Hiển thị trên terminal, bao gồm nhận xét về lỗ hổng bảo mật và khuyến nghị.
- Nếu gặp lỗi:
- Lỗi Nmap: Đảm bảo Nmap được cài và thêm vào PATH.
- Lỗi API: Kiểm tra API key trong src/config.py và kết nối mạng.
- Lỗi Python: Kiểm tra phiên bản Python và thư viện bằng pip list.
Khắc phục sự cố
- Lỗi kích hoạt venv:
- Kiểm tra venv\Scripts\activate.bat tồn tại.
- Tái tạo venv (xem Thiết lập môi trường).
- Lỗi pip install:
- Cập nhật pip: python -m pip install --upgrade pip
- Lỗi Nmap không tìm thấy:
- Thêm Nmap vào PATH hoặc cài lại.
- Lỗi quyền admin:
- Chạy PowerShell với quyền quản trị.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.