Skip to main content
Glama

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-mcp

工具面

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 -nSUDO_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 5000

2. 注册 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 任意命令)。

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Provides an MCP interface to a full Kali Linux environment running in Docker, enabling AI assistants to execute security tools like nmap, sqlmap, and metasploit. It allows users to start/stop the container, run shell commands, and transfer files for security testing and educational purposes.
    7
    9
    3
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    Provides 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
  • A
    license
    -
    quality
    C
    maintenance
    Connects 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.
    794
    MIT

View all related MCP servers

Related MCP Connectors

  • 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.

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

View all MCP Connectors

Latest Blog Posts

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/berixoo/MCP-Kali-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server