kali-mcp-server
Enables MCP clients to drive Kali Linux ethical hacking tools for authorized penetration testing, with enforced engagement scope, exploitation gating, and full audit logging.
README
Kali Ethical Hacking MCP Server
A personal, advanced Model Context Protocol (MCP) server for authorized penetration testing and ethical hacking. It lets an MCP client (Claude Desktop, Claude Code) drive the standard Kali/pentest toolchain — reconnaissance, scanning, web application testing, exploitation support, credential work, and reporting — with authorization scoping, exploitation gating, and audit logging enforced on every action.
Built on the Red Hat template-mcp-server
(FastMCP, tools-first architecture).
⚠️ Authorized use only
This server operates real offensive security tooling. Use it only against systems you own or have explicit, written authorization to test. Unauthorized scanning, exploitation, or credential attacks are illegal in most jurisdictions. The server enforces an engagement scope and refuses to act on targets you have not declared as authorized — keep
REQUIRE_SCOPE=True. You are responsible for operating within the law and your rules of engagement.
How it works
Claude (MCP client) ──► Kali MCP Server ──► ┌─ host binary (nmap on PATH) [mode: host]
(scope + audit) └─ Kali container (docker exec ...) [mode: docker]
- Hybrid execution — each tool runs on a host binary if present, otherwise inside a persistent
kalilinux/kali-rollingcontainer the server starts on demand (missing tools areapt-installed into it automatically). Controlled byEXECUTION_MODE(auto|host|docker). - Scope enforcement — every active tool validates its target against your declared engagement
scope (
ScopeManager). Out-of-scope targets are refused. - Exploitation gating — active exploitation / brute-force tools (
sqlmap,hydra) additionally requireALLOW_EXPLOITATION=True. - Audit logging — every invocation is appended to
~/.kali-mcp/audit.jsonl. - Engagement session — scans and findings are recorded and can be rendered into a report.
Tool catalog (24 tools)
| Category | Tools |
|---|---|
| Recon & Scanning | nmap_scan, masscan_scan, host_discovery, dns_recon, subdomain_enum, whois_lookup |
| OSINT (passive) | username_osint (Sherlock), email_harvest (theHarvester) |
| Web App Testing | nikto_scan, dir_bruteforce, vhost_enum, whatweb_fingerprint, nuclei_scan, sqlmap_test†, wpscan_scan |
| Exploitation & Creds | searchsploit_lookup, hash_identify, hash_crack, hydra_bruteforce† |
| Reporting & Workflow | scope_manage, list_tools_status, record_finding, session_summary, generate_report |
† Gated behind ALLOW_EXPLOITATION=True and an in-scope target.
Requirements
- Python 3.12+ and
uv - Docker (for the Kali fallback). No security tools need to be installed on the host — they run
in the Kali container. If you do have tools on your
PATH, they're used directly.
Install
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e ".[dev]"
cp .env.example .env # then review the settings
Run
stdio (local — for Claude Desktop / Claude Code):
MCP_TRANSPORT_PROTOCOL=stdio kali-mcp-server
HTTP (shared / remote):
MCP_TRANSPORT_PROTOCOL=http MCP_PORT=5001 kali-mcp-server
Connect it to Claude
Claude Code:
claude mcp add kali-ethical -- /ABSOLUTE/PATH/ethical-mcp/.venv/bin/kali-mcp-server
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"kali-ethical": {
"command": "/ABSOLUTE/PATH/ethical-mcp/.venv/bin/kali-mcp-server",
"env": { "MCP_TRANSPORT_PROTOCOL": "stdio", "EXECUTION_MODE": "auto" }
}
}
}
Typical workflow
- Authorize the engagement — record who approved it and the reference:
scope_manage(action="set_engagement", client="Acme", authorized_by="J. Smith", ticket="PT-42") - Declare scope — only targets you're permitted to test:
scope_manage(action="add", targets=["10.0.0.0/24", "app.acme.com"]) - Check tooling —
list_tools_status()shows host vs Docker availability. - Recon & scan —
nmap_scan("app.acme.com", "service"),subdomain_enum("acme.com"), … - Web testing —
nikto_scan(...),nuclei_scan(...),dir_bruteforce(...). - Exploitation (only with
ALLOW_EXPLOITATION=True) —sqlmap_test(...),hydra_bruteforce(...). - Record & report —
record_finding(...)thengenerate_report("markdown").
Anything against a target not in scope is refused; gated tools are refused unless explicitly enabled.
Configuration
Key settings (see .env.example for all):
| Variable | Default | Purpose |
|---|---|---|
MCP_TRANSPORT_PROTOCOL |
stdio |
stdio, http, streamable-http, sse |
EXECUTION_MODE |
auto |
auto | host | docker |
KALI_DOCKER_IMAGE |
kalilinux/kali-rolling |
Fallback toolbox image |
REQUIRE_SCOPE |
True |
Refuse out-of-scope targets |
ALLOW_EXPLOITATION |
False |
Enable active exploitation/brute-force tools |
TOOL_TIMEOUT_SECONDS |
300 |
Per-run timeout |
DATA_DIR |
~/.kali-mcp |
Scope, audit log, outputs, wordlists |
Safety model
- No target contact without scope. Recon/scan/exploit tools call the scope gate first.
- Two-key exploitation.
sqlmap/hydraneedALLOW_EXPLOITATION=Trueand an in-scope target. - Rate limits.
masscanpacket rate is capped to avoid turning a scan into a flood. - Full audit trail.
~/.kali-mcp/audit.jsonlrecords every command (incl. blocked attempts). - No DoS / mass-internet scanning helpers. The toolset is engagement-scoped by design.
Development
make test # run the test suite
make lint # ruff + formatting checks
pytest tests/ # scope, executor, gating, reporting tests
License
Apache-2.0. This tool is provided for authorized security testing and education only.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。