playwright-mcp-server

dmitrypost/playwright-mcp-server

3.1

If you are the rightful owner of playwright-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Playwright MCP Server for browser automation

playwright-mcp-server

Playwright MCP Server for browser automation

Overview

This project implements a Model Context Protocol (MCP) server using Playwright for browser automation. It provides an example MCP server and client integration, supporting prompt templates, resource listing, and tool calls.

Features

  • MCP server implementation using @modelcontextprotocol/sdk
  • Playwright-based browser automation
  • Example prompt and resource handlers
  • Automated tests with Playwright and Jest
  • TypeScript support

Getting Started

Prerequisites

  • Node.js (v18+ recommended)
  • npm

Installation

npm install
npm run install-browsers

Running the Server

npm start

Running Tests

npm test

Or to run Playwright UI tests:

npm run test:ui

Project Structure

  • src/index.ts: MCP server implementation
  • tests/automation.test.ts: Playwright and MCP client integration tests
  • package.json: Project metadata and scripts
  • tsconfig.json: TypeScript configuration
  • test.config.js: Jest configuration

Example Usage

The server exposes prompt templates and resources via MCP. The client can connect and interact with the server, as shown in the integration tests.