MCP-Kali
MCP configuration to connect AI agent to a Linux machine.
claude mcp add --transport stdio wh0am123-mcp-kali-server python server.py
How to use
MCP-Kali provides a Python-based bridge that lets MCP clients send commands to a Kali Linux machine and retrieve structured outputs. It exposes a terminal-command execution API and can interact with a range of security tools (e.g., Dirb, enum4linux, gobuster, Hydra, John the Ripper, Metasploit Framework, Nikto, Nmap, sqlmap, WPScan) as well as raw shell commands. This enables AI-assisted offensive security workflows, automated recon, exploitation tasks, and solving CTF challenges by issuing commands through an MCP client and receiving parsed results.
To use it, run the server on the Kali host and point MCP clients to the server URL (default port 5000). The client can then invoke terminal commands or tool-specific workflows via the MCP API. The system supports binding to a specific IP, altering the listening port, and enabling debug logging for troubleshooting. For remote usage, you can establish an SSH tunnel from the client machine to the Kali host, then connect the MCP client through the tunnel to the server endpoint. This setup allows AI endpoints to drive Kali-based tooling from anywhere, while the Kali host executes the actual commands and returns outputs to the client.
How to install
Prerequisites:
- A Kali Linux machine (or a compatible Linux environment)
- Python 3.8+ and git installed
- Network access to install dependencies (pip-based)
Installation steps (bleeding edge or fresh install):
- Clone the repository:
git clone https://github.com/Wh0am123/MCP-Kali-Server.git
cd MCP-Kali-Server
- Create and activate a Python virtual environment, then install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Run the server:
python server.py
Optional Kali installation steps (as described in the README):
- On your Kali machine, you can install the MCP Kali Server via package manager and run it directly:
sudo apt install mcp-kali-server
kali-server
- Or use the bleeding-edge setup shown above if you prefer to build from source.
Client setup (example):
# If the client is on the same Kali machine
./client.py --server http://127.0.0.1:5000
# If remote, use an SSH tunnel first, then connect the client
ssh -L 5000:localhost:5000 user@KALI_IP
# In a second terminal on the client
./client.py --server http://127.0.0.1:5000
Additional notes
Tips and considerations:
- The server defaults to listening on 127.0.0.1:5000; use --ip and --port options with server.py to bind to a different address or port if you need remote access. Be mindful that exposing the service publicly can be dangerous; prefer SSH tunneling or VPN when exposing the server.
- If you host openly on the network, the README recommends SSH tunneling for security. Consider using firewalls and access controls to restrict who can reach the MCP endpoint.
- Claude Desktop and 5ire Desktop configurations are supported by supplying the MCP client with the server URL; cloud-based AI endpoints can be used to drive Kali tooling via the MCP bridge.
- The tooling list includes security-oriented tools (Dirb, Gobuster, Hydra, Nmap, sqlmap, WPScan, Metasploit, John the Ripper, etc.). Ensure legal authorization before running any offensive scans or exploitation tasks.
- If you encounter issues with dependencies, ensure your Python virtual environment is active and that you’re using compatible Python versions as per requirements.txt.
Related MCP Servers
Reversecore_MCP
A security-first MCP server empowering AI agents to orchestrate Ghidra, Radare2, and YARA for automated reverse engineering.
asterisk
Asterisk Model Context Protocol (MCP) server.
ggmcp
MCP server for scanning and remediating hardcoded secrets using GitGuardian’s API. Detect over 500 secret types and prevent credential leaks before code goes public.
pentesting s-checklist
A practical, community-driven checklist for pentesting MCP servers. Covers traffic analysis, tool-call behavior, namespace abuse, auth flows, and remote server risks. Maintained by Appsecco and licensed for remixing.
Mcpwn
mcp security tester
mcp-ethical-hacking
MCP Ethical Hacking Security sample for educational