yashpatil118/PENTEST-MCP-SERVER
If you are the rightful owner of PENTEST-MCP-SERVER and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
PentestMCP Server is a containerized penetration testing backend that leverages MCP technology to provide a unified API for various security tools.
π‘οΈ PentestMCP Server
PentestMCP Server is a modern, containerized penetration testing backend for MCP Servers. It exposes industry-standard security tools (Nmap, Nikto, SQLMap, WPScan, Dirb, Searchsploit) through a robust, scriptable APIβenabling safe, automated, and repeatable security assessments from anywhere.
β¨ Why PentestMCP?
- Unified API: Control multiple pentest tools from a single interface.
- Safe by Design: Input sanitization, timeouts, and non-root execution.
- Portable: Runs anywhere with Dockerβno manual setup or dependencies.
- Automation Ready: Integrates seamlessly with FastMCP for scripting and orchestration.
- Kali Linux Power: Leverages the worldβs most popular pentesting OS.
π Directory Structure
pentest-mcp-server/
βββ build/
β βββ dockerfile # Docker instructions for building the Kali-based container
β βββ requirements.txt # Python dependencies for the server
β βββ server.py # Main server logic exposing pentest tools via FastMCP
βββ script/
β βββ build.sh # Script to build the Docker image
β βββ test.sh # Script to test the Docker container
βββ readme.md # Project documentation
- All main build and server files are inside the
build/
directory. - The
script/
directory contains build and test scripts. readme.md
is at the project root.
π Features
- π Safe Command Execution: Prevents command injection and enforces timeouts.
- π§° Bundled Tools: Nmap, Nikto, SQLMap, WPScan, Dirb, Searchsploit.
- π³ Dockerized: Secure, isolated, and reproducible environment.
- β‘ FastMCP API: Exposes tools as callable MCP modules.
- π Structured Logging: Easy monitoring and troubleshooting.
π¦ Requirements
- Docker (recommended)
- Or: Python 3.8+ and Kali Linux with required tools installed
ποΈ Quickstart
1οΈβ£ Clone the Repository
git clone <your-repo-url>
cd pentest-mcp-server
2οΈβ£ Build the Docker Image
chmod +x script/build.sh
./script/build.sh
3οΈβ£ Test the Container (Optional)
chmod +x script/test.sh
./script/test.sh
4οΈβ£ Configure Your MCP Client
Add this to your client config file:
{
"mcpServers": {
"pentest-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--cap-add", "NET_RAW",
"--cap-add", "NET_ADMIN",
"--network", "host",
"pentest-mcp:latest"
]
}
}
}
5οΈβ£ Restart Your MCP Client
Close and restart the client to make the PentestMCP server visible.
π§© How It Works: Docker, Kali Linux, and Python
-
Docker
Docker is used to containerize the entire penetration testing environment. This ensures consistent setup, isolation, and easy deployment across any system that supports Docker. -
Kali Linux
The Docker image is based on Kali Linux, a popular penetration testing distribution. Kali provides all the essential security tools (Nmap, Nikto, SQLMap, WPScan, Dirb, Searchsploit) pre-installed or easily installable, forming the foundation for the server. -
Python
Python is used to implement the server logic. The main server script (server.py
) exposes the security tools via a FastMCP-compatible API, handles input validation, manages subprocess execution, and provides structured logging. Python acts as the bridge between the MCP client and the underlying Kali Linux tools.
Chronology:
- Docker builds a Kali Linux-based image.
- Kali Linux supplies the pentesting toolset.
- Python runs the server, exposing tools securely to the MCP ecosystem.
π Learn More
β οΈ Legal & Usage
For authorized and educational use only.
Always obtain permission before scanning or testing any system.
π€ Contributing
Pull requests and issues are welcome! Help make pentesting safer and more accessible.