kali-ssh-mcp
kali-ssh-mcp
⚠️ 仅供已授权的安全测试使用。 此工具会在远程目标上执行攻击性安全工具(nmap、gobuster、nuclei、nikto)。只能在您拥有或已获明确书面授权测试的系统上使用。使用前请参阅 SECURITY.md 中的完整免责声明和威胁模型。
这是一个 MCP 服务器,它将 LLM 客户端(Claude Desktop,或任何兼容 MCP 的客户端)通过 SSH 连接到一台长期运行的 Kali Linux 虚拟机 (VM)——并带有严格的范围白名单、结构化 JSON 输出和完整的审计日志。
请先将 SECURITY.md 完成再将该功能同可浏览网页的其他 MCP 工具连接。 把随时可用的工具与网页抓取能力组合,会带来真实的即时感染风险——本文档解释了已有的缓解措施,以及你仍需在端侧做的部分。
为什么存在
社区里已经有几个不错的 Kali/渗透 MCP 服务器(PENTEST-MCP-SERVER、pentest-mcp、zebbern-kali-mcp 等——值得期待看看)。几乎所有这些服务器都有一个共同的设计决策:Kali 作为容器在 MCP 客户端所在主机上运行。 如果你希望零配置、而且状态不保留在会话之间,这种方式非常合适。
本项目应对的是另一种常见的场景:你已有一台真实的、长期存在的 Kali VM——VMware、VirtualBox、裸机等——你带着自身已经使用的配置、自定义字典和脚本,而且你不想在每次运行容器被销毁时丢失这些内容。这个服务器只是用 SSH 连上你已经有 Kali 的主机,驱动力现。你现有环境的一切都无需更改。
本项目 | 大多数基于 Docker 的 Kali MCP | |
Kali 环境 | 您已有、持久化的 VM | 每次运行全新容器 |
会话状态之间 | 保留(是您的真实 VM) | 会重置,除非挂载卷 |
配置方式 | 交换 SSH 密钥 | Docker 安装 + 镜像构建 |
最合适的场景 | 您已把 Kali 作为日常系统使用 | 零配置、即用即扔 |
Related MCP server: redteam-mcp
它能做什么
向 MCP 客户端公开四个扫描工具,每个工具都有范围门禁并返回解析后的 JSON,而不是原始的终端输出:
nmap_scan— 提供 quick/full/service/vuln 扫描预设,或显式端口 specgobuster_scan— 目录枚举爆破,支持可选的会话 Cookie,用于需要认证的测试nuclei_scan— 基于模板的漏洞扫描,可按严重程度或模板集过滤nikto_scan— Web 服务器漏洞扫描
另外还有两个只读的实用程序工具:
list_scope— 查看当前权力范围允许的目标get_audit_log— 回顾最近的工具调用(包括允许和拒绝的调用)
想添加另一个工具(sqlmap、subfinder、whatweb……)?请参阅 EXTENDING.md——共享的 scope-gate、audit-log、validation 管道意味着新工具通常只需要 20-30 行,而非大幅重写。
快速上手
git clone https://github.com/1337exe/kali-ssh-mcp.git
cd kali-ssh-mcp
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp config.example.yaml config.yaml编辑 config.yaml:
ssh.host— 您的 Kali VM 的 IPssh.username/ssh.key_path— 强烈建议使用 SSH 密钥认证scope.targets— 仅此范围中列出的主机/CIDR 可被扫描;每次您的目标协同范围有变动时都更新
在 Kali VM 上,确保 SSH 运行,并已授权您的密钥:
sudo systemctl enable --now ssh在接入 MCP 客户端前,手动验证连接:
ssh -i ~/.ssh/your_key user@<kali-vm-ip> "nmap --version"运行离线测试(无需 SSH):
python3 test_logic.py启动服务器:
python3 server.py将其连接到您的 MCP 客户端——见examples/claude_desktop_config.md中现一下的 Claude Desktop 配置副本(macOS、Linux 和 Windows)。参见examples/example_session.md 中的一个完整的演示会话。
设计原则
范围在代码里强制,而不只凭约定。 每一步工具调用都会在 Kali 上做任何操作前,先针对
config.yaml的白名单检查目标。无匹配,不执行——不会有例外。工具白名单范围小而会有意识。 现在只存在
nmap_scan和gobuster_scan。添加新工具是代码上的刻意修改(见 CONTRIBUTING.md),而不是 LLM 自己能完成的事。仅见输出结构化。 原始 nmap XML 和 gobuster 文本在 LLM 看到前就被分析为 JSON——不会让模型去解析终端片段,这又慢又不稳。
一切。 凡是被调用——允许或拒绝——都会写入
audit_log.jsonl。这是在 LLM 会话实际结果中发生了什么,无论是您自己审阅还是分享如何得出,都有据可守护。
路线图 / 好的初次贡献
会话抓取工具,搭配浏览器自动化 MCP(Playwright、Claude in Chrome),自动获取已认证的 Cookie,省去手动粘贴一个整体
基于 Docker 的工具用于长时间运行、不便占用 Kali 本身 VM
支持
sqlmap/subfinder/whatweb的封装
新工具前到引入前需包含的需求见 EXTENDING.md——范围门禁和输入校验不可省略。CONTRIBUTING.md 涵盖 PR 流程本身。操作流程说明如何贡献代码,请参考 CONTRIBUTING.md。
许可证
MIT——见 LICENSE。
负责任的使用
此工具专为测试您自有或明确授权测试的系统而构建。完整的免责声明和威胁模型模式请见 SECURITY.md。
This 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.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA Kali Linux-based MCP server that exposes over 45 penetration testing tools for AI-assisted security auditing and vulnerability scanning. It features strict scope enforcement, structured output parsing, and persistent finding storage to automate the offensive security workflow.
- FlicenseNot gradedqualityCmaintenanceA penetration testing MCP server that runs 20 hacking tools inside a Kali Linux Docker container, enabling AI assistants to execute security scans and attacks via natural language.2
- FlicenseNot gradedqualityDmaintenanceA Dockerized Kali Linux MCP server that enables LLMs to perform network security scans, penetration testing, and reconnaissance using tools like Nmap, Nikto, Hydra, and SQLMap.8
- FlicenseNot gradedqualityBmaintenanceProduction-grade MCP server that exposes Kali Linux penetration testing tools to AI agents, enabling automated reconnaissance, web application testing, vulnerability assessment, and more.
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Scans MCP servers for tool poisoning, prompt injection and supply chain risks.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
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/1337exe/kali-ssh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server