kali
一个基于Kali Linux的MCP(Model Context Protocol)服务器项目,为AI助手提供渗透测试和安全评估工具接口
claude mcp add --transport stdio pentestt00ls-kali-mcp-server python path/to/mcp_server.py --server http://your-kali-ip:5000/ \ --env DEBUG_MODE="true|false for Kali server debug" \ --env KALI_API_PORT="5000 (default) or the Kali API port"
How to use
This MCP server (Kali MCP) connects an AI assistant using the MCP protocol to a Kali Linux toolset. The Kali side exposes a REST API (kali_server.py) with endpoints for executing commands and running common security tools (e.g., Nmap, Gobuster, Dirb, Nikto, SQLMap, Metasploit, Hydra, John the Ripper, WPScan, Enum4linux, and more). The MCP server (mcp_server.py) translates high-level MCP requests from the AI assistant into Kali API calls and returns results back to the AI. You can invoke network scans, web application assessments, password attacks, and information gathering via the provided functions, enabling automated pentesting workflows through the MCP client.
How to install
Prerequisites:
- Python 3.8+ on Kali Linux or a compatible Linux environment
- Kali Linux with required security tools installed
- Network access between MCP server and Kali API server
Installation steps:
-
Clone the repository: git clone <repository-url> cd kali-mcp-server
-
Create a Python virtual environment (optional butRecommended): python3 -m venv venv source venv/bin/activate
-
Install dependencies: pip install -r requirements.txt
-
Configure Kali API server (kali_server.py):
- Ensure required tools are installed on Kali
- Adjust API_PORT if needed (default 5000)
- Save any tool-specific settings
-
Run the Kali API server: python kali_server.py
defaults to port 5000
-
Configure MCP client (mcp.json) using the example below and adjust paths: { "mcpServers": { "kali_mcp": { "timeout": 180, "type": "stdio", "command": "python", "args": [ "path/to/mcp_server.py", "--server", "http://your-kali-ip:5000/" ] } } }
-
Run the MCP server: python mcp_server.py --server http://your-kali-ip:5000/
-
Start using the MCP-enabled AI assistant to issue commands that map to Kali tools via the MCP endpoints.
Additional notes
Tips and notes:
- Ensure the Kali API server is reachable from the MCP server (correct IP/port).
- Adjust timeout settings (COMMAND_TIMEOUT and MCP timeout) if tools run long-running tasks.
- Keep tools up to date on Kali to avoid missing features.
- For security, run in a controlled, authorized environment and monitor logs for sensitive output.
- If a tool is not found, verify that the corresponding binary is installed and the Kali API endpoint is enabled.
- You can extend mcp.json and kali_server.py to add more tools or endpoints as needed.
- Environment variables can be used to tune behavior (e.g., DEBUG_MODE, API_PORT).
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP