pentest-mcp-server
Wraps common web penetration testing tools in a Docker container and exposes them as Claude tools for educational use in controlled lab environments.
README
Pentest MCP Server
A Model Context Protocol (MCP) server that wraps common web penetration testing tools inside a Docker container and exposes them as Claude tools — for educational use in controlled lab environments only.
Tools Available
| Tool | Binary | Description |
|---|---|---|
nmap_scan |
nmap | Port scan, service/OS detection |
nikto_scan |
nikto | Web server misconfiguration & vulnerability scan |
sqlmap_scan |
sqlmap | SQL injection detection and exploitation |
dirb_scan |
dirb | Web directory/file brute-force |
wpscan_scan |
wpscan | WordPress vulnerability scanner |
searchsploit_query |
searchsploit | ExploitDB search for known CVEs/exploits |
whois_lookup |
whois | Domain/IP registration info |
dns_recon |
dig | DNS record enumeration |
nc_banner_grab |
netcat | Raw TCP banner grabbing |
list_tools |
built-in | Show all tools and usage |
Architecture
Claude Desktop
│
▼
docker/mcp-gateway (reads registry.yaml + custom.yaml)
│
▼
pentest-mcp-server (Debian + Kali tools, non-root)
│
▼
nmap / nikto / sqlmap / dirb / wpscan / searchsploit / whois / dig / nc
Prerequisites
- Docker Desktop installed and running
- Claude Desktop installed
- Docker MCP Toolkit extension enabled in Docker Desktop
Installation
1. Clone the repo
git clone https://github.com/YOUR_USERNAME/pentest-mcp-server.git
cd pentest-mcp-server
2. Build the Docker image
docker build -t pentest-mcp-server .
First build takes ~3-5 minutes — it pulls Debian slim and installs all Kali tools.
3. Set up the MCP catalog
Windows (CMD):
mkdir %USERPROFILE%\.docker\mcp\catalogs
copy custom.yaml %USERPROFILE%\.docker\mcp\catalogs\custom.yaml
macOS / Linux:
mkdir -p ~/.docker/mcp/catalogs
cp custom.yaml ~/.docker/mcp/catalogs/custom.yaml
4. Update the MCP registry
Open %USERPROFILE%\.docker\mcp\registry.yaml (Windows) or ~/.docker/mcp/registry.yaml (macOS/Linux) and add under the registry: key:
registry:
pentest:
ref: ""
5. Configure Claude Desktop
Open your Claude Desktop config:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Replace or update the mcpServers section:
Windows:
{
"mcpServers": {
"MCP_DOCKER": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "//var/run/docker.sock:/var/run/docker.sock",
"-v", "C:\\Users\\YOUR_USERNAME\\.docker\\mcp:/mcp",
"docker/mcp-gateway",
"--catalog=/mcp/catalogs/docker-mcp.yaml",
"--catalog=/mcp/catalogs/custom.yaml",
"--config=/mcp/config.yaml",
"--registry=/mcp/registry.yaml",
"--tools-config=/mcp/tools.yaml",
"--transport=stdio"
],
"env": {
"LOCALAPPDATA": "C:\\Users\\YOUR_USERNAME\\AppData\\Local",
"ProgramData": "C:\\ProgramData",
"ProgramFiles": "C:\\Program Files"
}
}
}
}
macOS / Linux:
{
"mcpServers": {
"MCP_DOCKER": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "/var/run/docker.sock:/var/run/docker.sock",
"-v", "/home/YOUR_USERNAME/.docker/mcp:/mcp",
"docker/mcp-gateway",
"--catalog=/mcp/catalogs/docker-mcp.yaml",
"--catalog=/mcp/catalogs/custom.yaml",
"--config=/mcp/config.yaml",
"--registry=/mcp/registry.yaml",
"--tools-config=/mcp/tools.yaml",
"--transport=stdio"
]
}
}
}
Replace
YOUR_USERNAMEwith your actual system username.
6. Restart Claude Desktop
Fully quit and reopen Claude Desktop. Open a new chat and type list_tools — you should see all 10 pentest tools listed.
Optional: WPScan API Token
WPScan works without a token but won't return vulnerability data for plugins/themes. To enable it:
- Register free at wpscan.com/register
- Copy your token from wpscan.com/profile
- Set it as a Docker secret:
docker mcp secret set WPSCAN_API_TOKEN="your_token_here"
Usage Examples
Ask Claude in a new chat:
Scan 192.168.56.101 for open ports
Run a full service version scan on 192.168.56.101
Run Nikto on http://192.168.56.101
Check http://192.168.56.101/login.php?id=1 for SQL injection
Brute-force directories on http://192.168.56.101
Scan the WordPress site at http://192.168.56.101/wp and enumerate plugins
Search ExploitDB for Apache 2.4 exploits
Grab the banner on port 22 of 192.168.56.101
Do a DNS lookup for example.local
Environment Variables
| Variable | Default | Description |
|---|---|---|
CMD_TIMEOUT |
300 | Max seconds for most commands |
NMAP_TIMEOUT |
120 | Max seconds for nmap specifically |
WPSCAN_API_TOKEN |
(empty) | WPScan API token for vuln data |
Security Design
- Non-root container — runs as
mcpuser(uid 1000) - Input allowlisting — every parameter regex-validated before subprocess call
- Flag whitelists — only a curated set of flags accepted per tool
- No
shell=True— all commands passed as lists tosubprocess.run() - No secrets in logs — tokens never logged
Troubleshooting
Tools not showing in Claude:
# Confirm image exists
docker images | grep pentest
# Test gateway manually (Windows)
docker run --rm -i -v //var/run/docker.sock:/var/run/docker.sock -v %USERPROFILE%\.docker\mcp:/mcp docker/mcp-gateway --catalog=/mcp/catalogs/docker-mcp.yaml --catalog=/mcp/catalogs/custom.yaml --config=/mcp/config.yaml --registry=/mcp/registry.yaml --tools-config=/mcp/tools.yaml --transport=stdio
Look for pentest: (10 tools) in the output.
docker mcp gateway run shows 0 tools:
Use the explicit docker run docker/mcp-gateway style in claude_desktop_config.json instead — the shorthand doesn't mount the Docker socket correctly on Windows.
nmap returns permission errors:
The Dockerfile runs setcap on nmap. Rebuild: docker build -t pentest-mcp-server .
Build fails with 404 apt errors: Kali's rolling mirrors occasionally lag. Wait 10 minutes and retry — it's a transient mirror sync issue.
⚠️ Legal Notice
This tool is for authorized, educational use only. Only scan systems you own or have explicit written permission to test. Unauthorized scanning is illegal in most jurisdictions.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。