Skip to content

Update Playwright MCP server to use official Docker image#4876

Merged
pelikhan merged 11 commits into
mainfrom
copilot/update-playwright-server-config
Nov 26, 2025
Merged

Update Playwright MCP server to use official Docker image#4876
pelikhan merged 11 commits into
mainfrom
copilot/update-playwright-server-config

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 26, 2025

Switches Playwright MCP server configuration from running via npx directly to using the official Microsoft Playwright MCP Docker image (mcr.microsoft.com/playwright/mcp) for consistent browser environment.

Changes

  • mcp-config.go: Updated renderPlaywrightMCPConfigWithOptions and renderPlaywrightMCPConfigTOML to use Docker
  • mcp_renderer.go: Updated renderPlaywrightTOML to use Docker
  • docker.go: Added Playwright image to collectDockerImages for predownloading
  • Tests: Updated all Playwright-related tests to expect Docker commands

Generated Configuration

Before:

{
  "playwright": {
    "command": "npx",
    "args": ["@playwright/mcp@0.0.48", "--output-dir", "/tmp/gh-aw/mcp-logs/playwright"]
  }
}

After:

{
  "playwright": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "--init", "mcr.microsoft.com/playwright/mcp", "--output-dir", "/tmp/gh-aw/mcp-logs/playwright", "--allowed-hosts", "localhost;localhost:*;127.0.0.1;127.0.0.1:*"]
  }
}

Implementation Details

  • Uses unversioned Docker image (mcr.microsoft.com/playwright/mcp) as there is only one image available
  • Includes --init argument for proper signal handling
  • Preserves --output-dir flag for MCP logs
  • No --pull=always flag (image is predownloaded via docker pull step)
  • Docker image added to predownloaded images list for faster workflow startup

Uses the official Playwright MCP Docker image as documented in the Playwright MCP repository.

Note

The Docker implementation only supports headless Chromium at the moment.

Original prompt

Uodate playwright MCP server configuration generation to use docker image instead of npx.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 26, 2025 20:20
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Playwright MCP server configuration generation to use Docker image Update Playwright MCP server to use Docker container instead of npx Nov 26, 2025
Copilot AI requested a review from pelikhan November 26, 2025 20:40
@pelikhan pelikhan added the smoke label Nov 26, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

✅ Agentic Changeset Generator completed successfully.

@pelikhan
Copy link
Copy Markdown
Collaborator

See docs on using docker:

NOTE: The Docker implementation only supports headless chromium at the moment.

{
  "mcpServers": {
    "playwright": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--init", "--pull=always", "mcr.microsoft.com/playwright/mcp"]
    }
  }
}
Or If you prefer to run the container as a long-lived service instead of letting the MCP client spawn it, use:

docker run -d -i --rm --init --pull=always \
  --entrypoint node \
  --name playwright \
  -p 8931:8931 \
  mcr.microsoft.com/playwright/mcp \
  cli.js --headless --browser chromium --no-sandbox --port 8931
The server will listen on host port 8931 and can be reached by any MCP client.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot apply comment above

…t/mcp)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot apply comment above

Updated to use the official Playwright MCP Docker image (mcr.microsoft.com/playwright/mcp) with the correct Docker arguments (run -i --rm --init --pull=always) as per the documentation. Commit eacf2ff.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Update Playwright MCP server to use Docker container instead of npx Update Playwright MCP server to use official Docker image Nov 26, 2025
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot

  • keep versions in MCP and container image
  • keep output dir flag
  • make sure docker images is included in predownloaded docker images
  • no pull always

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot continue work

…lways

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot continue work

Completed the changes:

  • Versioned container image: mcr.microsoft.com/playwright/mcp:v1.57.0
  • Kept --output-dir /tmp/gh-aw/mcp-logs/playwright flag
  • Removed --pull=always
  • Added Playwright image to predownloaded images in collectDockerImages

Commit 7039f42.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan marked this pull request as ready for review November 26, 2025 22:35
@pelikhan pelikhan removed the smoke label Nov 26, 2025
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 26, 2025

@copilot Do not version the docker image, add --init argument.
See docs:

...

Removed the version tag from the Docker image. Now using mcr.microsoft.com/playwright/mcp without version suffix. The --init argument is already present. Commit f0271c1.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

✅ Agentic Changeset Generator completed successfully.

@github-actions
Copy link
Copy Markdown
Contributor

Agentic Smoke Codex triggered by this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

❌ Agentic Smoke Copilot failed and wasn't able to produce a result.

@github-actions
Copy link
Copy Markdown
Contributor

Agentic Smoke Claude triggered by this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

Claude Engine Smoke Test Results ✅

1. GitHub MCP Testing ✅

Successfully reviewed the last 2 merged pull requests:

PR #4890 - "Fix broken integration tests by stripping YAML comment header before assertions"

  • Merged: 2025-11-26T22:56:34Z
  • Fixed TestTopLevelGitHubTokenPrecedence and TestNeutralToolsIntegration by adding StripYAMLCommentHeader() helper to remove comment headers from compiled YAML before assertions

PR #4888 - "Add PR description conciseness guideline to AGENTS.md"

  • Merged: 2025-11-26T22:45:35Z (draft)
  • Added guidance that PR descriptions should be limited to 1-2 sentences in AGENTS.md Quick Reference

2. File Writing Testing ✅

Created test file: /tmp/smoke-test-claude-sonnet-4-5.txt

  • File content: Smoke test passed for Claude at $(date)
  • File creation confirmed successful

3. Bash Tool Testing ✅

Verified file creation using cat command:

  • File successfully read back
  • Content matches expected output

4. Playwright MCP Testing ✅

Navigated to https://github.com and verified:

  • Page URL: https://github.com/
  • Page Title: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub" ✅ (contains "GitHub")

Overall Smoke Test Status: PASSED

All four test categories completed successfully for Claude Sonnet 4.5 engine.

AI generated by Smoke Claude for #4876

@github-actions
Copy link
Copy Markdown
Contributor

Smoke test results for the Codex engine:

Overall: ✅ All Codex smoke-test checks succeeded.

AI generated by Smoke Codex for #4876

@github-actions
Copy link
Copy Markdown
Contributor

Agentic Smoke Claude triggered by this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

Agentic Smoke Codex triggered by this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

❌ Agentic Smoke Copilot failed and wasn't able to produce a result.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2025

✅ Agentic Changeset Generator completed successfully.

@pelikhan pelikhan merged commit b759207 into main Nov 26, 2025
38 of 40 checks passed
@pelikhan pelikhan deleted the copilot/update-playwright-server-config branch November 26, 2025 23:16
@github-actions
Copy link
Copy Markdown
Contributor

Claude Engine Smoke Test Results

Test Summary

All smoke tests passed successfully for the Claude engine (Sonnet 4.5).

Detailed Results

✅ 1. GitHub MCP Testing

Status: PASSED

Successfully reviewed the last 2 merged pull requests:

✅ 2. File Writing Testing

Status: PASSED

Successfully created test file at /tmp/smoke-test-claude-sonnet-4-5.txt with content:

Smoke test passed for Claude at Wed Nov 26 23:16:41 UTC 2025

✅ 3. Bash Tool Testing

Status: PASSED

Successfully verified file creation using cat command:

$ cat /tmp/smoke-test-claude-sonnet-4-5.txt
Smoke test passed for Claude at Wed Nov 26 23:16:41 UTC 2025

✅ 4. Playwright MCP Testing

Status: PASSED

Successfully navigated to https://github.com and verified page title:

  • Page Title: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub"
  • Verification: Page title contains "GitHub" ✓

Overall Status

🎉 All tests PASSED - Claude engine is functioning correctly!

AI generated by Smoke Claude for #4876

@github-actions
Copy link
Copy Markdown
Contributor

Codex smoke test results:

All checks passed — Codex engine smoke test SUCCESS

AI generated by Smoke Codex for #4876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants