Kali MCP Server

Kali MCP Server

Provides AI-assisted web penetration testing tools built on Kali Linux Docker container, with proper input sanitization and formatted output.

Category
Visit Server

README

šŸ‰ Kali MCP Server - Web Penetration Testing

A Model Context Protocol (MCP) server built on Kali Linux Docker container, providing AI-assisted web penetration testing tools with proper input sanitization and formatted output.

Security Docker MCP


šŸš€ Features

Security Tools Included

Tool Purpose Category
Nmap Port scanning, service detection, OS fingerprinting Network
Nikto Web server vulnerability scanning Web Vuln
SQLMap SQL injection testing Web Vuln
WPScan WordPress security assessment CMS
DIRB Directory brute-forcing Discovery
Gobuster Fast directory/DNS/vhost enumeration Discovery
FFUF Web fuzzing Discovery
SearchSploit Exploit database search Research
SSLScan SSL/TLS analysis Crypto
WhatWeb Web technology identification Recon
WAFW00F WAF detection Recon
Nuclei Template-based vulnerability scanning Web Vuln

Key Features

  • āœ… Non-root execution with proper network capabilities
  • āœ… Input sanitization to prevent command injection
  • āœ… Formatted output for easy reading
  • āœ… Async execution for non-blocking operations
  • āœ… Output persistence for report generation
  • āœ… Rate limiting to prevent abuse
  • āœ… Docker isolation for security

šŸ“¦ Installation

Prerequisites

  • Docker Engine 20.10+
  • Docker Compose v2.0+
  • 4GB RAM minimum (8GB recommended)
  • 10GB disk space

Quick Start

# Clone or download the project
cd kali-mcp-server

# Build the Docker image
docker-compose build

# Start the server
docker-compose up -d

# Check logs
docker-compose logs -f

# Verify it's running
curl http://localhost:8010/health

Build Only

docker build -t kali-mcp-server:latest .

Run Manually

docker run -d \
  --name kali-mcp \
  --cap-add NET_RAW \
  --cap-add NET_ADMIN \
  -p 8010:8010 \
  -v kali-outputs:/app/outputs \
  kali-mcp-server:latest

šŸ”§ Configuration

Environment Variables

Variable Default Description
MCP_HOST 0.0.0.0 Server bind address
MCP_PORT 8010 Server port
DEBUG false Enable debug logging
DEFAULT_TIMEOUT 300 Default tool timeout (seconds)
MAX_TIMEOUT 3600 Maximum allowed timeout
WPSCAN_API_TOKEN - WPScan vulnerability database API token

Claude Desktop Integration

Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "kali-pentest": {
      "url": "http://localhost:8010/sse"
    }
  }
}

Or for Docker execution:

{
  "mcpServers": {
    "kali-pentest": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "--cap-add=NET_RAW",
        "--cap-add=NET_ADMIN",
        "-p", "8010:8010",
        "kali-mcp-server:latest"
      ]
    }
  }
}

šŸ› ļø Available Tools

1. Network Scanning

nmap_scan

nmap_scan(
    target="192.168.1.1",           # IP, hostname, or CIDR
    ports="80,443,8080",            # Port specification
    scan_type="version",            # default, syn, connect, udp, version, aggressive, vuln
    scripts="http-enum,ssl-enum",   # NSE scripts
    timing=3,                       # 0-5 (paranoid to insane)
    timeout=600
)

2. Web Vulnerability Scanning

nikto_scan

nikto_scan(
    target="http://example.com",
    port=80,
    ssl=False,
    tuning="123bde",    # Test categories
    timeout=600
)

sqlmap_scan

sqlmap_scan(
    target_url="http://example.com/page?id=1",
    data="username=admin",          # POST data
    parameter="id",                 # Specific param to test
    level=3,                        # 1-5
    risk=2,                         # 1-3
    technique="BEUST",              # Injection techniques
    dbms="mysql",                   # Target DBMS
    tables=True,                    # Enumerate tables
    timeout=600
)

wpscan_scan

wpscan_scan(
    target="http://wordpress-site.com",
    enumerate="vp,vt,u",            # plugins, themes, users
    plugins_detection="aggressive",
    api_token="your_token"
)

3. Directory Discovery

dirb_scan

dirb_scan(
    target="http://example.com",
    wordlist="big",                 # common, big, small
    extensions="php,html,txt",
    recursive=True,
    timeout=600
)

gobuster_scan

gobuster_scan(
    target="http://example.com",
    mode="dir",                     # dir, dns, vhost
    wordlist="medium",
    extensions="php,html",
    threads=40,
    timeout=600
)

ffuf_fuzz

ffuf_fuzz(
    target="http://example.com/FUZZ",
    wordlist="common",
    method="GET",
    headers="X-Custom:value",
    filter_code="404,500",
    threads=50
)

4. Information Gathering

whatweb_scan

whatweb_scan(
    target="http://example.com",
    aggression=3                    # 1-4
)

wafw00f_detect

wafw00f_detect(
    target="http://example.com",
    list_all=True
)

sslscan_scan

sslscan_scan(
    target="example.com",
    port=443,
    show_certs=True
)

5. Exploit Research

searchsploit_search

searchsploit_search(
    search_term="apache 2.4.49",
    exact_match=False,
    exclude="dos,windows"
)

6. Vulnerability Scanning

nuclei_scan

nuclei_scan(
    target="http://example.com",
    templates="cves,vulnerabilities",
    severity="high,critical",
    tags="rce,sqli",
    rate_limit=150
)

šŸ”’ Security Considerations

Input Sanitization

All inputs are validated and sanitized:

  • Targets: Validated as IP, CIDR, hostname, or URL
  • Ports: Validated format, range checks
  • Parameters: Regex filtering, dangerous character removal
  • Paths: Allowed directory whitelist

Dangerous Patterns Blocked

; | & ` $ ( ) { } > < || && ../ %00 \n \r

Non-Root Execution

The container runs as pentester user (UID 1000) with limited capabilities:

cap_add:
  - NET_RAW           # Required for SYN scans
  - NET_ADMIN         # Network configuration
  - NET_BIND_SERVICE  # Bind to low ports

šŸ“‹ Web Pentest Workflow

Recommended Scanning Order

1. Reconnaissance
   ā”œā”€ā”€ whatweb_scan          # Identify technologies
   ā”œā”€ā”€ wafw00f_detect        # Check for WAF
   └── nmap_scan (ports)     # Open ports/services

2. Discovery
   ā”œā”€ā”€ gobuster_scan (dir)   # Directory enumeration
   ā”œā”€ā”€ gobuster_scan (dns)   # Subdomain enumeration
   └── ffuf_fuzz             # Parameter fuzzing

3. Vulnerability Assessment
   ā”œā”€ā”€ nikto_scan            # General web vulnerabilities
   ā”œā”€ā”€ nuclei_scan           # Template-based scanning
   ā”œā”€ā”€ sslscan_scan          # SSL/TLS issues
   └── wpscan_scan           # If WordPress detected

4. Targeted Testing
   ā”œā”€ā”€ sqlmap_scan           # SQL injection
   └── searchsploit_search   # Find exploits

5. Reporting
   └── Review /app/outputs   # All scan results saved

šŸ“ Project Structure

kali-mcp-server/
ā”œā”€ā”€ Dockerfile              # Kali Linux container setup
ā”œā”€ā”€ docker-compose.yml      # Orchestration
ā”œā”€ā”€ requirements.txt        # Python dependencies
ā”œā”€ā”€ README.md              # This file
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ __init__.py
│   ā”œā”€ā”€ main.py            # FastMCP server & tools
│   ā”œā”€ā”€ validators.py      # Input sanitization
│   ā”œā”€ā”€ formatters.py      # Output formatting
│   └── config.py          # Settings management
ā”œā”€ā”€ config/
│   └── claude_desktop_config.json
ā”œā”€ā”€ scripts/               # Helper scripts
└── wordlists/            # Custom wordlists

šŸ› Troubleshooting

Container Won't Start

# Check logs
docker-compose logs kali-mcp

# Verify capabilities
docker run --rm --cap-add NET_RAW kali-mcp-server nmap --version

Scans Timing Out

# Increase timeout
docker-compose exec kali-mcp env DEFAULT_TIMEOUT=900

# Or pass timeout parameter
nmap_scan(target="...", timeout=900)

Permission Denied

# Ensure proper capabilities
docker run --cap-add NET_RAW --cap-add NET_ADMIN ...

Tool Not Found

# Enter container and verify
docker-compose exec kali-mcp which nmap nikto sqlmap

šŸ“œ License

MIT License - Use responsibly and only on authorized systems.


āš ļø Legal Disclaimer

This tool is for authorized security testing only. Unauthorized access to computer systems is illegal. Always:

  1. Get written permission before testing
  2. Define scope clearly
  3. Document all activities
  4. Report findings responsibly

The authors assume no liability for misuse of this tool.


šŸ¤ Contributing

  1. Fork the repository
  2. Create feature branch
  3. Add tests for new tools
  4. Submit pull request

šŸ“ž Support

For issues and feature requests, open a GitHub issue with:

  • Environment details
  • Steps to reproduce
  • Expected vs actual behavior
  • Relevant logs

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured