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
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-packageSkill
- add-visual-lintingSkill
- mine-ast-grep-rulesSkill
- post-friction-lessonSkill
- propose-ast-grep-ruleSkill
- versionSkill
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
- Very specific: line 35
Read
.mcp.json: If it doesn't exist, create it with an empty mcpServers object. - Very specific: line 62
Validate JSON: Read .mcp.json back after the edit.
- Very specific: line 72
Server fails to start silently: run pnpm dlx @playwright/mcp@latest --help (or the Vercel equivalent) directly in a terminal to surface the …
≈ “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.
Files
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-lintingand 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.jsonbefore registering a second one
The two options
| Server | When to pick | Trade-offs |
| Playwright MCP | Default. Local Chromium driven through Playwright protocol. | Requires local browser install; fastest loop. |
| Vercel agent-browser | Remote 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
- Ask which option unless the user already said. Playwright is the default.
- Read
.mcp.json. If it doesn't exist, create it with an emptymcpServersobject. 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}" } }- 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_KEYin the app's.env.example. Do not commit the real key.
- Playwright:
- Validate JSON. Read
.mcp.jsonback after the edit. It must parse; a broken MCP config blocks all MCP tools, not just the new one. - Remind the user to reload. Claude Code picks up
.mcp.jsonchanges 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_KEYexported.
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
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.

