From bd1ab1157285f1c50839eb85138ef01829597a29 Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:47:11 +0000 Subject: [PATCH 1/9] Playwright Docker checkpoint: 1 --- container/Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/container/Dockerfile b/container/Dockerfile index 756bce1c4..80a2409c5 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -115,6 +115,30 @@ RUN apt-get update && apt-get install -y \ locales \ && rm -rf /var/lib/apt/lists/* +# Install Playwright system dependencies +RUN apt-get update && apt-get install -y \ + libnss3 \ + libnspr4 \ + libatk1.0-0 \ + libatk-bridge2.0-0 \ + libcups2 \ + libdrm2 \ + libdbus-1-3 \ + libatspi2.0-0 \ + libx11-6 \ + libxcomposite1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxrandr2 \ + libgbm1 \ + libxcb1 \ + libxkbcommon0 \ + libpango-1.0-0 \ + libcairo2 \ + libasound2 \ + && rm -rf /var/lib/apt/lists/* + # Install GitHub CLI RUN mkdir -p -m 755 /etc/apt/keyrings && \ wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null && \ From 45d5ee18d7d6c6ff671cd3e66825c4548b877f68 Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:47:41 +0000 Subject: [PATCH 2/9] Playwright Docker checkpoint: 2 --- container/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index 80a2409c5..47274fb87 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -314,11 +314,11 @@ RUN chmod +x /usr/local/bin/generate-banner.sh && \ touch /home/catnip/.sudo_as_admin_successful && \ chown catnip:catnip /home/catnip/.sudo_as_admin_successful -# Install Claude Code and Gemini CLI as catnip user (not root) +# Install Claude Code, Gemini CLI, and Playwright MCP server as catnip user (not root) USER catnip RUN bash -c 'source /etc/profile.d/catnip.sh && \ source "$NVM_DIR/nvm.sh" && \ - npm install -g @anthropic-ai/claude-code @google/gemini-cli && \ + npm install -g @anthropic-ai/claude-code @google/gemini-cli @playwright/mcp-server && \ VSIX_PATH="$(npm root -g)/@anthropic-ai/claude-code/vendor/claude-code.vsix" && \ if [ -f "$VSIX_PATH" ]; then \ echo "Installing Claude Code extension from: $VSIX_PATH" && \ From 7e6e2e8be05339fffdfb738f2343d6b0c9a177be Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:47:51 +0000 Subject: [PATCH 3/9] Playwright Docker checkpoint: 1 --- container/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/container/Dockerfile b/container/Dockerfile index 47274fb87..6f895394c 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -327,6 +327,11 @@ RUN bash -c 'source /etc/profile.d/catnip.sh && \ echo "Warning: Claude Code VSIX not found at $VSIX_PATH"; \ fi' +# Install Playwright browsers (chromium) as catnip user +RUN bash -c 'source /etc/profile.d/catnip.sh && \ + source "$NVM_DIR/nvm.sh" && \ + npx playwright install chromium' + # Set global git config for catnip user, these get overridden by the entrypoint script RUN git config --global user.name "catnip" && \ git config --global user.email "catnip@catnip.run" && \ From f13fd6d276a20d0d0a04e0a45a365c804586472c Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:48:51 +0000 Subject: [PATCH 4/9] Playwright Docker checkpoint: 2 --- container/setup/.mcp.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 container/setup/.mcp.json diff --git a/container/setup/.mcp.json b/container/setup/.mcp.json new file mode 100644 index 000000000..95b82e8c2 --- /dev/null +++ b/container/setup/.mcp.json @@ -0,0 +1,16 @@ +{ + "mcpServers": { + "playwright": { + "command": "npx", + "args": [ + "-y", + "@playwright/mcp-server", + "--headless", + "--browser", + "chromium", + "--no-sandbox" + ], + "env": {} + } + } +} From 325615904e038686f4c398fd33c9a74c4cd6525f Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:49:11 +0000 Subject: [PATCH 5/9] Playwright Docker checkpoint: 3 --- container/Dockerfile | 3 ++- container/setup/entrypoint.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/container/Dockerfile b/container/Dockerfile index 6f895394c..de775d331 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -343,9 +343,10 @@ USER root -# Copy and set up entrypoint script +# Copy and set up entrypoint script and MCP configuration COPY container/setup/entrypoint.sh /entrypoint.sh COPY container/setup/setup-truecolor.sh /usr/local/bin/setup-truecolor.sh +COPY container/setup/.mcp.json /opt/catnip/setup/.mcp.json RUN chmod +x /entrypoint.sh && \ chmod +x /usr/local/bin/setup-truecolor.sh && \ /usr/local/bin/setup-truecolor.sh diff --git a/container/setup/entrypoint.sh b/container/setup/entrypoint.sh index 891d5a499..741127480 100644 --- a/container/setup/entrypoint.sh +++ b/container/setup/entrypoint.sh @@ -47,6 +47,12 @@ for config_dir in .ssh .aws .config .local .cargo .rustup; do fi done +# Copy MCP configuration for Claude Code if it exists +if [ -f "/opt/catnip/setup/.mcp.json" ]; then + echo "📋 Setting up MCP server configuration for Claude Code" + gosu 1000:1000 cp /opt/catnip/setup/.mcp.json /home/catnip/.mcp.json +fi + # Set git config for the catnip user (not root) and mark as safe repo gosu 1000:1000 git config --global user.name "$GIT_USERNAME" gosu 1000:1000 git config --global user.email "$GIT_EMAIL" From 7220a8753d53ca818fbe29fac46a9bd47aa86fb2 Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:49:51 +0000 Subject: [PATCH 6/9] Playwright Docker checkpoint: 3 --- container/setup/test-playwright-mcp.sh | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 container/setup/test-playwright-mcp.sh diff --git a/container/setup/test-playwright-mcp.sh b/container/setup/test-playwright-mcp.sh new file mode 100755 index 000000000..4b94684b8 --- /dev/null +++ b/container/setup/test-playwright-mcp.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Test script to verify Playwright MCP server installation + +echo "🔍 Testing Playwright MCP server installation..." + +# Check if @playwright/mcp-server is installed +echo "📦 Checking npm package installation..." +if npm list -g @playwright/mcp-server >/dev/null 2>&1; then + echo "✅ @playwright/mcp-server is installed globally" +else + echo "❌ @playwright/mcp-server is NOT installed" + exit 1 +fi + +# Check if chromium browser is installed +echo "🌐 Checking Chromium browser installation..." +if npx playwright show-browsers 2>&1 | grep -q "chromium"; then + echo "✅ Chromium browser is installed" +else + echo "❌ Chromium browser is NOT installed" + exit 1 +fi + +# Check if MCP configuration exists +echo "📋 Checking MCP configuration..." +if [ -f "$HOME/.mcp.json" ]; then + echo "✅ MCP configuration found at $HOME/.mcp.json" + echo "📄 Configuration content:" + cat "$HOME/.mcp.json" | jq . 2>/dev/null || cat "$HOME/.mcp.json" +else + echo "❌ MCP configuration not found at $HOME/.mcp.json" + exit 1 +fi + +# Try to start the MCP server briefly +echo "🚀 Testing MCP server startup..." +timeout 5s npx -y @playwright/mcp-server --headless --browser chromium --no-sandbox >/dev/null 2>&1 +EXIT_CODE=$? + +# Exit code 124 means timeout (which is expected) +if [ $EXIT_CODE -eq 124 ]; then + echo "✅ MCP server started successfully (timed out as expected)" +elif [ $EXIT_CODE -eq 0 ]; then + echo "✅ MCP server started and exited successfully" +else + echo "❌ MCP server failed to start (exit code: $EXIT_CODE)" + exit 1 +fi + +echo "🎉 All tests passed! Playwright MCP server is properly installed." \ No newline at end of file From 63b08ac0a0da3fc5ecbd9b47bab1d674b876f330 Mon Sep 17 00:00:00 2001 From: vanpelt Date: Sun, 3 Aug 2025 23:50:45 +0000 Subject: [PATCH 7/9] Script Removal checkpoint: 1 --- container/setup/test-playwright-mcp.sh | 50 -------------------------- 1 file changed, 50 deletions(-) delete mode 100755 container/setup/test-playwright-mcp.sh diff --git a/container/setup/test-playwright-mcp.sh b/container/setup/test-playwright-mcp.sh deleted file mode 100755 index 4b94684b8..000000000 --- a/container/setup/test-playwright-mcp.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Test script to verify Playwright MCP server installation - -echo "🔍 Testing Playwright MCP server installation..." - -# Check if @playwright/mcp-server is installed -echo "📦 Checking npm package installation..." -if npm list -g @playwright/mcp-server >/dev/null 2>&1; then - echo "✅ @playwright/mcp-server is installed globally" -else - echo "❌ @playwright/mcp-server is NOT installed" - exit 1 -fi - -# Check if chromium browser is installed -echo "🌐 Checking Chromium browser installation..." -if npx playwright show-browsers 2>&1 | grep -q "chromium"; then - echo "✅ Chromium browser is installed" -else - echo "❌ Chromium browser is NOT installed" - exit 1 -fi - -# Check if MCP configuration exists -echo "📋 Checking MCP configuration..." -if [ -f "$HOME/.mcp.json" ]; then - echo "✅ MCP configuration found at $HOME/.mcp.json" - echo "📄 Configuration content:" - cat "$HOME/.mcp.json" | jq . 2>/dev/null || cat "$HOME/.mcp.json" -else - echo "❌ MCP configuration not found at $HOME/.mcp.json" - exit 1 -fi - -# Try to start the MCP server briefly -echo "🚀 Testing MCP server startup..." -timeout 5s npx -y @playwright/mcp-server --headless --browser chromium --no-sandbox >/dev/null 2>&1 -EXIT_CODE=$? - -# Exit code 124 means timeout (which is expected) -if [ $EXIT_CODE -eq 124 ]; then - echo "✅ MCP server started successfully (timed out as expected)" -elif [ $EXIT_CODE -eq 0 ]; then - echo "✅ MCP server started and exited successfully" -else - echo "❌ MCP server failed to start (exit code: $EXIT_CODE)" - exit 1 -fi - -echo "🎉 All tests passed! Playwright MCP server is properly installed." \ No newline at end of file From 63f870975eb831333e5407cd028e065ab9b9f909 Mon Sep 17 00:00:00 2001 From: vanpelt Date: Mon, 4 Aug 2025 02:34:21 +0000 Subject: [PATCH 8/9] Docker Package checkpoint: 1 --- container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/Dockerfile b/container/Dockerfile index de775d331..d65886721 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -136,7 +136,7 @@ RUN apt-get update && apt-get install -y \ libxkbcommon0 \ libpango-1.0-0 \ libcairo2 \ - libasound2 \ + libasound2t64 \ && rm -rf /var/lib/apt/lists/* # Install GitHub CLI From 2d99d04bb4cd17fca6bd02604a8f08731e2bc511 Mon Sep 17 00:00:00 2001 From: vanpelt Date: Mon, 4 Aug 2025 02:45:58 +0000 Subject: [PATCH 9/9] Package Name checkpoint: 1 --- container/Dockerfile | 2 +- container/setup/.mcp.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index d65886721..1ab39b6d8 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -318,7 +318,7 @@ RUN chmod +x /usr/local/bin/generate-banner.sh && \ USER catnip RUN bash -c 'source /etc/profile.d/catnip.sh && \ source "$NVM_DIR/nvm.sh" && \ - npm install -g @anthropic-ai/claude-code @google/gemini-cli @playwright/mcp-server && \ + npm install -g @anthropic-ai/claude-code @google/gemini-cli @playwright/mcp && \ VSIX_PATH="$(npm root -g)/@anthropic-ai/claude-code/vendor/claude-code.vsix" && \ if [ -f "$VSIX_PATH" ]; then \ echo "Installing Claude Code extension from: $VSIX_PATH" && \ diff --git a/container/setup/.mcp.json b/container/setup/.mcp.json index 95b82e8c2..965c72359 100644 --- a/container/setup/.mcp.json +++ b/container/setup/.mcp.json @@ -4,7 +4,7 @@ "command": "npx", "args": [ "-y", - "@playwright/mcp-server", + "@playwright/mcp", "--headless", "--browser", "chromium",