Playwright MCP

Playwright MCP

Playwright MCP server enables AI-driven Playwright test generation by allowing interaction with web pages and element inspection. Integrated with IDEs like Cursor, it provides real-time context to enhance test accuracy and efficiency.

Ashish-Bansal

Web Automation & Stealth
Visit Server

README

How to Use playwright-mcp?

npm version Docs

Introduction

playwright-mcp (Model Context Protocol) is a powerful tool that bridges the gap between AI assistants and browser automation. It enables AI models to interact with web browsers, inspect DOM elements, record user interactions, and generate Playwright test scripts with higher accuracy. This guide will walk you through setting up and using playwright-mcp effectively.

Tools

Available tools in the browser interface:

Browser Toolbox

  1. Pick DOM (🎯): Click to select and capture HTML elements from the page. Use this to record selectors for your test cases.
  2. Pick Image (📸): Capture screenshots of specific elements. Useful for visual testing or documentation.
  3. Record Interactions (📋): Record browser interactions such as clicks, inputs, and navigations. These interactions automatically generate selectors and can be passed as context to MCP clients like Claude or Cursor to help write test cases.

MCP Commands

  1. init-browser: Initialise the playwright browser.
  2. get-context: Get the website context, which would be used to write the test case
  3. execute-code: Execute custom Playwright JS code against the current page
  4. get-screenshot: Get a screenshot of the current page
  5. get-full-dom: Get the full DOM of the current page. (Prefer using get-context instead)

Learn More

Want to dive deeper? Check out the full documentation:

📖 View Documentation

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Mult Fetch MCP Server

Mult Fetch MCP Server

A versatile MCP-compliant web content fetching tool that supports multiple modes (browser/node), formats (HTML/JSON/Markdown/Text), and intelligent proxy detection, with bilingual interface (English/Chinese).

Featured
Local
Hyperbrowser MCP Server

Hyperbrowser MCP Server

Welcome to Hyperbrowser, the Internet for AI. Hyperbrowser is the next-generation platform empowering AI agents and enabling effortless, scalable browser automation. Built specifically for AI developers, it eliminates the headaches of local infrastructure and performance bottlenecks, allowing you to

Featured
Local
React MCP

React MCP

react-mcp integrates with Claude Desktop, enabling the creation and modification of React apps based on user prompts

Featured
Local
Exa MCP

Exa MCP

A Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.

Featured
Perplexity Chat MCP Server

Perplexity Chat MCP Server

MCP Server for the Perplexity API.

Featured
Web Research Server

Web Research Server

A Model Context Protocol server that enables Claude to perform web research by integrating Google search, extracting webpage content, and capturing screenshots.

Featured
Browser Use (used by Deploya.dev)

Browser Use (used by Deploya.dev)

AI-driven browser automation server that implements the Model Context Protocol to enable natural language control of web browsers for tasks like navigation, form filling, and visual interaction.

Featured
Aindreyway Codex Keeper

Aindreyway Codex Keeper

Serves as a guardian of development knowledge, providing AI assistants with curated access to latest documentation and best practices.

Featured
Perplexity Deep Research

Perplexity Deep Research

A server that allows AI assistants to perform web searches using Perplexity's sonar-deep-research model with citation support.

Featured