Skip to main content
Glama
WSL DevSecOps MCP Server

WSL DevSecOps MCP Server

by darkpowerxo

WSL DevSecOps MCP Server

A Model Context Protocol (MCP) server that enables AI to execute DevSecOps tasks directly in your WSL Kali Linux environment. Streamline your container security scanning, Kubernetes management, and security automation workflows.

🎯 For DevSecOps Engineers

This tool bridges AI with your WSL environment, allowing you to:

  • Scan Docker images for vulnerabilities with Trivy

  • Audit Kubernetes clusters against NSA, MITRE, and CIS frameworks

  • Manage K8s resources through natural language commands

  • Generate SBOMs for compliance and supply chain security

  • Automate security scripts and custom workflows

  • Debug containers and pods efficiently

Perfect for DevSecOps teams working with containerized applications and Kubernetes environments who want to leverage AI assistance for security tasks.

Related MCP server: Kali Linux MCP Server

πŸš€ Quick Start

Prerequisites

  • Windows 10/11 with WSL2

  • Kali Linux (or Ubuntu) installed in WSL

  • Node.js v18+ installed on Windows

  • AI Desktop application

  • Docker Desktop (optional, for container operations)

  • kubectl configured with cluster access (for K8s operations)

1. Install Security Tools in WSL

# Open your WSL terminal (Kali Linux)
wsl -d kali-linux

# Update system
sudo apt update && sudo apt upgrade -y

# Install Trivy (vulnerability scanner)
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin

# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# Install Kubescape (K8s security scanner)
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash

# Install Syft (SBOM generator)
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin

# Install Helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

# Install utilities
sudo apt install jq docker.io -y

# Verify installations
trivy --version
kubectl version --client
kubescape version
syft version

2. Create Scripts Directory

mkdir -p /home/kali/scripts
chmod 755 /home/kali/scripts

3. Install MCP Server

# In Windows PowerShell or Command Prompt
cd C:\Users\YourUsername
git clone https://github.com/yourusername/wsl-devsecops-mcp.git
cd wsl-devsecops-mcp
npm install

4. Configure AI Desktop

Edit your AI Desktop configuration file:

Location: %APPDATA%\AI\AI_desktop_config.json

Add this configuration:

{
  "mcpServers": {
    "wsl-devsecops": {
      "command": "node",
      "args": ["C:\\Users\\YourUsername\\wsl-devsecops-mcp\\wsl-mcp-server.js"],
      "env": {
        "WSL_DISTRO": "kali-linux",
        "WSL_SCRIPTS_DIR": "/home/kali/scripts"
      }
    }
  }
}

Important: Replace YourUsername with your actual Windows username.

5. Restart AI Desktop

Close and reopen AI Desktop to load the MCP server.

πŸ› οΈ Available Tools

Security Scanning

scan_docker_image

Scan Docker images for vulnerabilities using Trivy.

Example prompts:

  • "Scan nginx:latest for critical vulnerabilities"

  • "Check alpine:3.18 for security issues"

  • "Scan our production image myapp:v1.2.3 for HIGH and CRITICAL vulnerabilities"

generate_sbom

Generate Software Bill of Materials for container images.

Example prompts:

  • "Generate an SBOM for nginx:latest in CycloneDX format"

  • "Create an SPDX SBOM for our application image"

Kubernetes Management

scan_kubernetes_cluster

Audit your K8s cluster against security frameworks (NSA, MITRE, CIS).

Example prompts:

  • "Scan our K8s cluster against NSA framework"

  • "Run a CIS benchmark on the production namespace"

  • "Check our cluster for MITRE ATT&CK compliance"

list_kubernetes_resources

List and inspect Kubernetes resources.

Example prompts:

  • "Show all pods in the production namespace"

  • "List all services across all namespaces"

  • "What deployments are running in staging?"

kubectl_get_logs

Retrieve logs from Kubernetes pods.

Example prompts:

  • "Get the last 500 lines from the api-server pod"

  • "Show logs from the nginx pod in production namespace"

  • "Get logs from the web container in the app-pod"

Container Operations

check_docker_containers

List Docker containers and their status.

Example prompts:

  • "What Docker containers are currently running?"

  • "Show all containers including stopped ones"

  • "List the status of all my containers"

Custom Automation

run_security_script

Execute custom security scripts from /home/kali/scripts.

Example prompts:

  • "Run the compliance-check.sh script"

  • "Execute vulnerability-report.py with the --full flag"

execute_wsl_command

Run any command in your WSL environment.

Example prompts:

  • "Run nmap scan on 192.168.1.0/24"

  • "Check the disk usage in WSL"

  • "List all running processes"

πŸ“‹ Common DevSecOps Workflows

Pre-Deployment Security Check

"Scan the myapp:latest image for vulnerabilities, generate an SBOM, 
and check if all HIGH/CRITICAL issues are patched"

Cluster Security Audit

"Scan our Kubernetes cluster against NSA framework and list any 
pods that don't meet security standards"

Incident Response

"Get logs from the failing api-server pod in production, 
check what containers are running, and scan the image for known exploits"

Compliance Reporting

"Generate an SBOM for all our production images and run a CIS 
benchmark on our cluster"

πŸ”§ Configuration

Environment Variables

Set these in your AI Desktop config:

  • WSL_DISTRO - Your WSL distribution name (default: kali-linux)

    • Find it with: wsl -l -v

    • Common values: kali-linux, Ubuntu, Ubuntu-22.04

  • WSL_SCRIPTS_DIR - Directory for custom scripts (default: /home/kali/scripts)

Custom Scripts

Place your security automation scripts in /home/kali/scripts:

# Example: Create a compliance check script
cat > /home/kali/scripts/compliance-check.sh <<'EOF'
#!/bin/bash
echo "Running compliance checks..."
trivy image --severity CRITICAL,HIGH $1
kubescape scan framework nsa
EOF

chmod +x /home/kali/scripts/compliance-check.sh

Then use it: "Run compliance-check.sh with nginx:latest"

πŸ› Troubleshooting

MCP Server Not Connecting

  1. Check AI Desktop logs: %APPDATA%\AI\logs

  2. Verify Node.js: node --version (should be v18+)

  3. Test manually: node C:\path\to\wsl-mcp-server.js

WSL Commands Failing

  1. Verify WSL is running: wsl -l -v

  2. Test connection: wsl -d kali-linux whoami

  3. Check distribution name matches config

Tool Not Found Errors

Verify tools are installed in WSL:

wsl -d kali-linux bash -c "which trivy kubectl kubescape syft"

Permission Issues

# In WSL, fix permissions
chmod 755 /home/kali/scripts
chmod +x /home/kali/scripts/*.sh

πŸ”’ Security Considerations

  • This server has full access to your WSL environment

  • Use only in trusted environments

  • Review all custom scripts before execution

  • Keep security tools updated regularly

  • Never commit sensitive credentials to scripts

  • Consider using separate WSL instances for different environments

πŸ“š Additional Resources

🀝 Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

πŸ“„ License

MIT License - See LICENSE file for details

πŸ™ Acknowledgments

Built with:


Made for DevSecOps engineers who want to work smarter, not harder. πŸš€

Available Tools

8 tools
check_docker_containersC

List running Docker containers and their status

Inputs: all.

execute_wsl_commandB

Execute a command in the WSL Kali Linux environment

Inputs: command (required), workdir.

generate_sbomC

Generate Software Bill of Materials for a Docker image using Syft

Inputs: image (required), format.

kubectl_get_logsC

Get logs from a Kubernetes pod

Inputs: pod_name (required), tail, container, namespace.

list_kubernetes_resourcesC

List Kubernetes resources (pods, services, deployments, etc.)

Inputs: resource_type (required), namespace.

run_security_scriptC

Run a custom security script from the scripts directory

Inputs: script_name (required), args.

scan_docker_imageC

Scan a Docker image for vulnerabilities using Trivy

Inputs: image (required), severity.

scan_kubernetes_clusterC

Scan Kubernetes cluster for security issues using Kubescape

Inputs: framework, namespace.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 8 tools

    Disambiguation3/5

    Most tools have distinct purposes, but execute_wsl_command is a generic escape hatch that can overlap with every specialized tool, especially run_security_script and the scanning/listing tools. An agent may reasonably choose execute_wsl_command instead of a purpose-built tool, creating ambiguity.

    Naming Consistency4/5

    The tools mostly follow a snake_case verb_noun convention such as scan_docker_image, list_kubernetes_resources, and generate_sbom. The main deviation is kubectl_get_logs, which includes a tool prefix instead of starting with the verb.

    Tool Count5/5

    Eight tools is well-scoped for a DevSecOps server covering execution, Docker scanning, Kubernetes scanning, listing resources, SBOM generation, and logs. Each tool has a reasonably clear place in the workflow.

    Completeness4/5

    The surface covers core DevSecOps operations across WSL command execution, Docker vulnerability scanning, SBOM generation, Kubernetes scanning, resource listing, container listing, and pod logs. Minor gaps remain, such as dedicated report retrieval or richer Kubernetes inspection, but generic command execution provides a workaround.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to execute penetration testing commands and security tools on Kali Linux remotely. Supports automated reconnaissance, vulnerability scanning, and CTF solving through integration with 25+ offensive security tools like nmap, gobuster, and nuclei.
      16
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to perform penetration testing and security assessments by exposing 60+ Kali Linux security tools including network scanning, web security testing, password cracking, exploitation frameworks, and OSINT capabilities through an AI-friendly interface.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides a containerized Kali Linux environment that gives AI assistants access to a comprehensive suite of security and penetration testing tools. It enables automated vulnerability scanning, network reconnaissance, and secure command execution through the Model Context Protocol.
      26
      MIT