Skip to content
mcp-playwright logo

Playwright MCP

mcp-playwright

This skill provides guidance for using Playwright MCP for browser automation. Use when navigating web pages, interacting with web elements, taking screenshots, filling forms, running browser tests, or automating any browser-based tasks.

SKILL.md

Full skill instructions

Playwright MCP

Overview

This skill enables browser automation using Playwright through MCP. Playwright provides powerful browser control capabilities including navigation, element interaction, screenshots, and form handling.

When to Use This Skill

  • Navigating and interacting with web pages
  • Taking screenshots of web content
  • Filling out forms and submitting data
  • Testing web applications
  • Extracting information from web pages
  • Automating repetitive browser tasks

Quick Start Workflow

  1. Navigate to a page: browser_navigate
  2. Take a snapshot to get element refs: browser_snapshot
  3. Interact with elements using refs from snapshot: browser_click, browser_type

Core Tools

Navigation

browser_navigate - Navigate to a URL

mcp__playwright__browser_navigate({ url: "https://example.com" })

browser_navigate_back - Go back to previous page

mcp__playwright__browser_navigate_back({})

Page Analysis

browser_snapshot - Get accessibility tree (preferred for interaction)

mcp__playwright__browser_snapshot({})

browser_take_screenshot - Capture visual screenshot

mcp__playwright__browser_take_screenshot({
  type: "png",
  fullPage: true,
  filename: "screenshot.png"
})

Element Interaction

browser_click - Click an element (requires ref from snapshot)

mcp__playwright__browser_click({
  element: "Submit button",
  ref: "button[ref='submit']"
})

browser_type - Type text into an element

mcp__playwright__browser_type({
  element: "Search input",
  ref: "input[ref='search']",
  text: "search query",
  submit: true
})

browser_hover - Hover over an element

mcp__playwright__browser_hover({
  element: "Menu item",
  ref: "li[ref='menu']"
})

Form Handling

browser_fill_form - Fill multiple form fields

mcp__playwright__browser_fill_form({
  fields: [
    { name: "Username", type: "textbox", ref: "input[name='user']", value: "john" },
    { name: "Remember", type: "checkbox", ref: "input[name='remember']", value: "true" }
  ]
})

browser_select_option - Select dropdown option

mcp__playwright__browser_select_option({
  element: "Country",
  ref: "select[ref='country']",
  values: ["JP"]
})

Waiting and Dialogs

browser_wait_for - Wait for conditions

mcp__playwright__browser_wait_for({ text: "Loading complete" })
mcp__playwright__browser_wait_for({ textGone: "Please wait..." })
mcp__playwright__browser_wait_for({ time: 2 })

browser_handle_dialog - Handle browser dialogs

mcp__playwright__browser_handle_dialog({ accept: true, promptText: "input" })

Page Management

browser_tabs - Manage tabs

mcp__playwright__browser_tabs({ action: "list" })
mcp__playwright__browser_tabs({ action: "new" })
mcp__playwright__browser_tabs({ action: "select", index: 0 })

browser_close - Close page

mcp__playwright__browser_close({})

Advanced

browser_evaluate - Execute JavaScript

mcp__playwright__browser_evaluate({ function: "() => document.title" })

browser_press_key - Press keyboard key

mcp__playwright__browser_press_key({ key: "Enter" })

Best Practices

  1. Always snapshot first: Use browser_snapshot before interacting to get element refs
  2. Use descriptive element names: Provide clear descriptions in element parameter
  3. Wait for content: Use browser_wait_for before interacting with dynamic content
  4. Handle dialogs: Check for dialog prompts and handle appropriately
  5. Clean up: Close browser when done with browser_close

References

For complete tool parameters, see references/​tools.md.

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View