feat(mcp): add playwright preset to hermes mcp add - #63771
Closed
ygd58 wants to merge 2 commits into
Closed
Conversation
Adds @playwright/mcp to the built-in MCP preset registry alongside the existing codex preset (issue NousResearch#19760). Key design decisions (addressing maintainer review of PR NousResearch#19768): - codex preset is preserved; both entries coexist in _MCP_PRESETS - _playwright_browser_args() uses platform-aware detection via shutil.which() across the common Chrome/Chromium binary names (google-chrome, google-chrome-stable, chromium-browser, chromium, chrome) instead of a single /opt/google/chrome/chrome path that would misclassify PATH installs, /usr/bin installs, snap packages, macOS, and Windows as 'browser absent' - --no-sandbox added only on Linux when euid==0 (root/VPS/Docker) - --browser=chromium fallback added only when NO system browser is found on the current PATH (so default Playwright behavior is preserved for normal user installs) 7 tests in TestPlaywrightMcpPreset: - playwright registered alongside codex - preset uses npx command - --no-sandbox on Linux root - --no-sandbox NOT added on macOS - --browser=chromium added when no system browser found - --browser=chromium NOT added when google-chrome on PATH - /usr/bin/chromium-browser also counts as system browser Fixes NousResearch#19760
Documents the new playwright preset in the built-in-presets table at website/docs/user-guide/features/mcp.md, including the root/VPS --no-sandbox behavior and the Playwright bundled Chromium fallback.
teknium1
reviewed
Jul 16, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for preserving the existing codex preset and adding focused tests and MCP documentation.
Problems
hermes_cli/mcp_config.py:68only usesshutil.which()to decide whether a browser exists. That still misses standard macOS app bundles and Windows install directories; current main'shermes_cli/browser_connect.py:22-124explicitly checks those platform locations. The forced fallback can therefore change behavior for ordinary non-PATH browser installs.- The PR body says
Fixes #19760, but #19760 is the closed NixnpmDepsHashreport, not a Playwright MCP request.
Suggested changes
- Use an equivalent platform-aware resolver (and add macOS/Windows non-PATH tests), or retain the upstream standard
npx @playwright/mcp@latestarguments rather than forcing a browser choice. - Correct the issue linkage.
Automated hermes-sweeper review.
| "chromium-browser", "chromium", | ||
| "chrome", | ||
| ) | ||
| _found_system_browser = any(shutil.which(name) for name in _chrome_names) |
Contributor
There was a problem hiding this comment.
shutil.which() alone still reports no browser for standard macOS app-bundle installs and Windows install locations. hermes_cli/browser_connect.py:22-124 covers those paths; use equivalent platform-aware detection (with macOS/Windows regressions), or avoid forcing the fallback.
Contributor
Author
ygd58
added a commit
to ygd58/hermes-agent
that referenced
this pull request
Jul 22, 2026
…eset Per teknium1's review of NousResearch#63771 ('add macOS/Windows non-PATH tests'), only the macOS .app-bundle case was added. Add the matching Windows standard-install-directory case, confirming the platform-aware get_chrome_debug_candidates() resolver -- not a bare shutil.which() name list -- is what determines browser availability on Windows too. 68/68 tests pass in tests/hermes_cli/test_mcp_config.py.
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.
Problem
hermes mcp add had no playwright preset (issue #19760). Previous PR #19768 added it but used a single /opt/google/chrome path check (classifying PATH installs, /usr/bin, macOS, Windows as browser absent) and dropped the codex preset.
Fix
Verification
7 tests in TestPlaywrightMcpPreset: preset registered, npx command, --no-sandbox on Linux root, not on macOS, chromium fallback when absent, no fallback when found, /usr/bin/chromium-browser counts. 7/7 pass.
Fixes #19760