From b3016e0f0b837dc491c16b94aee09ebfadb5a319 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Mon, 30 Jun 2025 16:49:19 -0600 Subject: [PATCH] playwright docker mcp with vnc --- openwebui/mcp-servers/docker-compose.yml | 32 +++++++++++++ openwebui/mcp-servers/novnc.Dockerfile | 13 ++++++ openwebui/mcp-servers/npx-uvx.Dockerfile | 9 ++++ openwebui/mcp-servers/playwright.Dockerfile | 51 +++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 openwebui/mcp-servers/docker-compose.yml create mode 100644 openwebui/mcp-servers/novnc.Dockerfile create mode 100644 openwebui/mcp-servers/npx-uvx.Dockerfile create mode 100644 openwebui/mcp-servers/playwright.Dockerfile diff --git a/openwebui/mcp-servers/docker-compose.yml b/openwebui/mcp-servers/docker-compose.yml new file mode 100644 index 0000000..b657586 --- /dev/null +++ b/openwebui/mcp-servers/docker-compose.yml @@ -0,0 +1,32 @@ +services: + sequential: + container_name: sequential_thinking + build: + context: . + dockerfile: npx-uvx.Dockerfile + # restart: always + command: uvx mcpo --port 3901 -- npx -y @modelcontextprotocol/server-sequential-thinking + ports: + - 3901:3901 + + playwright: + container_name: playwrite_mcp + build: + context: . + dockerfile: playwright.Dockerfile + # restart: always + ports: + - "3902:3902" # MCP port + + playwright_novnc: + build: + context: . + dockerfile: novnc.Dockerfile + container_name: playwrite_novnc + ports: + - "6080:6080" # noVNC web access + depends_on: + - playwright + # restart: always + command: > + websockify --web=/opt/novnc --wrap-mode=ignore 6080 playwrite_mcp:5900 \ No newline at end of file diff --git a/openwebui/mcp-servers/novnc.Dockerfile b/openwebui/mcp-servers/novnc.Dockerfile new file mode 100644 index 0000000..2dce1cd --- /dev/null +++ b/openwebui/mcp-servers/novnc.Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.10-slim + +RUN apt-get update && \ + apt-get install -y git curl && \ + git clone https://github.com/novnc/noVNC.git /opt/novnc && \ + pip install websockify && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt/novnc + +RUN echo '' > /opt/novnc/index.html +EXPOSE 6080 +CMD ["websockify", "--web=/opt/novnc", "6080", "playwright:5900"] \ No newline at end of file diff --git a/openwebui/mcp-servers/npx-uvx.Dockerfile b/openwebui/mcp-servers/npx-uvx.Dockerfile new file mode 100644 index 0000000..d8ad4d7 --- /dev/null +++ b/openwebui/mcp-servers/npx-uvx.Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/astral-sh/uv:debian + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + nodejs \ + npm \ + && npm install -g n \ + && n stable \ + && apt-get clean && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/openwebui/mcp-servers/playwright.Dockerfile b/openwebui/mcp-servers/playwright.Dockerfile new file mode 100644 index 0000000..598988b --- /dev/null +++ b/openwebui/mcp-servers/playwright.Dockerfile @@ -0,0 +1,51 @@ +FROM debian + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + curl \ + gnupg \ + xvfb \ + x11vnc \ + fluxbox \ + chromium \ + ca-certificates \ + x11-utils \ + nodejs \ + npm \ + make \ + g++ \ + pip \ + && npm install -g n \ + && n stable \ + && apt-get install -y pipx python3-venv \ + && pipx install uv \ + && apt-get clean && rm -rf /var/lib/apt/lists/* +ENV PATH="/root/.local/bin:${PATH}" + +RUN npx playwright install chrome + +# Environment variables +ENV DISPLAY=:99 +ENV SCREEN_RESOLUTION=1280x720x24 + +# Startup script +RUN cat <<'EOF' > /playwright-start.sh +#!/bin/bash + +# Start virtual display +Xvfb :99 -screen 0 $SCREEN_RESOLUTION & +sleep 2 + +# Start window manager +fluxbox & + +# Start VNC server +x11vnc -nopw -display :99 -forever -shared & + +# Start Playwright MCP +uvx mcpo --port 3902 -- npx -y @playwright/mcp@latest --no-sandbox +EOF + +RUN chmod +x /playwright-start.sh + +CMD ["/playwright-start.sh"]