Skip to content

feat(mcp): add playwright preset to hermes mcp add - #19768

Closed
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:feat/playwright-mcp-preset
Closed

feat(mcp): add playwright preset to hermes mcp add#19768
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:feat/playwright-mcp-preset

Conversation

@ygd58

@ygd58 ygd58 commented May 4, 2026

Copy link
Copy Markdown
Contributor

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:

  • Missing system Chrome -> falls back to --browser chromium
  • Running as root -> injects --no-sandbox
  • AppArmor userns restrictions (Ubuntu 23.10+) -> injects --no-sandbox

Dropped from #15771 salvage (#19747) as a feature rather than a bug fix. @teknium1 suggested pushing it as a separate PR.

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.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard tool/mcp MCP client and OAuth labels May 4, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for splitting the preset from the browser bug fix, as requested in the #15771 discussion.

Problems

  • hermes_cli/mcp_config.py:44 treats 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 codex preset at hermes_cli/mcp_config.py:36-41; the PR's replacement mapping contains only playwright, so salvage must retain both entries.
  • Please add preset tests in tests/hermes_cli/test_mcp_config.py and update the built-in-presets table in website/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 /opt probe, then cover root/AppArmor and non-/opt cases in tests.

Automated hermes-sweeper review.

Comment thread hermes_cli/mcp_config.py
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"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 12, 2026
@ygd58 ygd58 closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data tool/mcp MCP client and OAuth type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants