playwright-mcp

playwright-mcp is a skill for Claude Code from Razaib-khan/ForgeWeave. It costs 156 tokens per session (1,528 once invoked), scanned A, original, MIT.

A guide for using Playwright MCP, a tool that lets an AI agent control a real web browser through page structure and screenshots.

In plain words
What is it for?
Use it to navigate websites, fill forms, click controls, manage browser storage, take screenshots, mock responses, save login state, and create or record browser tests.
Why use it?
It gives browser tasks a repeatable way to inspect the current page, interact with it, and verify the result instead of guessing the page state.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to navigate websites, fill forms, click controls, manage browser storage, take screenshots, mock responses, save login state, and create or record browser tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/razaib-khan/forgeweave/playwright-mcp
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Razaib-khan/ForgeWeave --skill playwright-mcp
Clone the repo
git clone --depth 1 https://github.com/Razaib-khan/ForgeWeave

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-mcp

README.md
[![agentmods](https://agentmods.dev/badge/skills/razaib-khan/forgeweave/playwright-mcp/github.svg)](https://agentmods.dev/skills/razaib-khan/forgeweave/playwright-mcp)
Your own site
<a href="https://agentmods.dev/skills/razaib-khan/forgeweave/playwright-mcp"><img src="https://agentmods.dev/badge/skills/razaib-khan/forgeweave/playwright-mcp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-mcp

Your own site · 80×15
<a href="https://agentmods.dev/skills/razaib-khan/forgeweave/playwright-mcp"><img src="https://agentmods.dev/badge/skills/razaib-khan/forgeweave/playwright-mcp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 156 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,528 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00156 $0.01528
Opus 5 $0.00078 $0.00764
Sonnet 5 $0.00031 $0.00306
Haiku 4.5 $0.00016 $0.00153

Measured 8d ago against content hash cb35d94cefe9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

playwright-mcp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/forgeweave/templates/claude/.claude/skills/playwright-mcp/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Playwright MCP — AI Agent Browser Automation

Playwright MCP is a Model Context Protocol server that lets AI agents control real browsers through structured accessibility snapshots. Refs like e5, e12 give deterministic handles to every interactive element — no pixel-guessing, no brittle CSS selectors.

Read references/tools.md for the full tool catalogue before choosing an approach.
Read references/config.md for CLI flags, capabilities, and JSON config options.
Read references/patterns.md for copy-paste workflow recipes.


Core Mental Model

browser_navigate → browser_snapshot → interact via refs → browser_snapshot (verify)

Every action follows this cycle. The snapshot is the ground truth. Never assume page state — always re-snapshot after an action.


Decision Tree: What to Use

1. Snapshot vs Vision Mode

Situation Use
Standard web app — forms, buttons, links, tables Snapshot (default)
Canvas, SVG, chart, game UI, custom drawn widget Vision mode (--caps=vision)
Verifying visual layout, pixel correctness Screenshot + snapshot together

Rule: Snapshots for 90%+ of tasks. Vision only for elements absent from the accessibility tree.

2. Which Capability to Enable

Enable only what you need — each capability adds tokens to every interaction:

Need Add to --caps=
Mock API responses / intercept network network
Cookies, localStorage, auth state save/restore storage
Verify elements, generate .spec.ts test code testing
Canvas/chart coordinate-based clicking vision
Export page as PDF pdf
Video recording, tracing devtools

Minimal config (no capabilities) is fastest and cheapest on tokens.

3. Token Budget Awareness

A single browser_navigate on a content-rich page can return thousands of tokens. Across a multi-step session this compounds.

Practice Saves Tokens
Enable only needed capabilities High
Use browser_snapshot only when you need to verify or find a ref High
Avoid browser_take_screenshot unless visual proof is required Medium
Use browser_fill_form (one call) instead of multiple browser_type Low
Stop tracing/video when not debugging Medium

Read the full file on GitHub · 184 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 184 lines · 156 tokens per session scan A cb35d94cefe9

Subscribe to this mod's changes

playwright-mcp is a skill published in the GitHub repository Razaib-khan/ForgeWeave (1 stars, last pushed 2mo ago), licensed MIT. It adds 156 tokens to every session and 1,528 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.