DeepakNarayananS/AI_Offensive_MCP_Using_KaliLinux
If you are the rightful owner of AI_Offensive_MCP_Using_KaliLinux and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Model Context Protocol (MCP) server is a Python-based server designed to facilitate communication between a client and a server, allowing for the execution of commands on a remote machine using natural-language prompts.
dnsoc-mcp-kali — Kali MCP Server + VSCode Co‑Pilot Client
A lightweight setup to run a Python-based Model Context Protocol (MCP) server on Kali Linux (VMware) and connect to it from VSCode on Windows using a small Python client. VSCode Co‑Pilot can then send natural‑language prompts that get executed on the Kali VM.
Use this only on machines and networks you own or are authorized to test.
For detailed steps, follow the mentioned website : https://dnsoc.notion.site/Creating-MCP-Server-28a27f6eb2538011939ee22af00b13bb?source=copy_link
Features
- Python MCP server running on Kali Linux (VM)
- Windows VSCode client to connect via
mcp.json(Co‑Pilot / stdio) - Natural-language prompts in VSCode trigger automated commands on Kali
- Minimal manual configuration ; only the
mcp.jsonfile needs local paths/URL edits - Code analyzed with SonarQube (currently bug-free)
Requirements
python3aiohttpasynciotyping
Install dependencies (example):
python3 -m pip install aiohttp
Quick Start
1. Clone & enter repo
git clone <repo-url>
cd dnsoc-mcp-kali
2. Start the Kali MCP server (on Kali VM)
Run the server script on the Kali VM:
python3 kali_mcp_server.py --http --port <port-number>
If you don't pass a port, 8000 is preconfigured in the project; ensure the same port is used in mcp.json.
3. Configure VSCode client (on Windows host)
- Create a new folder in VSCode and add
windows_kali_mcp_client.pyinside it. - Inside that folder create a
.vscodesubfolder. - Add
mcp.jsonto.vscode/and paste this content, then update the paths, username, IP and port accordingly:
{
"servers": {
"kali_mcp": {
"type": "stdio",
"command": "C:\\Users\\<username>\\AppData\\Local\\Programs\\Python\\Python314\\python.exe",
"args": [
"C:\\Users\\<username>\\Documents\\kali_mcp\\windows_kali_mcp_client.py",
"http://192.168.1.7:8000"
]
}
}
}
NOTE: Make sure the command Python path and the args client script path are correct for your machine. Also update the http://<kali-ip>:<port> URL to the Kali VM IP and port in your network.
Folder structure
dnsoc-mcp-kali/
├─ kali_mcp_server.py
├─ windows_kali_mcp_client.py # copy into your VSCode project folder on Windows
├─ README.md
└─ .vscode/
└─ mcp.json # create this locally in your VSCode project and edit paths/URL
Only
.vscode/mcp.jsonneeds manual edits. The other files are ready to run.
Example prompts to test (from VSCode)
Use these prompts via VSCode Co‑Pilot (or whatever interface you're using) once server + client are configured and running.
-
Can you provide a list of tools available in the kali_mcp environment, along with their main use cases (e.g., scanning, exploitation)? -
Run an Nmap basic ping scan (-sn) against example.com on the Kali Linux machine (IP: 192.168.1.7). Ensure the command is executed on the remote machine via SSH. Save the normal-format output to the desktop of the Kali machine (e.g., /home/kali/Desktop/example_scan.txt), and present a concise, nicely formatted summary of the results here in chat.
If configured correctly, the server will execute the commands and return results to VSCode.
Troubleshooting
-
Server not reachable: confirm Kali VM networking (bridged/host-only), firewall, and that the port matches in both server and
mcp.json. -
Permission/path errors: verify the Python executable path and client script path in
mcp.json. -
If Co‑Pilot/VSCode doesn't start the client, try running the client script manually to see logs:
& "C:\Users\<username>\AppData\Local\Programs\Python\Python314\python.exe" "C:\path\to\windows_kali_mcp_client.py" "http://<kali-ip>:<port>"
Security & Legal
Only use this setup on hosts you own or have explicit permission to test. Executing commands on remote machines can be destructive ; review commands before running.