Kali Linux MCP Server
Provides WordPress vulnerability scanning and enumeration through WPScan, including checks for vulnerable plugins, themes, and site configuration.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π Kali Linux MCP Server
Run professional penetration testing tools through natural language using AI.
A Docker-based MCP (Model Context Protocol) server that wraps Kali Linux security tools and exposes them to AI clients like Claude Code, Cursor, and any MCP-compatible application. Simply ask "scan this target for open ports" and let AI handle the rest.
Overview
This project bridges the gap between AI assistants and real security tools. Instead of switching between terminals, remembering complex command flags, and manually parsing scan output, you simply describe what you want in plain English and the AI executes professional-grade security tools on your behalf.
Built with FastMCP 3.x and running inside a Kali Linux Docker container, the server exposes 18+ security tools as MCP endpoints that any compatible AI client can call.
Related MCP server: Kali Tools MCP Server
Demo
You: "Scan scanme.nmap.org for open ports"
Claude Code: Calls nmap_scan tool with target "scanme.nmap.org"
Result:
Port | State | Service |
22/tcp | Open | SSH |
53/tcp | Open | DNS |
80/tcp | Open | HTTP |
9929/tcp | Open | Nping Echo |
31337/tcp | Open | Elite |
5 open ports found on scanme.nmap.org (45.33.32.156) in 4.27 seconds
Features
18+ Security Tools wrapped as MCP endpoints, organized by category:
Network Scanning : nmap full scan, quick scan (top 100 ports), vulnerability scan with NSE scripts, OS detection
Web Application Testing : Nikto web server scanner, Dirb directory brute-forcer, WPScan for WordPress vulnerability detection and enumeration
SQL Injection : SQLMap automated detection and database dumping
Exploit Research : SearchSploit for querying the Exploit Database, with detailed exploit viewing
Reconnaissance : WHOIS lookups, DNS record queries via dig, banner grabbing with netcat, SMB enumeration with enum4linux
Password Testing : Hydra brute-force testing for SSH, FTP, HTTP and other services
Meta : Built-in tool listing with descriptions for all available tools
Architecture
+------------------+ HTTP (Streamable) +------------------------+
| | --------------------------------> | |
| AI Client | MCP Protocol over HTTP | Docker Container |
| | POST /mcp | (Kali Linux) |
| - Claude Code | <-------------------------------- | |
| - Cursor | JSON-RPC 2.0 | +------------------+ |
| - Any MCP | | | FastMCP Server | |
| Client | | | (Python 3.11) | |
| | | +--------+---------+ |
+------------------+ | | |
| +--------v---------+ |
| | Security Tools | |
| | | |
| | nmap nikto | |
| | sqlmap dirb | |
| | wpscan hydra | |
| | searchsploit | |
| | whois dig nc | |
| | enum4linux | |
| +------------------+ |
+------------------------+
Port 8000 (SSE/HTTP)How it works:
The AI client sends a natural language request (e.g., "scan this target")
The AI interprets the request and calls the appropriate MCP tool with parameters
The FastMCP server receives the JSON-RPC call and dispatches it to the corresponding Python function
The Python function sanitizes input, executes the Kali Linux tool via subprocess, and captures the output
Results are returned through the MCP protocol back to the AI client
The AI formats and presents the results in a readable way
Project Structure
kali-mcp-server/
βββ kali_server.py # Main MCP server with all tool definitions
βββ run_sse.py # SSE/HTTP transport launcher
βββ Dockerfile # Kali Linux container with all tools installed
βββ requirements.txt # Python dependencies (FastMCP, MCP SDK)
βββ custom.yaml # Docker MCP Toolkit catalog configuration
βββ claude_desktop_config.json # Claude Desktop configuration template
βββ .mcp.json # Claude Code project-level MCP config
βββ README.md # This file
βββ LICENSE # MIT LicensePrerequisites
Before you begin, make sure you have:
Docker Desktop installed and running (download here)
An MCP-compatible AI client such as Claude Code, Cursor, or any client supporting the MCP protocol
Git for cloning the repository
Installation
Step 1: Clone the repository
git clone https://github.com/taguianas/kali-mcp-server.git
cd kali-mcp-serverStep 2: Build the Docker image
docker build -t kali-mcp-server .This pulls the official Kali Linux rolling image and installs all security tools. The build takes a few minutes on the first run.
Step 3: Run the MCP server
docker run -d \
--name kali-mcp \
--privileged \
--user root \
-p 8000:8000 \
kali-mcp-serverThe --privileged flag is required because tools like nmap need raw socket access for SYN scans, OS detection, and other low-level network operations.
Step 4: Verify the server is running
# Check the container is up
docker ps | grep kali
# Check the logs
docker logs kali-mcp
# You should see:
# INFO: Uvicorn running on http://0.0.0.0:8000Step 5: Test the MCP endpoint
curl -s -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'You should receive a JSON response containing the server capabilities and tool list.
Connecting to AI Clients
Claude Code (CLI)
claude mcp add -s user --transport http kali-linux http://localhost:8000/mcpVerify the connection:
claude mcp list
# Should show: kali-linux: http://localhost:8000/mcp (HTTP) - ConnectedClaude Code (Desktop App)
Create a .mcp.json file in your project directory:
{
"mcpServers": {
"kali-linux": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Then start a new session in the Claude Code desktop app.
Cursor IDE
Add to your Cursor MCP settings (~/.cursor/mcp.json):
{
"mcpServers": {
"kali-linux": {
"transport": "http",
"url": "http://localhost:8000/mcp"
}
}
}Any MCP Client
The server exposes a standard MCP endpoint at http://localhost:8000/mcp using the Streamable HTTP transport. Any client supporting MCP over HTTP can connect.
Usage Examples
Once connected to your AI client, just ask in natural language:
What you say | What happens |
"Scan scanme.nmap.org for open ports" | Runs |
"Run a vulnerability scan on 10.0.0.5" | Runs |
"Detect the OS on 192.168.1.1" | Runs |
"Scan this web server with nikto: http://target.com" | Runs |
"Find hidden directories on http://target.com" | Runs |
"Check this WordPress site for vulnerable plugins" | Runs |
"Test http://target.com/page?id=1 for SQL injection" | Runs |
"Search for Apache 2.4 exploits" | Runs |
"Do a WHOIS lookup on google.com" | Runs |
"Get DNS records for example.com" | Runs |
"List all available tools" | Shows the complete tool catalog |
Managing the Server
# Start the server
docker start kali-mcp
# Stop the server
docker stop kali-mcp
# Restart the server
docker restart kali-mcp
# View logs
docker logs kali-mcp --tail 50
# Remove and recreate
docker rm -f kali-mcp
docker run -d --name kali-mcp --privileged --user root -p 8000:8000 kali-mcp-serverSecurity Considerations
Input Sanitization: All user inputs are sanitized before being passed to system commands. The sanitize_input() function strips dangerous shell metacharacters including ;, &, |, backticks, $, parentheses, braces, redirects, and newlines. This prevents command injection attacks through the MCP interface.
Parameter Validation: Each tool validates its required parameters and returns clear error messages when inputs are missing or invalid.
Authorized Use Only: This tool must only be used against systems you own or have explicit written authorization to test.
Tech Stack
Component | Technology |
Base Image | Kali Linux Rolling |
MCP Framework | FastMCP 3.1.x |
MCP SDK | mcp 1.26.x |
HTTP Server | Uvicorn |
Language | Python 3.11+ |
Container | Docker |
Transport | Streamable HTTP (MCP) |
Legal Disclaimer
This tool is provided for educational and authorized security testing purposes only. You must only use these tools against systems that you own or have explicit written permission to test. Unauthorized access to computer systems is illegal under laws including the Computer Fraud and Abuse Act (CFAA), the EU Directive on Attacks Against Information Systems, and applicable national legislation.
The authors are not responsible for any misuse or damage caused by this software.
Contributing
Contributions are welcome! Feel free to:
Fork the repository
Create a feature branch (
git checkout -b feature/new-tool)Add your changes
Submit a Pull Request
Ideas for contributions: adding new tools (Gobuster, Masscan, Metasploit integration), adding output formatters, adding authentication for the MCP endpoint, or creating a web dashboard.
Author
Anas TAGUI
GitHub: @taguianas
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
NetworkChuck for the Docker MCP tutorial that inspired this project
Anthropic for the Model Context Protocol
Docker for the containerization platform
Kali Linux for the security tools distribution
The open-source security community for the individual tools (nmap, nikto, sqlmap, etc.)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Security scanner for AI agents and MCP servers: injection, jailbreak, tool abuse.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables LLMs to execute common security testing tools like nmap, sqlmap, hydra, and metasploit through a secure Docker container. Provides controlled access to penetration testing utilities with configurable timeouts and tool discovery capabilities.-
- AlicenseNot gradedqualityDmaintenanceIntegrates 7 security tools (nmap, nuclei, dirsearch, sqlmap, hydra, Acunetix, Metasploit) via MCP protocol for AI-assisted penetration testing with enterprise-grade safety features.1MIT
- FlicenseNot gradedqualityDmaintenanceExposes a hardened Docker container with Kali Linux security tools (nmap, sqlmap, dig, whois, etc.) as MCP tools, enabling network reconnaissance, web analysis, and vulnerability scanning through natural language commands.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to invoke 100+ pre-installed penetration testing tools (e.g., nmap, nuclei, sqlmap) inside a Dockerized Kali Linux environment via MCP, supporting single-turn execution for reconnaissance, scanning, exploitation, and security assessment.AGPL 3.0