From e0eae52ecbfcadd11dd809d0b2df81358d590b5b Mon Sep 17 00:00:00 2001 From: Vitali Date: Fri, 20 Jun 2025 11:36:55 -0400 Subject: [PATCH 1/2] feat: Update Playwright base image and package version in Dockerfile and entrypoint script --- Dockerfile | 4 ++-- entrypoint.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bee1af6..3a40be5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # Specify the base image (check for the latest tag and specify if preferred) -FROM mcr.microsoft.com/playwright:v1.51.1-noble +FROM mcr.microsoft.com/playwright:v1.53.1-noble # Set working directory (optional) WORKDIR /app # Install @playwright/mcp globally # RUN npm cache clean --force # Try this if you encounter caching issues -RUN npm install -g @playwright/mcp@0.0.7 +RUN npm install -g @playwright/mcp # Install Chrome browser and dependencies required by Playwright # Although the base image should include them, explicitly install in case MCP cannot find them diff --git a/entrypoint.sh b/entrypoint.sh index 00e0873..d587b10 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,4 +26,4 @@ echo "Starting @playwright/mcp with args: $MCP_ARGS $@" echo "Internal MCP port (if using SSE): $INTERNAL_PORT" # Execute @playwright/mcp using npx, passing arguments ($@) -exec npx @playwright/mcp@0.0.7 $MCP_ARGS "$@" +exec npx @playwright/mcp $MCP_ARGS "$@" From 056c4a955e1eaaec5ff65b4cb58359d0577b5c01 Mon Sep 17 00:00:00 2001 From: Vitali Date: Mon, 23 Jun 2025 09:35:31 -0400 Subject: [PATCH 2/2] feat: Enhance entrypoint script to support isolated and no-sandbox modes; update .env.sample for clarity --- .env.sample | 9 +++++++-- entrypoint.sh | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.env.sample b/.env.sample index 5c1406a..4ca9c7d 100644 --- a/.env.sample +++ b/.env.sample @@ -4,6 +4,12 @@ MCP_HOST_PORT=8931 # Set to true to run in headless mode HEADLESS=true +# Set to true to run in isolated mode (no access to host network, etc.) +ISOLATED=true + +# Set to true to run without sandboxing (useful for debugging) +NOSANDBOX=true + # --- Settings for headed mode (uncomment and modify as needed) --- # DISPLAY=:0 # WAYLAND_DISPLAY=wayland-0 @@ -16,5 +22,4 @@ HEADLESS=true # WAYLAND_DISPLAY=wayland-0 # XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir # X11_HOST_PATH=\\wsl.localhost\Ubuntu\tmp\.X11-unix # Example for Ubuntu distro -# WSLG_HOST_PATH=\\wsl.localhost\Ubuntu\mnt\wslg # Example for Ubuntu distro - +# WSLG_HOST_PATH=\\wsl.localhost\Ubuntu\mnt\wslg # Example for Ubuntu distro \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index d587b10..f35d8a3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,10 +17,20 @@ if [ -n "$MCP_PORT" ]; then MCP_ARGS="$MCP_ARGS --port $INTERNAL_PORT" fi -# Add other options if needed (e.g., --vision) -# if [ "$VISION_MODE" = "true" ]; then -# MCP_ARGS="$MCP_ARGS --vision" -# fi +Add other options if needed (e.g., --vision) +if [ "$VISION_MODE" = "true" ]; then + MCP_ARGS="$MCP_ARGS --vision" +fi + +# Add --isolated if ISOLATED environment variable is true +if [ "$ISOLATED" = "true" ]; then + MCP_ARGS="$MCP_ARGS --isolated" +fi + +# Add --no-sandbox if NOSANDBOX environment variable is true +if [ "$NOSANDBOX" = "true" ]; then + MCP_ARGS="$MCP_ARGS --no-sandbox" +fi echo "Starting @playwright/mcp with args: $MCP_ARGS $@" echo "Internal MCP port (if using SSE): $INTERNAL_PORT"