MCP Kali Server

A comprehensive Model Context Protocol (MCP) server for penetration testing and cybersecurity operations, providing seamless integration between Kali Linux tools and MCP-compatible clients.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者

A comprehensive Model Context Protocol (MCP) server for penetration testing and cybersecurity operations, providing seamless integration between Kali Linux tools and MCP-compatible clients.
Automates Kali Linux pentesting with MCP: programmatic access to popular tools, SSH and reverse shell management, file operations, and Docker test mode. Perfect for CTFs, security research, and automated reporting.
Automating Kali Linux with an MCP (Model Context Protocol) — HTB Demo
In this video, I showcase how my MCP automates a Kali Linux workflow inside WSL2 and assists with solving a Hack The Box challenge — from enumeration to exploitation to auto-generated documentation.
This project provides a powerful MCP server that enables secure, programmatic access to Kali Linux penetration testing tools through a standardized interface. It includes advanced features like reverse shell management, SSH session handling, and comprehensive file operations with integrity verification.
This project is designed to work across different environments:
kali-server/)Runs on Kali Linux only - The core server application that provides the actual penetration testing capabilities.
kali-server/
├── api/ # REST API routes and endpoints
├── core/ # Core functionality (SSH, reverse shells, config, Docker)
├── tools/ # Penetration testing tools integration
└── utils/ # Utility functions and file operations
Features:
--test option) - automatically manages test containersmcp-server/)Can run on any system - The Model Context Protocol server that provides a standardized interface for MCP clients.
mcp-server/
└── mcp_server.py # MCP protocol implementation
Note: The MCP server communicates with the Kali server via HTTP, so they can be on different systems.
┌─────────────────┐ HTTP ┌──────────────────┐ HTTP ┌──────────────────┐
│ MCP Client │ ◄─────────► │ MCP Server │ ◄─────────► │ Kali Server │
│ (Any system) │ │ (Any system) │ │ (Kali Linux) │
└─────────────────┘ └──────────────────┘ │ │
│ ┌──────────────┐ │
│ │ Docker │ │
│ │ (test mode) │ │
│ └──────────────┘ │
└──────────────────┘
start_ssh_session: Establish secure SSH connectionsexecute_ssh_command: Run commands in SSH sessionsget_ssh_status: Monitor SSH session statusstop_ssh_session: Cleanly terminate SSH sessionslist_ssh_sessions: View all active SSH sessionsstart_reverse_shell_listener: Start listening for reverse shellsexecute_shell_command: Execute commands in reverse shellstrigger_reverse_shell_action: Non-blocking trigger execution for payloadsget_shell_status: Monitor reverse shell session statusstop_reverse_shell: Terminate reverse shell sessionslist_reverse_shell_sessions: View all active reverse shell sessionsupload_to_kali: Upload files directly to Kali serverdownload_from_kali: Download files from Kali serverssh_upload_content: Upload content via SSH with auto-optimizationssh_download_content: Download content via SSH with chunkingssh_estimate_transfer_time: Estimate transfer times and get recommendationsreverse_shell_upload_file: Upload files via reverse shellreverse_shell_upload_content: Upload content via reverse shellreverse_shell_download_file: Download files via reverse shellreverse_shell_download_content: Download content via reverse shellSee install.md for detailed installation instructions.
After installation, configure your MCP client to connect to the Kali server:
This guide covers:
.claude/mcp_settings.json for Claude DesktopIf you're running Kali Linux in WSL 2, proper network configuration is critical for the MCP server to function. See our comprehensive guide:
This guide covers:
wsl.conf)⚠️ Important: The MCP client on Windows must be able to access the Kali server via localhost. Review this guide before running the server.
This project now separates Python dependencies for the two runtime components:
requirements.kali.txt – Only what the Kali API server Python code needs (Flask, etc.)requirements.mcp.txt – Dependencies for the MCP server client interface (requests, FastMCP, test libs)requirements.txt – Informational file describing the split; contains no direct packages now.Install on each machine as appropriate:
pip install -r requirements.kali.txt # On Kali host running kali-server/
pip install -r requirements.mcp.txt # On host running mcp-server/
IMPORTANT: Be extremely cautious when running the Kali server with sudo privileges:
# ⚠️ DANGEROUS - Avoid if possible
sudo python kali_server.py
Why this is risky:
Safer alternatives:
For production environments: Please see TODO.md for planned security enhancements including granular privilege management and access controls.
See usage.md for detailed usage instructions and examples.
The project includes comprehensive test suites using Docker containers for isolated testing environments.
cd tests
./run_all.bat # Windows
# or
chmod +x run_all.sh && ./run_all.sh # Linux
cd tests/docker
docker-compose up -d --build
python test_config_docker.py
cd tests/kali
python -m pytest test_ssh_manager.py -v
Tests use Docker containers for consistent and isolated testing environments. The configuration is automatically set up in:
tests/kali/test_config.py - Main test configuration (Docker-based)tests/docker/test_config_docker.py - Docker-specific test configurationThe MCP server provides the following tools:
# The system automatically verifies file integrity using SHA256 checksums
upload_result = {
"success": True,
"source_checksum": "abc123...",
"remote_checksum": "abc123...",
"checksum_verified": True,
"integrity_check": "PASSED"
}
# All downloads include automatic integrity verification
download_result = {
"success": True,
"remote_checksum": "def456...",
"local_checksum": "def456...",
"checksum_verified": True,
"integrity_check": "PASSED"
}
Connection Refused
# Check if server is running
curl http://localhost:5000/health
SSH Connection Failed
# Verify SSH connectivity
ssh user@target-host
Tool Not Found
# Install missing tools
sudo apt update && sudo apt install nmap gobuster
Docker Test Mode Issues
If you encounter Docker-related errors when using --test mode on Kali Linux:
Common Docker fixes on Kali Linux:
# Install Docker
sudo apt update && sudo apt install docker.io
# Start Docker service
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group (then logout/login)
sudo usermod -aG docker $USER
# Test Docker access
docker --version
docker ps
If Docker commands work manually but fail in test mode:
sudo python kali_server.py --testls -la /var/run/docker.sockEnable debug logging:
# For the server
python kali_server.py --test --debug
# For Python logging
import logging
logging.basicConfig(level=logging.DEBUG)
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer: This tool is designed for authorized penetration testing and security research only. Users are responsible for complying with applicable laws and regulations.
Automates Kali Linux pentesting with MCP: programmatic access to popular tools, SSH and reverse shell management, file operations, and Docker test mode. Perfect for CTFs, security research, and automa
總覽
Automates Kali Linux pentesting with MCP: programmatic access to popular tools, SSH and reverse shell management, file operations, and Docker test mode. Perfect for CTFs, security research, and automated reporting.
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
MCP Kali Server 透過 stdio 在本機執行。
上次檢查時間:2026-10-27。 Automates Kali Linux pentesting with MCP: programmatic access to popular tools, SSH and reverse shell management, file operations, and Docker test mode. Perfect for CTFs, security research, and automated reporting.