Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 15 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@ 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"

# Execute @playwright/mcp using npx, passing arguments ($@)
exec npx @playwright/mcp@0.0.7 $MCP_ARGS "$@"
exec npx @playwright/mcp $MCP_ARGS "$@"