Kali-MCP-Server-Walkthrough
Credit for MCP - Server : https://github.com/TriV3/MCP-Kali-Server/tree/master
"Kali-MCP-Server Walkthrough: A Passion Project for the 4th Semester"
Prerequisites
- Kali Linux (bare‑metal, VM, or WSL2)
- VS Code
- 5ire
- Git and Python 3.10+ (or your preferred runtime)
- Working HTB access on Kali (connect the HTB VPN inside Kali; target IP within your scope)
I would assume that you already know how to install and run Kali on a virtual machine on your local device, so I’m going to jump straight into my process and get the server up and running.
Let’s go ahead and get your Kali updated.
sudo apt update && sudo apt -y upgrade Just let your system do its thing. Keep an eye on it, and once in a blue moon, you may need to accept a prompt or set something for the upgrade and update to move forward.
python3 and pip can be a big pain in the butt so lets double check and see what version we are on.
python3 --version If you need to update you can run :
sudo apt -y install git python3-venv python3-pipalright lets go head and get our MCP-Kali-Server downloaded.
git clone https://github.com/TriV3/MCP-Kali-Server.gitotay, lets get move into that directory
cd MCP-kali-ServerAlright, from here you can see that we have kali-server and mcp-server. I’m going to be using the kali-server, since our VM is going to be the host.
Before we install or start the server, let’s go ahead and create a virtual environment for this project.
If the command returns no output, it executed successfully.
Now lets move into the virtual environment.
source mcp.venv/bin/activateAs shown in the red box, mcp.venv appears in the header, indicating that you are inside the virtual environment.
Now lets install requirements
pip install -U pip wheel
pip install -r requirments.kali.txtNow that we have our virtual environment set up and our requirements downloaded, we can move on to, starting the Kali server and checking the health of the server.
Navigate to the kali-server directory; you should see kali-server.py
python3 kali_server.pyBy default, the server should be running on localhost:5000. We can check the health of the server by opening a second terminal and typing the following:
curl http://localhost:5000/health Server-side output after sending the curl command:
Alright, now that we have the server up and running and have tested the health command, let’s go ahead and get it running on the client.
I’ll be setting up 5ire on my Mac desktop so I can start using the Kali server.
Let’s ping our Kali server to make sure the VM can communicate and respond properly.
Let’s go ahead and use git clone https://github.com/TriV3/MCP-Kali-Server.git so we have access to mcp-server.py.
This should look pretty familiar from the same file you got from GitHub the first time around, but this time we’ll be working within the mcp-server directory.
When you move into that directory, you’ll see mcp-server.py. Let’s go ahead and open that .py file with your favorite code editor—I’ll be using VS Code.
- find line 27 and put your vm ip address in like this:
Note : Don't forget to save after you edit the file.
Let’s repeat the process of creating a virtual environment for this project, just like we did at the beginning. This time, we’ll do it on our client host.
and install `pip install -r requirements.mcp.txt`
alright now, lets start up our ` mcp_server.py`
Switch to your Kali VM to confirm that it’s connected.
NOTE : v15.2 will not work you need to use 13.2
Okay, now that we have everything up and running and have tested that the MCP server and client are working and communicating with each other, we need to get 5ire up and running.
Note: I used 5ire for this project because it was easier to set up and didn’t give me too many problems.
when opening up 5ire click workspace and then click + local :
This part can be a bit tricky. For the tool key, simply choose a name you’d like to call it.
In the command, you need to add the path to your mcp-server.py.
`/Users/yourpath/MCP-Kali-Server/mcp.venv/bin/python3 /Users/yourpath/MCP-Kali-Server/mcp-server/mcp_server.py`
Once that’s done, save your changes, toggle it on, and you should see the following.
Okay, now you’re ready to add your API key from whichever LLM model you have access to.
Go to Workspace → Settings, then click API / Providers. From there, you’ll have access to enter your API key.
After setting up your providers, go to New Chat and ask, " Can you check the Health of our kali mcp server?"
okay now lets ask it to nmap scan `scanme.nmap.org`
HAVE FUN : Hack the world !!
