MCP-Kali-Server

MCP-Kali-Server

Enables AI-assisted penetration testing by connecting MCP clients to execute terminal commands on a Kali Linux machine, supporting tools like Nmap, Metasploit, and custom commands.

Category
访问服务器

README

MCP Kali Server

MCP Kali Server (MKS) is a lightweight API bridge that connects MCP clients (e.g: Claude Desktop or 5ire) to the API server which allows executing commands on a Linux terminal.

This MCP is able to run terminal commands as well as interacting with web applications using:

  • Dirb
  • enum4linux
  • gobuster
  • Hydra
  • John the Ripper
  • Metasploit-Framework
  • Nikto
  • Nmap
  • sqlmap
  • WPScan
  • As well as being able to execute raw commands.

As a result, this is able to perform AI-assisted penetration testing and solving CTF challenges in real time.

Articles Using This Tool

How MCP is Revolutionizing Offensive Security

👉 How MCP is Revolutionizing Offensive Security


🔍 Use Case

The goal is to enable AI-driven offensive security testing by:

  • Letting the MCP interact with AI endpoints like OpenAI, Claude, DeepSeek, Ollama or any other models.
  • Exposing an API to execute commands on a Kali machine.
  • Using AI to suggest and run terminal commands to solve CTF challenges or automate recon/exploitation tasks.
  • Allowing MCP apps to send custom requests (e.g. curl, nmap, ffuf, etc.) and receive structured outputs.

Here are some example (using Google's AI gemini 2.0 flash):

Example solving a web CTF challenge from RamadanCTF

https://github.com/user-attachments/assets/dc93b71d-9a4a-4ad5-8079-2c26c04e5397

Trying to solve machine "code" from HTB

https://github.com/user-attachments/assets/3ec06ff8-0bdf-4ad5-be71-2ec490b7ee27


🚀 Features

  • 🧠 AI Endpoint Integration: Connect your Kali to any MCP of your liking such as Claude Desktop or 5ier.
  • 🖥️ Command Execution API: Exposes a controlled API to execute terminal commands on your Kali Linux machine.
  • 🕸️ Web Challenge Support: AI can interact with websites and APIs, capture flags via curl and any other tool AI the needs.
  • 🔐 Designed for Offensive Security Professionals: Ideal for red teamers, bug bounty hunters, or CTF players automating common tasks.

🛠️ Installation and Running

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

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.

🔮 Other Possibilities

There are more possibilities than described since the AI model can now execute commands on the terminal. Here are some examples:

  • Memory forensics using Volatility

    • Automating memory analysis tasks such as process enumeration, DLL injection checks, and registry extraction from memory dumps.
  • Disk forensics with SleuthKit

    • Automating analysis from disk images, timeline generation, file carving, and hash comparisons.

⚠️ Disclaimer:

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.

The author assumes no responsibility for misuse.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选