Nmap MCP Server
The Nmap MCP Server provides a Model Control Protocol interface to interact with the nmap network scanner, allowing users to perform, manage, and analyze network scans.
Run nmap scans: Execute scans on specified targets with customizable options
Store and retrieve scan results: Save results and access them by ID
List all scans: View all available scan results
Analyze scan results: Use AI prompts to analyze results for security, services, or overview insights
Access scan results: Use defined URI scheme to access results as resources
Flexible deployment: Run from source, as an installed package, or within a Docker container
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.
Utilizes Python and its ecosystem for implementing the MCP server, requiring Python 3.10+ for operation.
Provides integration with Ubuntu's package management system for installing nmap, enabling network scanning functionality on Ubuntu systems.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Nmap MCP Serverscan 192.168.1.1 for open ports with -sV option"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Nmap MCP Server
Installation
Requirements:
Python 3.10+
python-libnmap
nmap (installed on the system)
pip install python-libnmapMake sure nmap is installed on your system:
# On Debian/Ubuntu
sudo apt-get install nmap
# On Fedora/CentOS
sudo dnf install nmapUsage
Running the Server
To run the server directly from the source code:
python -m src.nmap_mcpTo install the package and run as a command:
pip install -e .
nmap-mcpAvailable Tools
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)
get-scan-details
Get detailed information about a specific scan
Parameters:
scan_id: ID of the scan to retrieve
list-all-scans
List all available scan results
No parameters required
Available Prompts
analyze-scan
Analyze an nmap scan result
Parameters:
scan_id: ID of the scan to analyzefocus: Focus area (security/services/overview)
Resources
Scan results are available as resources with the nmap://scan/{scan_id} URI scheme.
Example Workflow
Run a scan:
Call tool: run-nmap-scan Parameters: {"target": "192.168.1.0/24", "options": "-sV -p 22,80,443"}Get scan details:
Call tool: get-scan-details Parameters: {"scan_id": "<scan_id from previous step>"}List all scans:
Call tool: list-all-scansAnalyze 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:
Make sure nmap is installed and available in your PATH
Check the logs for which nmap executable is being used
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-serverFor 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.
Available Tools
3 toolsget-scan-detailsC
Get detailed information about a specific scan
| Name | Required | Description | Default |
|---|---|---|---|
| scan_id | Yes | ID of the scan to retrieve |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but lacks details on permissions, rate limits, error handling, or what 'detailed information' includes (e.g., format, fields). This is inadequate for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' entails (e.g., scan results, status, metadata), leaving the agent uncertain about the return values. For a tool with no structured output documentation, this gap is significant.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the single parameter 'scan_id' well-documented in the schema. The description adds no additional meaning beyond implying retrieval of a 'specific scan', which aligns with the schema but doesn't provide extra context like ID format or examples. This meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get detailed information') and resource ('about a specific scan'), making the purpose immediately understandable. It distinguishes from the sibling 'list-all-scans' by focusing on a single scan rather than multiple scans, though it doesn't explicitly differentiate from 'run-nmap-scan' beyond the verb difference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance is provided on when to use this tool versus alternatives. The description implies usage for retrieving details of a known scan, but it doesn't mention prerequisites (e.g., needing a scan ID from 'list-all-scans') or contrast with siblings like 'run-nmap-scan' for creating scans.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list-all-scansB
List all available scan results
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but only states the action without details on permissions, rate limits, pagination, or response format. It doesn't clarify if this lists historical scans, real-time results, or includes metadata, leaving significant gaps in understanding how the tool behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's front-loaded and wastes no words, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no annotations, no output schema, and sibling tools, the description is incomplete. It doesn't address behavioral traits like safety, performance, or how results are returned, nor does it help differentiate from alternatives, leaving the agent with insufficient context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, but this is appropriate given the schema's completeness, warranting a baseline score above minimum viable due to the lack of parameters to explain.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('all available scan results'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get-scan-details' or 'run-nmap-scan' beyond the basic listing action, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get-scan-details' for specific scan details or 'run-nmap-scan' to initiate new scans. It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage from tool names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run-nmap-scanC
Run an nmap scan on specified targets
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Target host or network (e.g., 192.168.1.1 or 192.168.1.0/24) | |
| options | No | Nmap options (e.g., -sV -p 1-1000) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Run an nmap scan') but doesn't describe what this entails—such as network impact, execution time, permission requirements, or output format. For a tool that likely performs network scanning, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste—it directly states the tool's purpose without unnecessary details. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of running an nmap scan (a network operation with potential side effects), the description is incomplete. With no annotations, no output schema, and minimal behavioral context, it fails to provide enough information for safe and effective use. The agent lacks details on execution behavior, results, or error handling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters ('target' and 'options') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as example usage or constraints, resulting in a baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Run') and resource ('nmap scan on specified targets'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'get-scan-details' or 'list-all-scans', which are clearly different operations, so it doesn't need explicit sibling differentiation for a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like network access or permissions, nor does it explain when to choose this over siblings like 'get-scan-details' or 'list-all-scans'. This lack of context leaves the agent with minimal usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
- First observed
get-scan-details - First observed
list-all-scans - First observed
run-nmap-scan
TDQS
Each tool has a clearly distinct purpose with no overlap: get-scan-details retrieves specific scan information, list-all-scans shows all available results, and run-nmap-scan performs new scans. The actions (get, list, run) and targets (details, scans, scan) are well-differentiated, making misselection unlikely.
All tools follow a consistent verb-noun pattern with hyphens (get-scan-details, list-all-scans, run-nmap-scan). The naming is predictable and readable, using clear action words and descriptive nouns without any deviations in style or convention.
With only 3 tools, the server feels thin for an nmap domain, which typically involves more operations like managing scan configurations, exporting results, or filtering scans. While the core functions are covered, the limited count may restrict agent flexibility in complex scenarios.
The tools cover the basic lifecycle of running, listing, and retrieving scans, but there are minor gaps such as updating or deleting scans, or handling scan parameters more granularly. Agents can work around these with the existing tools, but the surface is not fully comprehensive.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Scans remote MCP servers for protocol, security, and TLS issues; exposes scan tools via MCP.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Free, read-only security scanner for remote MCP servers, before you connect them.
Related MCP Servers
- FlicenseBqualityDmaintenanceExposes Nmap network scanning capabilities through a Model Context Protocol (MCP) server, allowing users to perform various types of network scans including vulnerability assessment, service detection, and OS fingerprinting.116-
- FlicenseNot gradedqualityDmaintenanceEnables network scanning and security assessment using Nmap through MCP, allowing AI assistants to perform port scans, service detection, and network reconnaissance on specified targets with configurable scan parameters.-
- AlicenseNot gradedqualityDmaintenanceEnables network security scanning using Nmap through MCP protocol. Supports quick port scans, full port scans with service detection, and custom Nmap commands with async task management.3MIT
- AlicenseAqualityDmaintenanceA production-ready MCP server that wraps Nmap to enable AI agents to perform automated network security assessments, including port scanning, host discovery, service detection, OS fingerprinting, and vulnerability scanning.616Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/imjdl/nmap-mcpserver'
If you have feedback or need assistance with the MCP directory API, please join our Discord server