Playwright MCP Server
Provides browser automation and end-to-end web testing capabilities in Firefox, enabling navigation, clicking, form filling, page snapshots, screenshots, and custom JavaScript execution.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Playwright MCP ServerNavigate to the login page, fill in test credentials, and click submit."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Autonomous QA Agent with Playwright & MCP
An end-to-end (E2E) web testing automation framework integrating Playwright with AI agents through the Model Context Protocol (MCP). This system enables autonomous navigation, execution, debugging, and contextual analysis of test flows without manual intervention.
๐ฏ Overview
Unlike traditional automation scripts that rely on static selectors, this project exposes Playwright capabilities as standardized tools via an MCP server.
The AI Agent:
Receives natural language testing directives or user stories.
Dynamically discovers UI elements by interacting with the browser in real time.
Executes complex actions (clicks, inputs, page navigation, asynchronous waits).
Diagnoses visual and network failures on the fly, self-healing selectors or reporting bugs.
Related MCP server: Cloudflare Playwright MCP
๐๏ธ System Architecture
+-------------------+ JSON-RPC (MCP) +--------------------+ | | <============================> | | | AI Agent | | MCP Server | | (LLM Orchestrator)| | (Playwright Tools) | +-------------------+ +--------------------+ | DevTools Protocol / API v +--------------------+ | Headless Browser | | (Chromium/Firefox) | +--------------------+
MCP Client (Agent Core): Drives reasoning (via ReAct loop or native tool-calling) to plan steps and validate assertions.
MCP Server (Bridge): Translates MCP protocol requests into direct Playwright API operations (
page.click(),page.screenshot(),page.evaluate()).Playwright Runtime: Manages browser sessions, handles network states, and captures artifacts (traces, screenshots, console logs).
๐ ๏ธ Exposed MCP Tools
The Playwright-MCP server provides the following primitives:
Tool | Description |
| Opens the browser and waits for load states ( |
| Performs click events using semantic, CSS, or XPath selectors. |
| Types text into input elements and form fields. |
| Extracts the rendered DOM, accessibility tree, and page metadata. |
| Captures full-page or element-level screenshots for multimodal analysis. |
| Runs custom JavaScript directly inside the browser execution context. |
๐ Autonomous Capabilities
Self-Healing Selectors: When a selector breaks due to UI changes, the agent inspects the accessibility tree and visual state to identify the updated equivalent element dynamically.
Contextual Error Triage: Upon test failure, the agent correlates browser console logs (
console.error), HTTP response codes (4xx/5xx), and screenshots to generate actionable root-cause analysis.Exploratory Testing: Capable of navigating unscripted paths to detect broken layouts, non-responsive buttons, or unhandled exceptions.
๐ฆ Prerequisites
Node.js >= 18.x
Playwright Browsers installed
An MCP-compatible client (VS Code Copilot Agent, Claude Desktop, Cursor, or a custom runner built with
@modelcontextprotocol/sdk)
โ๏ธ Setup & Installation
Clone the repository:
git clone [https://github.com/your-username/playwright-mcp-agent.git](https://github.com/your-username/playwright-mcp-agent.git) cd playwright-mcp-agent Install dependencies:
Bash pnpm install npx playwright install --with-deps Configure the MCP server: In your workspace .vscode/mcp.json (or your client's MCP configuration):
JSON { "servers": { "playwright": { "type": "stdio", "command": "npx", "args": [ "-y", "@playwright/mcp@latest" ] } }, "inputs": [] } (Note for Windows users: if npx fails to start, set "command": "npx.cmd").
๐งช Example Usage With the agent connected to the MCP server, run test tasks using natural language:
"Navigate to staging.example.com, sign in with the test credentials, attempt to add an item to the shopping cart, and assert that the badge count updates to 1. If the assertion fails, take a full-page screenshot and extract the network logs."
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Browser-based QA for AI-built software. Test pages with real browsers via agents.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
AI-powered web automation. Navigate websites using AI agents for one page or a thousand
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.
- AlicenseNot gradedqualityDmaintenanceProvides complete browser automation capabilities for AI agents via 44 tools, including navigation, element interaction, state management, and session recording.5361Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/misacandrademoon/playwright-test-MCP-Agents'
If you have feedback or need assistance with the MCP directory API, please join our Discord server