Skip to main content

MCP Tool & Browser Execution Plane

The vg-mcp-orchestrator microservice provides a dual-plane execution engine running on Node.js 22 with headless Chromium, Puppeteer, Playwright, and programmatic container dispatch.


1. Dual-Plane Service Architecture​

Inside vg-mcp-orchestrator, two isolated execution services operate concurrently:

PlaneLogical ServicePrimary Responsibilities
Plane 1: Security Tool & Puppeteer MCP Servermcp-tool-serverDispatches containerized security tools (nmap, nuclei, subfinder, ffuf, katana, testssl, gitleaks, sqlmap, wpscan, zap, trivy, metasploit, beef, set) via the scoped runtime proxy and performs headless Puppeteer web analysis.
Plane 2: Playwright Browser Automation Servermcp-playwright-serverProvides deterministic headless Chromium DOM snapshots, interactive form testing, and visual verification for modern SPAs.

2. Tool Execution Contract (POST /tools/execute)​

When SecurityAgent or the direct Tool Execution API dispatches a tool run, the MCP server validates the tool identifier, normalizes target parameters, and executes the tool inside its dedicated sibling worker container:

Example Request Payload​

{
"tool": "nuclei",
"params": {
"target": "https://target.example.com",
"scan_id": "scan_example_01",
"result_path": "<artifact_dir>/scan_example_01_nuclei.json"
}
}

Worker Mapping & Automatic Artifact Routing​

Both synchronous execution (/tools/execute) and streaming execution (/tools/stream) automatically assign deterministic artifact paths whenever a scan_id is supplied:

Tool KeyTarget Worker SandboxAuto-Generated Artifact Format
nmapvg-worker-nmap<scan_id>_nmap.xml
nucleivg-worker-nuclei<scan_id>_nuclei.json
subfindervg-worker-subfinder<scan_id>_subfinder.json
ffufvg-worker-ffuf<scan_id>_ffuf.json
katanavg-worker-katana<scan_id>_katana.json
testsslvg-worker-testssl<scan_id>_testssl.json
gitleaksvg-worker-gitleaks<scan_id>_gitleaks.json
wpscanvg-worker-wpscan<scan_id>_wpscan.json
trivyvg-worker-trivy<scan_id>_trivy.json

3. Demuxing Container Exec Streams​

When attaching to a worker container exec stream, the container runtime multiplexes stdout (stream type 1) and stderr (stream type 2) frames with an 8-byte binary header ([stream_type, 0, 0, 0, size_b1, size_b2, size_b3, size_b4]).

The MCP server's stream demultiplexer strips these 8-byte frame headers in real time, enforces per-tool execution timeouts (300s–900s), and returns clean UTF-8 stdout and stderr buffers to the caller.