feat: Added support for SSE transport for MCP servers.

Tested with n8n MCP server node.
This commit is contained in:
famez
2026-02-22 13:49:46 +01:00
parent da17546de4
commit 86aa316007
21 changed files with 308 additions and 274 deletions

View File

@@ -0,0 +1,4 @@
# STDIO examples
## Description
In this section, you will find some examples to integrate STDIO MCP servers with the agent.

View 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"]

View 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
![alt text](image.png)
On server side, there should be a connection incoming:
![alt text](image-1.png)

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -0,0 +1,8 @@
{
"mcpServers": {
"kali": {
"command": "python",
"args": ["MCP-Kali-Server/mcp_server.py", "--server", "http://192.168.0.22:5000"]
}
}
}