Configuring MCP Kali Sever with Gemini
Modern offensive security work demands speed, adaptability, and the ability to pivot between tools without losing momentum. Integrating the mcp‑kali‑server with Gemini‑CLI brings those strengths together, turning Kali into an AI‑augmented command environment that feels both natural and highly tactical. Instead of bouncing between terminals, scripts, and notes, you can drive recon, parsing, and automation through conversational prompts while still maintaining full control over the underlying commands. For hackers and security researchers, this setup doesn’t just streamline the workflow—it reshapes how you interact with your toolkit, blending human intuition with machine‑level precision in a way that elevates every phase of the engagement.
Installing and Configuring MCP Kali Server with Gemini Integration
Integrating mcp-kali-server with Gemini‑cli creates a remarkably powerful workflow that brings together the precision of modular command execution and the intelligence of modern AI-driven reasoning, giving hackers and security researchers a streamlined way to blend AI‑assisted reasoning with hands‑on offensive tooling. Instead of juggling separate scripts, consoles, and notes, this setup lets you drive reconnaissance, parsing, and workflow automation through natural‑language prompts while still keeping full control over the underlying commands. It turns tedious tasks—like transforming raw scan output, chaining recon steps, or generating payload variations—into fast, conversational interactions that never sacrifice precision.
The real power comes from how fluid the loop becomes: Gemini‑cli interprets intent, kali‑mcp‑server executes with the exactness of a modular command pipeline. Combined, the two together create a responsive environment that accelerates experimentation, red‑team ops, and a seamless bridge between system‑level operations and natural‑language orchestration. This combination turns complex tasks—like security auditing, environment provisioning, or automated reporting—into simple conversational commands that still retain full technical depth. The result is a toolchain that feels both highly automated and deeply customizable: Gemini‑cli interprets intent, kali‑mcp‑server executes with accuracy, and together they form a responsive, extensible layer that enhances productivity, reduces friction, and opens the door to more intuitive interactions with traditionally complex workflows. It’s a fusion that doesn’t just streamline operations — it elevates possiblities when AI and command‑driven tooling work together.
Setting up the mcp-kali-server (Model Context Protocol) on Kali is a brilliant way to turn your Gemini CLI into a hands-on security assistant. This setup uses a two-tier architecture: an API Server (which actually runs the terminal commands) and an MCP Bridge (which talks to Gemini). The steps below assume that Gemini-Cli is already installed and that you have properly imported an API key.
Step 1: Install the MCP Kali Server
- Update the system
1
sudo apt update
- Install the server pacakage. This pacakge includes the API listener (kali-server-MCP) and the MCP protocol bridge (MCP Server)
1
sudo apt install mcp-kali-server
Step 2: Start the Kali API Server
The API server must be running for the MCP bridge to communicate with your terminal. Further on we will be setting this up as a service to run automatically.
- Start the server. From a dedicated terminal window execute the following, by default the server will listen on 127.0.0.1:5000
1
kali-server-mcp
Or, if you would like a custom port and ip:
1
kali-server-mcp --ip 192.168.0.69 --port 4269
Step 3: The Gemini Integration
There are two options for integrating Gemini-CLI with MCP, automated and manual. I personally have found this to be a bit buggy and stick to manual configuration.
- Automated integration: the recommended path utilizing the built-in helper command to update your configuration files.
1
gemini mcp add kali /usr/bin/mcp-server --args "--server http://127.0.0.1:5000"
- Manual integration: Open the configuration file:
1
nvim ~/.gemini/settings.json
Add or update the following JSON block:
1
2
3
4
5
6
7
8
9
10
11
{
"mcpServers": {
"kali": {
"command": "/usr/bin/mcp-server",
"args": [
"--server",
"http://127.0.0.1:5000"
]
}
}
}
Step 4: Verification and Usage
- Launch Gemini-cli
1
gemini-cli
- Verify tools are available. Inside the Gemini prompt, type the following command to see the available Kali tools such as nmap, gobuster, etc.
1
/mcp list
- Test a command. Start simple “Update my system”. Job well done!
To ensure the kali-server-mcp is always ready when you want to use Gemini, the best method is to create a systemd user service. This allows the server to run in the background without needing a terminal window open, and it will restart automatically if it crashes.
Method 1: Systemd (Recommended)
This is the cleanest approach on Kali and the starts the server as soon as you log in.
- Step 1: Create the user service directory.
1
mkdir -p ~/.config/systemd/user/
- Step 2: Create the service file.
With your text editor of choice, create and edit the following file
1
nvim ~/.config/systemd/user/kali-mcp.service
- Step 3: Add the following block to your service file:
1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description=Kali MCP Server for Gemini
After=network.target
[Service]
ExecStart=/usr/bin/kali-server-mcp
Restart=always
RestartSec=5
[Install]
WantedBy=default.target
- Step 4: Reload, Enable, and Start the service.
Execute the following commands to tell the system about the new service and start it immediatly.
1
2
3
systemctl --user daemon-reload
systemctl --user enable kali-mcp.service
systemctl --user start kali-mcp.service
- Step 5: Verify the service is running.
1
systemctl --user status kali-mcp.service
Method 2: The GUI Way (XFCE / GNOME)
If you prefer using the desktop interface, you can add it to your Startup Applications.
Step 1: Open the Application Menu and search for “Session and Startup” (for XFCE) or “Startup Applications” (for GNOME).
Step 2 : Click the “Application Autostart” tab.
Step 3: Click the “+” (Add) button.
Fill in the details:
- Name: Kali MCP Server
- Description: Background API for Gemini CLI
- Command: /usr/bin/kali-server-mcp
Click OK. It will now launch every time you log into your desktop environment.
Troubleshooting Tips
Connection Refused: Ensure kali-server-mcp is actually running and visible at http://127.0.0.1:5000.
Path Issues: If mcp-server isn’t found, use which mcp-server to find the absolute path and update your settings.json accordingly.
Permissions: The commands Gemini runs will have the same permissions as the user who started kali-server-mcp.
Since the server is now running in the background, you won’t see its output in your terminal. If Gemini has trouble connecting, you can check the logs with this command:
1
journalctl --user -u kali-mcp.service -f
Conclusion
Bringing the mcp‑kali‑server and Gemini‑CLI together ultimately transforms how offensive security work gets done. It replaces rigid, tool‑by‑tool workflows with an adaptive, conversational interface that still preserves the precision and control seasoned operators expect. Once the integration is in place and the service is running in the background, you gain a persistent AI‑augmented command layer that accelerates recon, reduces friction, and keeps your focus on strategy rather than syntax. For hackers and security researchers who thrive on speed, creativity, and efficiency, this setup isn’t just a convenience—it’s a force multiplier that reshapes what’s possible on Kali.