feat(mcp): add playwright preset to hermes mcp add - #19768
Closed
ygd58 wants to merge 1 commit into
Closed
Conversation
Adds a built-in 'playwright' preset for @playwright/mcp that auto-configures for common server/VPS environments: - Falls back to --browser chromium when /opt/google/chrome/chrome is absent (clean VPS installs without system Chrome) - Injects --no-sandbox when running as root (Docker/VPS) - Injects --no-sandbox when AppArmor userns restrictions are active (Ubuntu 23.10+, systemd-confined environments) Usage: hermes mcp add browser --preset playwright Dropped from NousResearch#15771 salvage (feature vs bug fix scope). Follows up on NousResearch#19747.
teknium1
reviewed
Jul 12, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for splitting the preset from the browser bug fix, as requested in the #15771 discussion.
Problems
hermes_cli/mcp_config.py:44treats every system except one Linux Chrome location as missing Chrome. Current browser detection intentionally covers explicit paths, PATH commands, Playwright caches (tools/browser_tool.py:4435-4490), and Windows/Linux candidates (hermes_cli/browser_connect.py:29-75).- Current main has a
codexpreset athermes_cli/mcp_config.py:36-41; the PR's replacement mapping contains onlyplaywright, so salvage must retain both entries. - Please add preset tests in
tests/hermes_cli/test_mcp_config.pyand update the built-in-presets table inwebsite/docs/user-guide/features/mcp.md:342-364.
Suggested changes
- Use a platform-aware browser resolution strategy (or the upstream standard command) instead of the single
/optprobe, then cover root/AppArmor and non-/optcases in tests.
Automated hermes-sweeper review.
| args = ["-y", "@playwright/mcp@latest", "--headless"] | ||
|
|
||
| # Detect missing system Chrome and fall back to bundled chromium | ||
| if not _os.path.exists("/opt/google/chrome/chrome"): |
Contributor
There was a problem hiding this comment.
This checks only one Linux Chrome path, so it classifies normal PATH installs, /usr/bin installs, macOS, and Windows browsers as absent. Please use a platform-aware resolver (or avoid overriding Playwright MCP's default browser choice) and add coverage for a system browser outside /opt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a built-in playwright preset for @playwright/mcp that auto-configures for common server/VPS environments.
Usage: hermes mcp add browser --preset playwright
Auto-detects:
Dropped from #15771 salvage (#19747) as a feature rather than a bug fix. @teknium1 suggested pushing it as a separate PR.