Cover image
Try Now
2025-03-25

这是一个模型控制协议(MCP)服务器,可访问NMAP网络扫描功能。

3 years

Works with Finder

1

Github Watches

1

Github Forks

2

Github Stars

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    1 (1)
    Avatar
    user_Q1YUVe3T
    2025-04-16

    As a dedicated user of the MCP application, I find nmap-mcpserver by imjdl to be an invaluable tool. Its seamless integration and efficiency in network scanning make it a standout. Whether you are a seasoned professional or a newcomer, this tool greatly enhances productivity. Highly recommended for anyone serious about network management. Check it out at https://github.com/imjdl/nmap-mcpserver.