MCP-Kali-Server
Allows executing arbitrary commands and running a wide variety of Kali Linux security tools (e.g., nmap, masscan, gobuster, sqlmap, hydra, john, wpscan, enum4linux) on a Kali VM through the MCP server.
Provides a dedicated tool for running Metasploit modules and exploits on the target Kali system.
Click on "Deploy 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., "@MCP-Kali-ServerRun nmap -sV against 10.0.0.1"
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.
MCP-Kali-Server
将 Kali Linux VM 的能力通过 MCP 暴露给 Claude Code 的 API 桥。包含 Kali 侧命令执行服务端(server.py)和 MCP 网关客户端(client.py),配合 execute_command 可执行 Kali 上任意工具。
架构
Claude Code
│ stdio (client.py)
▼
client.py ──HTTP──► server.py (Kali VM, 127.0.0.1:5000)
│ subprocess
▼
Kali 工具 (nmap/masscan/impacket...)server.py:跑在 Kali VM,Flask HTTP API,执行命令并返回结构化结果client.py:MCP 网关,把工具调用转发到 Kali server
Related MCP server: Kali Linux MCP Server
工具面
12 个专用 MCP 工具:nmap_scan / gobuster_scan / dirb_scan / nikto_scan / sqlmap_scan / metasploit_run / hydra_attack / john_crack / wpscan_analyze / enum4linux_scan / server_health / execute_command
通用 kali_tool(tool, params) 调度器:走 TOOL_SPECS 规格表,覆盖 57 工具——
类别 | 工具 |
侦察 | masscan / netdiscover / theharvester / whatweb / wafw00f / dnsrecon / dnsenum / fierce / amass / subfinder / httpx / dig / whois / dnsx |
Web/目录 | ffuf / wfuzz / dirsearch / feroxbuster / nuclei / commix / joomscan / arjun |
服务枚举 | smbclient / smbmap / rpcclient / nbtscan / ldapsearch / snmpwalk / onesixtyone / nmblookup |
利用/凭据 | msfvenom / searchsploit / hashcat / responder / netexec / secretsdump / hashid / ncrack / cewl |
AD/横向 | psexec / wmiexec / ntlmrelayx / evil-winrm / xfreerdp / bloodhound |
流量 | tcpdump / tshark / ngrep / arpspoof / tcpflow |
取证 | binwalk / exiftool / steghide / foremost |
无线 | aircrack-ng / airmon-ng / reaver |
后渗透 | proxychains |
每个工具都支持 additional_args 透传,配合 execute_command 可覆盖 Kali 全能力。
本版增强功能
通用工具调度器:
TOOL_SPECS规格表 +/api/tools/run,一行规格加一个工具,无需逐个写 wrapper自动 sudo:需要 root 的工具(masscan/arp-scan/tcpdump/无线类)自动加
sudo -n(SUDO_TOOLS),前提是 Kali 侧已配 NOPASSWD sudo每请求超时:请求体可带
timeout字段(秒)覆盖默认 180s;execute_command(command, timeout=)/kali_tool(..., params={"timeout": ...})均已支持,超时返回timed_out:true及部分结果参数校验:缺失必需参数/未知工具返回明确错误
使用
1. Kali 侧启动 server
python3 server.py --ip 0.0.0.0 --port 50002. 注册 MCP client
Claude Code 项目级 .mcp.json(将 <YOUR_KALI_IP> 替换为 Kali 实际 IP):
{
"mcpServers": {
"kali": {
"type": "stdio",
"command": "python",
"args": ["/absolute/path/to/MCP-Kali-Server/client.py", "--server", "http://<YOUR_KALI_IP>:5000/"]
}
}
}客户端通过 HTTP 直连 Kali server(NAT/桥接均可),无需 SSH 隧道;改 IP 只动 .mcp.json 一处。
3. 调用示例
# 专用工具
mcp__kali__nmap_scan(target="10.0.0.1", scan_type="-sV")
# 通用调度器
mcp__kali__kali_tool(tool="masscan", params={"target": "10.0.0.0/24", "ports": "80,443"})
# 任意命令
mcp__kali__execute_command(command="whoami", timeout=600)部署
部署到 Kali:
scp server.py kali@<YOUR_KALI_IP>:/home/kali/kali-mcp-server.py(或直接git clone后运行)客户端在本机:
pip install -r requirements.txt后用python client.py --server http://<YOUR_KALI_IP>:5000/启动含对上游
Wh0am123/MCP-Kali-Server的针对性增强(通用调度器/超时/sudo)
免责声明
仅供授权测试、CTF、安全教育使用。VM 快照可回溯,故本适配未做安全加固(含 execute_command 任意命令)。
This server cannot be deployed
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Claude Code / MCP skills for the dev pipeline: discover, spec, design, build, ship, operate.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides access to 30+ Kali Linux penetration testing tools including Nmap, SQLmap, Metasploit, and others for authorized security testing, vulnerability scanning, and network reconnaissance through Claude Desktop.5-
- FlicenseNot gradedqualityDmaintenanceProvides Claude Desktop with access to Kali Linux penetration testing tools via a privileged Docker container, enabling network scanning (nmap), web vulnerability scanning (nikto), and custom command execution.11-
- AlicenseNot gradedqualityCmaintenanceConnects MCP clients to a Kali Linux terminal for AI-assisted penetration testing and CTF challenge solving by executing commands like Nmap, Metasploit, and custom scripts.825MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-assisted penetration testing by connecting MCP clients to execute terminal commands on a Kali Linux machine, supporting tools like Nmap, Metasploit, and custom commands.MIT