Kali MCP Server
Exposes Kali Linux penetration testing tools for network reconnaissance, web application testing, vulnerability assessment, and Active Directory enumeration.
Provides WordPress vulnerability scanning via the wpscan tool, including detection of vulnerabilities, themes, and plugins.
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., "@Kali MCP Serverscan example.com with nmap for open ports"
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.
Kali MCP Server
Production-grade MCP server that exposes Kali Linux penetration testing tools to AI agents via the Model Context Protocol (MCP).
Quick Start
# Install dependencies
just install
# Start the server
just start
# Or with debug logging
just debugThe server runs on http://0.0.0.0:8399/mcp by default. Point your AI agent's MCP client at this URL to connect.
Related MCP server: Arsenal MCP
Configuration
Copy .env and adjust values:
Variable | Default | Description |
|
| Listen address |
|
| Listen port |
|
| Default command timeout (seconds) |
|
| Maximum allowed timeout |
|
| Max concurrent tool executions |
|
| Log output directory |
|
| Command output artifacts |
|
| Enable verbose debug logging |
Available Tools (23)
Reconnaissance
Tool | Description |
| Network port scanner with service/version detection |
| Fast TCP/UDP port scanner (SYN scan support) |
| Passive subdomain discovery |
| Attack surface mapping and subdomain enumeration |
| Email, subdomain, and name harvesting from public sources |
| OSINT automation and reconnaissance |
| Web crawler and URL discovery |
Web Application
Tool | Description |
| HTTP probing, technology detection, and web recon |
| Template-based vulnerability scanner |
| Web fuzzer — directory discovery, parameter fuzzing |
| Web technology fingerprinting (CMS, frameworks, libraries) |
| HTTP parameter discovery — finds hidden GET/POST/JSON params |
Vulnerability Assessment
Tool | Description |
| SQL injection detection and exploitation |
| Command injection detection and exploitation |
| WordPress vulnerability scanner |
Active Directory
Tool | Description |
| SMB/Samba enumeration |
| Network protocol execution (SMB, WinRM, SSH, LDAP, RDP) |
| Legacy CME wrapper (routes to netexec if unavailable) |
| SharpHound/BloodHound AD collection |
File Operations
Tool | Description |
| Read files from the Kali machine with offset and truncation support |
| Create/write files on the Kali machine (auto-creates directories) |
Generic Execution
Tool | Description |
| Execute arbitrary shell commands (pipes, redirects, |
| Execute Python code directly (imports, loops, data processing) |
Adding a New Tool
Creating a new tool takes ~30 lines. Here's the full process:
1. Create the tool file
Create mcp-server/tools/your_tool.py:
"""YourTool description."""
from __future__ import annotations
from typing import Any
from tools.base import BaseTool
from execution import engine
from validation import validate_required, validate_timeout
from models import ToolError
from responses import success_response, error_response
class YourTool(BaseTool):
@property
def name(self) -> str:
return "yourtool" # CLI name of the tool on the Kali machine
@property
def description(self) -> str:
return "Human-readable description shown to the AI agent."
@property
def default_timeout(self) -> int:
return 300 # seconds
def input_schema(self) -> dict[str, Any]:
"""JSON Schema for tool parameters. Becomes the tool's input contract."""
return {
"type": "object",
"properties": {
"target": {
"type": "string",
"description": "What to scan",
},
"extra_args": {
"type": "string",
"description": "Additional CLI arguments (e.g. '-v --output json')",
},
"timeout": {
"type": "integer",
"description": "Timeout in seconds",
"default": 300,
},
},
"required": ["target"],
}
def validate(self, arguments: dict[str, Any]) -> None:
"""Validate inputs before building command. Raise ValueError on bad input."""
validate_required(arguments, "target")
if "timeout" in arguments:
validate_timeout(arguments["timeout"])
def build_command(self, arguments: dict[str, Any]) -> list[str]:
"""Convert validated arguments into a command list (no shell injection)."""
cmd = ["yourtool", arguments["target"]]
if "extra_args" in arguments:
cmd.extend(arguments["extra_args"].split())
return cmd
async def execute(self, arguments: dict[str, Any]) -> dict[str, Any]:
"""Run the tool via the execution engine."""
try:
self.validate(arguments)
except ValueError as e:
return error_response(ToolError(error="Validation error", details=str(e)))
result = await engine.execute(
command=self.build_command(arguments),
tool=self.name,
timeout=arguments.get("timeout", self.default_timeout),
)
return success_response(result)2. Register it
Add to mcp-server/tools/__init__.py:
from tools.your_tool import YourTool # add this importAnd append to ALL_TOOLS:
ALL_TOOLS = [
# ... existing tools ...
YourTool(), # add this line
]3. Verify
cd mcp-server
python3 -c "from tools.your_tool import YourTool; t = YourTool(); print(t.name, t.description)"
just test # run smoke testsThat's it. The server auto-registers it on next start.
Available Validators
Use these in your validate() method:
Validator | Usage |
| Ensure field is present |
| Validate IPv4 address |
| Validate CIDR notation |
| Validate domain name |
| Validate full URL |
| Validate against allowed values |
| Validate timeout bounds |
| Validate port specification |
Architecture
┌─────────────────────────────────────────────────┐
│ AI Agent (Claude, GPT, Gemini, etc.) │
└────────────────────┬────────────────────────────┘
│ MCP (SSE)
┌────────────────────▼────────────────────────────┐
│ FastMCP Server (server.py) │
│ ┌──────────────┐ ┌─────────────────────────┐ │
│ │ ToolRegistry │ │ Health Check │ │
│ └──────┬───────┘ └─────────────────────────┘ │
│ │ │
│ ┌──────▼──────────────────────────────────┐ │
│ │ Tools (20 native + generic_command) │ │
│ │ validate → build_command → execute │ │
│ └──────┬──────────────────────────────────┘ │
│ │ │
│ ┌──────▼──────────────────────────────────┐ │
│ │ ExecutionEngine (async subprocess) │ │
│ │ semaphore → run → log → return │ │
│ └──────┬──────────────────────────────────┘ │
│ │ │
│ ┌──────▼──────────────────────────────────┐ │
│ │ Structured JSON Response │ │
│ │ stdout, stderr, exit_code, timing │ │
│ └─────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘Just Commands
just install — Install Python dependencies
just start — Start the server (foreground)
just debug — Start with debug logging
just test — Run smoke tests
just health — Check if server is running
just logs — Tail server logs
just exec-logs — Tail execution audit logs
just tools — List all registered tools
just clean — Clear logs and artifactsProject Structure
mcp-server/
├── server.py ← Entry point — FastMCP SSE server
├── config.py ← Environment-based configuration
├── models.py ← ExecutionResult, ToolError dataclasses
├── execution.py ← Async subprocess execution engine
├── validation.py ← Input validators (IP, domain, URL, etc.)
├── logging_utils.py ← Structured JSON logging
├── responses.py ← MCP response builders
├── security.py ← Command sanitization
├── registry.py ← Tool name → instance registry
├── requirements.txt ← Python dependencies
├── test_server.py ← Smoke tests
├── tools/
│ ├── __init__.py ← Auto-imports all tools
│ ├── base.py ← BaseTool abstract class
│ ├── generic_command.py ← Escape hatch
│ ├── nmap.py ├── naabu.py
│ ├── httpx.py ├── nuclei.py
│ ├── ffuf.py ├── katana.py
│ ├── subfinder.py ├── amass.py
│ ├── sqlmap.py ├── commix.py
│ ├── wpscan.py ├── whatweb.py
│ ├── arjun.py ├── enum4linux.py
│ ├── netexec.py ├── crackmapexec.py
│ ├── bloodhound.py ├── theharvester.py
│ └── spiderfoot.py
├── utils/
│ └── process.py ← Kill process tree helper
├── logs/ ← Runtime logs
└── artifacts/ ← Command output artifactsThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/magichrist/kali-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server