mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 22:33:38 +00:00
feat: Added support for SSE transport for MCP servers.
Tested with n8n MCP server node.
This commit is contained in:
4
mcp_examples/stdio/README.md
Normal file
4
mcp_examples/stdio/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# STDIO examples
|
||||
|
||||
## Description
|
||||
In this section, you will find some examples to integrate STDIO MCP servers with the agent.
|
||||
19
mcp_examples/stdio/kali/Dockerfile
Normal file
19
mcp_examples/stdio/kali/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM pentestagent:latest
|
||||
|
||||
RUN git clone https://github.com/Wh0am123/MCP-Kali-Server.git
|
||||
|
||||
WORKDIR /app/MCP-Kali-Server/
|
||||
|
||||
RUN git checkout 61272cde048c236cc61c75e2fac3c06243c633dd
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip install --no-cache-dir -r MCP-Kali-Server/requirements.txt
|
||||
|
||||
COPY --chown=pentestagent:pentestagent mcp_servers.json /app/pentestagent/mcp/
|
||||
|
||||
# Expose any needed ports
|
||||
EXPOSE 8080
|
||||
|
||||
# Default command
|
||||
CMD ["python", "-m", "pentestagent"]
|
||||
48
mcp_examples/stdio/kali/README.md
Normal file
48
mcp_examples/stdio/kali/README.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# KALI MCP integration
|
||||
|
||||
## Steps
|
||||
|
||||
1. Compile base Docker image.
|
||||
|
||||
```bash
|
||||
docker build ../../ -t pentestagent:latest
|
||||
```
|
||||
|
||||
2. Configure .env file with API tokens and models for AI.
|
||||
|
||||
```
|
||||
OPENAI_API_KEY=sk-...
|
||||
PENTESTAGENT_MODEL=gpt-5
|
||||
```
|
||||
|
||||
3. Configure the IP address or hostname in the mcp_servers.json file:
|
||||
|
||||
``` json
|
||||
{
|
||||
"mcpServers": {
|
||||
"kali": {
|
||||
"command": "python",
|
||||
"args": ["MCP-Kali-Server/mcp_server.py", "--server", "http://<hostname>:5000"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
4. Launch docker-compose
|
||||
|
||||
```bash
|
||||
# Build
|
||||
docker-compose build
|
||||
|
||||
# Run
|
||||
docker-compose run --rm pentestagent
|
||||
|
||||
```
|
||||
|
||||
At this point, you will be able to check the MCP servers with the /mcp list command
|
||||
|
||||

|
||||
|
||||
On server side, there should be a connection incoming:
|
||||
|
||||

|
||||
21
mcp_examples/stdio/kali/docker-compose.yml
Normal file
21
mcp_examples/stdio/kali/docker-compose.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
services:
|
||||
pentestagent:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: pentestagent_with_kali_mcp
|
||||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
||||
- PENTESTAGENT_MODEL=${PENTESTAGENT_MODEL}
|
||||
- PENTESTAGENT_DEBUG=${PENTESTAGENT_DEBUG:-false}
|
||||
|
||||
networks:
|
||||
- pentestagent-net
|
||||
stdin_open: true
|
||||
tty: true
|
||||
|
||||
|
||||
networks:
|
||||
pentestagent-net:
|
||||
driver: bridge
|
||||
BIN
mcp_examples/stdio/kali/image-1.png
Normal file
BIN
mcp_examples/stdio/kali/image-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 364 KiB |
BIN
mcp_examples/stdio/kali/image.png
Normal file
BIN
mcp_examples/stdio/kali/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
8
mcp_examples/stdio/kali/mcp_servers.json
Normal file
8
mcp_examples/stdio/kali/mcp_servers.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"kali": {
|
||||
"command": "python",
|
||||
"args": ["MCP-Kali-Server/mcp_server.py", "--server", "http://192.168.0.22:5000"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user