agentleFS
robmclartyrobmclarty/trailhead/.claude/skills/add-browser-mcp/SKILL.md

add-browser-mcp

Skill0 starsChanged 7 months agoMITView on GitHub

Register a browser-control MCP server in .mcp.json. Use when Claude needs to drive a real browser — visual regression review, scraping, interactive UX checks, or pairing with add-visual-linting. Offers Playwright MCP (default, local) or Vercel agent-browser (remote); the caller chooses.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read .mcp.json: If it doesn't exist, create it with an empty mcpServers object.

    line 35
  2. Very specific:

    Validate JSON: Read .mcp.json back after the edit.

    line 62
  3. Very specific:

    Server fails to start silently: run pnpm dlx @playwright/mcp@latest --help (or the Vercel equivalent) directly in a terminal to surface the …

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

add-browser-mcp

Adds a browser-driving MCP server to the project's .mcp.json. Pairs well with add-visual-linting (the visual presets get their Playwright runner; this skill gives the model a browser for live inspection).

When to use this skill

  • You (the model) need to open pages, take screenshots, or inspect a running app
  • The user is pairing with add-visual-linting and wants Claude to author Playwright tests by exploring the app first
  • The repo currently has no browser MCP registered

When NOT to use this skill

  • The task is CLI-only — don't pull in browser infrastructure to run a script
  • An MCP server already provides this capability — check .mcp.json before registering a second one

The two options

ServerWhen to pickTrade-offs
Playwright MCPDefault. Local Chromium driven through Playwright protocol.Requires local browser install; fastest loop.
Vercel agent-browserRemote hosted browser; nothing installed locally.Needs API key; network hop; costs per session.

Pick Playwright unless the target environment can't run Chromium (sandboxed CI, low-RAM dev container) or the user has expressed a preference.

Steps

  1. Ask which option unless the user already said. Playwright is the default.
  2. Read .mcp.json. If it doesn't exist, create it with an empty mcpServers object.
  3. Add the entry. Append under mcpServers:

    For Playwright MCP:

    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    }

    For Vercel agent-browser:

    "agent-browser": {
      "command": "npx",
      "args": ["-y", "@vercel/agent-browser-mcp"],
      "env": {
        "VERCEL_AGENT_BROWSER_API_KEY": "${VERCEL_AGENT_BROWSER_API_KEY}"
      }
    }
  4. Install prerequisites.
    • Playwright: pnpm dlx playwright install chromium (once per machine). The MCP server will not launch without a browser.
    • Vercel: document VERCEL_AGENT_BROWSER_API_KEY in the app's .env.example. Do not commit the real key.
  5. Validate JSON. Read .mcp.json back after the edit. It must parse; a broken MCP config blocks all MCP tools, not just the new one.
  6. Remind the user to reload. Claude Code picks up .mcp.json changes at session start. The user may need to restart the session or re-invoke Claude Code for the new tools to appear.

After registration

Once the server is live, it exposes tools like browser_navigate, browser_take_screenshot, browser_snapshot, and (for Playwright) browser_generate_playwright_test. Allow these in skills that need them — the add-visual-linting skill, for example, can use browser_snapshot to bootstrap a visual regression baseline.

Troubleshooting

  • Server fails to start silently: run pnpm dlx @playwright/mcp@latest --help (or the Vercel equivalent) directly in a terminal to surface the real error.
  • Server starts but has no tools: Claude Code caches MCP tool lists; restart the session.
  • Playwright complains about missing browsers: pnpm dlx playwright install chromium.
  • Vercel returns 401: the env var didn't reach the server. Check that the shell that launches Claude Code has VERCEL_AGENT_BROWSER_API_KEY exported.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.