Skip to content
Back to search

MCP-Kali-Server

MCP configuration to connect AI agent to a Linux machine.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/wh0am123--mcp-kali-server/badge.svg)](/listings/wh0am123--mcp-kali-server)

HTML

<a href="/listings/wh0am123--mcp-kali-server"><img src="/api/listings/wh0am123--mcp-kali-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

On your Kali Machine

sudo apt install mcp-kali-server
kali-server-mcp

Otherwise for **bleeding edge**:

git clone https://github.com/Wh0am123/MCP-Kali-Server.git
cd MCP-Kali-Server
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
./server.py

**Command Line Options**:

- `--ip <address>`: Specify the IP address to bind the server to (default: `127.0.0.1` for localhost only) - Use `127.0.0.1` for local connections only (secure, recommended) - Use `0.0.0.0` to allow connections from any network interface (very dangerous; use with caution) - Use a specific IP address to bind to a particular network interface - `--port <port>`: Specify the port number (default: `5000`) - `--debug`: Enable debug mode for verbose logging

**Examples**:

# Run on localhost only (secure, default)
./server.py

# Run on all interfaces (less secure, useful for remote access)
./server.py --ip 0.0.0.0

# Run on a specific IP and custom port
./server.py --ip 192.168.1.100 --port 8080

# Run with debug mode
./server.py --debug

On your MCP client machine

This can be local (on the same Kali machine) or remote (another Linux machine, Windows or macOS).

If you're running the client and server on the same _Kali_ machine (aka local), run either:

## OS package
kali-server-mcp --server http://127.0.0.1:5000

# ...OR...

## Bleeding edge
./client.py --server http://127.0.0.1:5000

---

If separate machines (aka remote), create an SSH tunnel to your MCP server, then launch the client:

## Terminal 1 - Replace `LINUX_IP` with Kali's IP
ssh -L 5000:localhost:5000 user@LINUX_IP

## Terminal 2
git clone https://github.com/Wh0am123/MCP-Kali-Server.git
cd MCP-Kali-Server
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
./client.py --server http://127.0.0.1:5000

---

If you're openly hosting the MCP Kali server on your network (`server.py --IP...`), you don't need the SSH tunnel (but we do recommend it!) NOTE: ⚠️(THIS IS STRONGLY DISCOURAGED. WE RECOMMEND SSH)⚠️.

./client.py --server http://LINUX_IP:5000

Configuration for Claude Desktop:

Edit:

- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` - Windows: `%APPDATA%\Claude\claude_desktop_config.json`

[Example MCP-Kali-Server.json](mcp-kali-server.json)

Configuration for 5ire Desktop Application:

- Simply add an MCP with the command `python3 /absolute/path/to/client.py --server http://LINUX_IP:5000` and it will automatically generate the needed configuration files.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 173 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP Kali Server
  2. **MCP Kali Server (MKS)** is a lightweight API bridge that connects [MCP clients](https://modelcontextprotocol.io/clients) (e.g: [Claude Desktop](https://code.claude.com/docs/en/desktop) or [5ire](https://github.com/nanbingxyz/5ire)) to the [API server](https://modelcontextprotocol.io/examples) which allows executing commands on a Linux terminal.
  3. This MCP is able to run terminal commands as well as interacting with web applications using:
  4. - `Dirb`
  5. - `enum4linux`
  6. - `gobuster`
  7. - `Hydra`
  8. - `John the Ripper`
  9. - `Metasploit-Framework`
  10. - `Nikto`
  11. - `Nmap`
  12. - `sqlmap`
  13. - `WPScan`
  14. - As well as being able to execute raw commands.
  15. As a result, this is able to perform **AI-assisted penetration testing** and solving **CTF challenges** in real time.
  16. ## Articles Using This Tool
  17. [![How MCP is Revolutionizing Offensive Security](https://miro.medium.com/v2/resize:fit:828/format:webp/1*g4h-mIpPEHpq_H63W7Emsg.png)](https://yousofnahya.medium.com/how-mcp-is-revolutionizing-offensive-security-93b2442a5096)
  18. 👉 [**How MCP is Revolutionizing Offensive Security**](https://yousofnahya.medium.com/how-mcp-is-revolutionizing-offensive-security-93b2442a5096)
  19. ---
  20. ## 🔍 Use Case
  21. The goal is to enable AI-driven offensive security testing by:
  22. - Letting the MCP interact with AI endpoints like [OpenAI](https://openai.com/), [Claude](https://claude.ai/), [DeepSeek](https://www.deepseek.com/), [Ollama](https://docs.ollama.com/) or any other models.
  23. - Exposing an API to execute commands on a [Kali](https://www.kali.org/) machine.
  24. - Using AI to suggest and run terminal commands to [solve CTF challenges](#example-solving-a-web-ctf-challenge-from-ramadanctf) or automate recon/exploitation tasks.
  25. - Allowing MCP apps to send custom requests (e.g. `curl`, `nmap`, `ffuf`, etc.) and receive structured outputs.
  26. Here are some example (using Google's AI `gemini 2.0 flash`):
  27. ### Example solving a web CTF challenge from RamadanCTF
  28. https://github.com/user-attachments/assets/dc93b71d-9a4a-4ad5-8079-2c26c04e5397
  29. ### Trying to solve machine "code" from HTB
  30. https://github.com/user-attachments/assets/3ec06ff8-0bdf-4ad5-be71-2ec490b7ee27
  31. ---
  32. ## 🚀 Features
  33. - 🧠 **AI Endpoint Integration**: Connect your Kali to any MCP of your liking such as Claude Desktop or 5ier.
  34. - 🖥️ **Command Execution API**: Exposes a controlled API to execute terminal commands on your Kali Linux machine.
  35. - 🕸️ **Web Challenge Support**: AI can interact with websites and APIs, capture flags via `curl` and any other tool AI the needs.
  36. - 🔐 **Designed for Offensive Security Professionals**: Ideal for red teamers, bug bounty hunters, or CTF players automating common tasks.
  37. ---
  38. ## 🛠️ Installation and Running
  39. ### On your Kali Machine
  40. ```bash
  41. sudo apt install mcp-kali-server
  42. kali-server-mcp
  43. ```
  44. Otherwise for **bleeding edge**:
  45. ```bash
  46. git clone https://github.com/Wh0am123/MCP-Kali-Server.git
  47. cd MCP-Kali-Server
  48. python3 -m venv .venv
  49. source .venv/bin/activate
  50. pip install -r requirements.txt
  51. ./server.py
  52. ```
  53. **Command Line Options**:
  54. - `--ip <address>`: Specify the IP address to bind the server to (default: `127.0.0.1` for localhost only)
  55. - Use `127.0.0.1` for local connections only (secure, recommended)
  56. - Use `0.0.0.0` to allow connections from any network interface (very dangerous; use with caution)
  57. - Use a specific IP address to bind to a particular network interface
  58. - `--port <port>`: Specify the port number (default: `5000`)
  59. - `--debug`: Enable debug mode for verbose logging
  60. **Examples**:
  61. ```bash
  62. # Run on localhost only (secure, default)
  63. ./server.py
  64. # Run on all interfaces (less secure, useful for remote access)
  65. ./server.py --ip 0.0.0.0
  66. # Run on a specific IP and custom port
  67. ./server.py --ip 192.168.1.100 --port 8080
  68. # Run with debug mode
  69. ./server.py --debug
  70. ```
  71. ### On your MCP client machine
  72. This can be local (on the same Kali machine) or remote (another Linux machine, Windows or macOS).
  73. If you're running the client and server on the same _Kali_ machine (aka local), run either:
  74. ```bash
  75. ## OS package
  76. kali-server-mcp --server http://127.0.0.1:5000
  77. # ...OR...
  78. ## Bleeding edge
  79. ./client.py --server http://127.0.0.1:5000
  80. ```
  81. ---
  82. If separate machines (aka remote), create an SSH tunnel to your MCP server, then launch the client:
  83. ```bash
  84. ## Terminal 1 - Replace `LINUX_IP` with Kali's IP
  85. ssh -L 5000:localhost:5000 user@LINUX_IP
  86. ## Terminal 2
  87. git clone https://github.com/Wh0am123/MCP-Kali-Server.git
  88. cd MCP-Kali-Server
  89. python3 -m venv .venv
  90. source .venv/bin/activate
  91. pip install -r requirements.txt
  92. ./client.py --server http://127.0.0.1:5000
  93. ```
  94. ---
  95. If you're openly hosting the MCP Kali server on your network (`server.py --IP...`), you don't need the SSH tunnel (but we do recommend it!)
  96. NOTE: ⚠️(THIS IS STRONGLY DISCOURAGED. WE RECOMMEND SSH)⚠️.
  97. ```bash
  98. ./client.py --server http://LINUX_IP:5000
  99. ```
  100. #### Configuration for Claude Desktop:
  101. Edit:
  102. - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
  103. - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
  104. [Example MCP-Kali-Server.json](mcp-kali-server.json)
  105. #### Configuration for 5ire Desktop Application:
  106. - Simply add an MCP with the command `python3 /absolute/path/to/client.py --server http://LINUX_IP:5000` and it will automatically generate the needed configuration files.
  107. ## 🔮 Other Possibilities
  108. There are more possibilities than described since the AI model can now execute commands on the terminal. Here are some examples:
  109. - Memory forensics using Volatility
  110. - Automating memory analysis tasks such as process enumeration, DLL injection checks, and registry extraction from memory dumps.
  111. - Disk forensics with SleuthKit
  112. - Automating analysis from disk images, timeline generation, file carving, and hash comparisons.
  113. ## ⚠️ Disclaimer:
  114. This project is intended solely for educational and ethical testing purposes. Any misuse of the information or tools provided — including unauthorized access, exploitation, or malicious activity — is strictly prohibited.
  115. The author assumes no responsibility for misuse.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.