Skip to content

feat: add Playwright MCP auto-setup to setup.sh#150

Merged
marcusquinn merged 4 commits intomainfrom
feature/playwright-mcp-setup
Jan 24, 2026
Merged

feat: add Playwright MCP auto-setup to setup.sh#150
marcusquinn merged 4 commits intomainfrom
feature/playwright-mcp-setup

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

@marcusquinn marcusquinn commented Jan 22, 2026

Summary

  • Add Playwright MCP installation to setup_browser_tools() function in setup.sh
  • Check for existing Playwright installation before prompting user
  • Install browsers (chromium, firefox, webkit) via npx playwright install
  • Update browser tools summary to include Playwright

Changes

  • setup.sh: Added Playwright MCP setup section with:

    • Version check for existing installation
    • User prompt for installation
    • Browser installation via npx
    • Info about running via npx playwright-mcp@latest
  • TODO.md: Marked t006 as complete

Testing

The setup can be tested by running:

./setup.sh --interactive

And selecting "Setup browser automation tools" when prompted.

Closes t006

Summary by CodeRabbit

  • Chores
    • Integrated conditional Playwright auto-setup into the installer with prompts to install browsers when prerequisites are present
    • Added checks for existing Playwright installation and guidance on installation failures
    • Updated displayed tooling list to include Playwright (testing)
    • Marked the related setup task as completed in project tracking

✏️ Tip: You can customize this high-level summary in your review settings.

- Add Playwright MCP installation to setup_browser_tools() function
- Check for existing Playwright installation before prompting
- Install browsers (chromium, firefox, webkit) via npx playwright install
- Update browser tools summary to include Playwright
- Mark t006 as complete in TODO.md

Closes #t006
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the development environment setup by integrating Playwright MCP into the setup.sh script. It automates the installation of Playwright and its associated browsers, providing a streamlined and interactive process for users to set up browser automation tools. This change aims to simplify the initial configuration for projects requiring browser testing capabilities.

Highlights

  • Playwright MCP Integration: The setup.sh script now includes an automated setup process for Playwright MCP within the setup_browser_tools function.
  • Intelligent Installation: The script checks for an existing Playwright installation and interactively prompts the user before proceeding with the installation of browsers (Chromium, Firefox, WebKit).
  • TODO List Update: The TODO.md file has been updated to mark task t006 (Add Playwright MCP auto-setup) as complete, including notes on the implementation details.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 22, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The TODO.md entry t006 is marked done with duration and notes. setup.sh's setup_browser_tools now conditionally initializes Playwright MCP when Bun/Node is present, prompts the user to install Playwright browsers, checks for existing installation, and runs installation via npx if approved.

Changes

Cohort / File(s) Change Summary
Task Documentation
TODO.md
Marked task t006 (Playwright MCP auto-setup) as complete; added actual duration, completion metadata, and Notes describing the install check, user prompt, and npx playwright install flow.
Playwright MCP Integration
setup.sh
In setup_browser_tools, added conditional Playwright MCP setup when Bun/Node present: checks for existing Playwright (npx --no-install playwright), prompts user to install browsers, runs npx playwright install on consent, handles failures with guidance, and updates displayed browser-tools messaging to include Playwright.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🎭 A prompt, a check, the browsers fall in line,
npx hums softly, setup now in time.
TODO flipped to Done, the scripts align,
Playwright wakes — CI smiles, all is fine.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding Playwright MCP auto-setup functionality to setup.sh, which is the primary focus of this pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds an automated setup for Playwright MCP to the setup.sh script. The changes are generally good, but I've identified a few issues that affect correctness and user experience. The check for an existing Playwright installation is unreliable and can lead to a state where necessary browser binaries are missing. Additionally, the user prompt for installation is case-sensitive, and the installation process itself suppresses all output, which would make the script appear to hang and would hide any potential errors. I've provided suggestions to address these points.

setup.sh Outdated
Comment on lines +2224 to +2225
if npx playwright --version &> /dev/null 2>&1; then
print_success "Playwright already installed"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current check npx playwright --version only verifies if the playwright npm package is available, not if the browser binaries are actually installed. This can lead to a false positive, where the script reports "Playwright already installed" but the necessary browsers are missing, and the user is never prompted to install them. This is particularly confusing since the comment on line 2223 states the check is for installed browsers.

A more reliable approach would be to check for the existence of the browser files themselves. While the browser path can be customized, checking the default cache directory is a much better heuristic.

Suggested change
if npx playwright --version &> /dev/null 2>&1; then
print_success "Playwright already installed"
# Check if Playwright browsers are installed by checking the default cache dir
if [ -d "$HOME/.cache/ms-playwright" ] && [ -n "$(ls -A "$HOME/.cache/ms-playwright" 2>/dev/null)" ]; then
print_success "Playwright browsers appear to be installed"

setup.sh Outdated

if [[ "$install_playwright" == "y" ]]; then
print_info "Installing Playwright browsers..."
if npx playwright install 2>/dev/null; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The command npx playwright install has its standard error redirected to /dev/null. This is not ideal for a few reasons:

  1. Hides progress: playwright install shows download progress for browsers, which can take time and a lot of bandwidth. Without this output, the script will appear to be frozen to the user.
  2. Hides errors: If the installation fails, any error messages will be hidden, making it impossible for the user to diagnose the problem. The script will just print a generic "installation failed" message.

It would be much more user-friendly to let the command print its output to the terminal.

Suggested change
if npx playwright install 2>/dev/null; then
if npx playwright install; then

else
read -r -p "Install Playwright MCP with browsers (chromium, firefox, webkit)? (y/n): " install_playwright

if [[ "$install_playwright" == "y" ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check for user input if [[ "$install_playwright" == "y" ]] is case-sensitive and will not accept 'Y' as an answer. For better usability, it's good practice to handle both uppercase and lowercase responses, which is also more consistent with other interactive prompts in this script.

Suggested change
if [[ "$install_playwright" == "y" ]]; then
if [[ "$install_playwright" =~ ^[Yy]$ ]]; then

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 353 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Thu Jan 22 01:40:11 UTC 2026: Code review monitoring started
Thu Jan 22 01:40:16 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 353
Thu Jan 22 01:40:17 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Thu Jan 22 01:40:19 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 353
  • VULNERABILITIES: 0

Generated on: Thu Jan 22 01:41:34 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Jan 22, 2026

🤖 Augment PR Summary

Summary: Adds Playwright MCP auto-setup steps to the installer to make browser automation tooling easier to enable.

Changes:

  • Extends setup_browser_tools() to detect Playwright and optionally install its browsers via npx playwright install
  • Emits guidance on running the Playwright MCP server via npx playwright-mcp@latest
  • Updates the browser tools status line to include Playwright
  • Marks task t006 complete in TODO.md

Technical Notes: The setup relies on Node.js being present and uses npx to invoke Playwright tooling.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

setup.sh Outdated
print_info "Setting up Playwright MCP..."

# Check if Playwright browsers are installed
if npx playwright --version &> /dev/null 2>&1; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using npx playwright --version as an “already installed” check may still download/run Playwright even when it isn’t installed locally, which can incorrectly skip the npx playwright install path. Consider a no-install check (e.g., npx --no-install) or checking for an installed playwright binary so this behaves deterministically.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

if npx playwright --version &> /dev/null 2>&1; then
print_success "Playwright already installed"
else
read -r -p "Install Playwright MCP with browsers (chromium, firefox, webkit)? (y/n): " install_playwright
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This read -r -p prompt can block non-interactive runs: confirm_step returns success when INTERACTIVE_MODE != true, so setup_browser_tools may run unattended and hang here. Consider gating this prompt behind INTERACTIVE_MODE (or defaulting to skip/install without prompting) to keep non-interactive setups from stalling.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

setup.sh Outdated
print_info "Playwright MCP runs via: npx playwright-mcp@latest"
fi

print_info "Browser tools: dev-browser (stateful), Playwriter (extension), Playwright (testing), Stagehand (AI)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The final “Browser tools” summary always includes Playwright (testing) even when Node.js is missing and the Playwright setup block is skipped. Consider making this summary conditional (or noting dependencies) so the output reflects what was actually available/installed.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@setup.sh`:
- Around line 2223-2235: Replace the presence check "npx playwright --version"
with "npx --no-install playwright --version" so npx won't auto-download; declare
the prompt variable as local (local install_playwright) where it's read; and
ensure the surrounding function (the Playwright install check block) ends with
an explicit return statement (e.g., return or return 0) to satisfy the shell
coding guidelines—look for the read -r -p line that sets install_playwright and
the Playwright check invocation to apply these changes.
🧹 Nitpick comments (1)
setup.sh (1)

2227-2247: Declare the prompt variable locally and return explicitly.

install_playwright is introduced without local, and the function still relies on implicit exit status. Please localize the variable and add an explicit return 0 to keep the shell hygiene consistent.

♻️ Suggested refactor
-            read -r -p "Install Playwright MCP with browsers (chromium, firefox, webkit)? (y/n): " install_playwright
+            local install_playwright
+            read -r -p "Install Playwright MCP with browsers (chromium, firefox, webkit)? (y/n): " install_playwright
@@
-    print_info "Browser tools: dev-browser (stateful), Playwriter (extension), Playwright (testing), Stagehand (AI)"
+    print_info "Browser tools: dev-browser (stateful), Playwriter (extension), Playwright (testing), Stagehand (AI)"
+    return 0
As per coding guidelines, please keep shell locals and explicit returns consistent.

- Use npx --no-install to prevent auto-download during version check
- Declare install_playwright as local variable
- Add explicit return 0 at end of setup_browser_tools()
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 24 03:11:25 UTC 2026: Code review monitoring started
Sat Jan 24 03:11:26 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Sat Jan 24 03:11:26 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 24 03:11:28 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Sat Jan 24 03:12:44 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

- Remove 2>/dev/null from npx playwright install to show download progress
- Make browser tools summary conditional on Node.js availability
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 24 03:14:57 UTC 2026: Code review monitoring started
Sat Jan 24 03:14:58 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Sat Jan 24 03:14:58 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 24 03:15:00 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Sat Jan 24 03:16:15 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

- playwright.md: Add installation section with setup.sh reference, MCP config
- README.md: Note auto-install in MCP table and browser category
- browser-automation.md: Update install method to reference setup.sh
- onboarding-helper.sh: Use --no-install flag for consistent version check
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 24 03:20:19 UTC 2026: Code review monitoring started
Sat Jan 24 03:20:20 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Sat Jan 24 03:20:20 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 24 03:20:22 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Sat Jan 24 03:21:29 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 7a1b4f3 into main Jan 24, 2026
8 of 9 checks passed
@marcusquinn marcusquinn deleted the feature/playwright-mcp-setup branch February 21, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant