MCP Playwright Server

by mostafaraafat91

Not rated
GitHub

About

Automate web testing and tasks by connecting Claude Desktop with Playwright.

Details

Author
mostafaraafat91
Categories
Developer Tools, Automation, Other
Tags
#playwright

Setup

Install MCP Playwright Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/mostafaraafat91/MCP-Playwright-Server

Follow the installation instructions in the repository README, then restart your MCP client.

Automate web testing and tasks by connecting Claude Desktop with Playwright.

๐Ÿš€ AI-Powered Browser Automation for Claude Desktop

Bridge the gap between AI and web automation with this revolutionary MCP server

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server can be used with Claude Desktop and other MCP-compatible clients to perform web testing, scraping, and automation tasks.

- ๐Ÿค– AI-First Design: Built specifically for AI agents and natural language automation
- ๐ŸŽญ Multi-Browser Support: Chromium, Firefox, and WebKit out of the box
- ๐Ÿณ Production Ready: Docker support for consistent, scalable deployments
- โšก Lightning Fast: Optimized for enterprise-grade testing workflows
- ๐Ÿ”ง Developer Friendly: Comprehensive tooling and extensive documentation

- Multi-browser support: Chromium, Firefox, and WebKit
- Comprehensive automation: Navigate, click, type, screenshot, and more
- Docker support: Run in containers for consistent environments
- Testing framework: Built-in Playwright test configuration
- MCP integration: Compatible with Claude Desktop and other MCP clients

- launch_browser- Launch a new browser instance
- new_page- Create a new page in an existing browser
- navigate- Navigate to a URL
- click- Click on an element
- type_text- Type text into input fields
- get_text- Extract text content from elements
- screenshot- Take screenshots of pages
- wait_for_selector- Wait for elements to appear
- close_page- Close a page
- close_browser- Close a browser and all its pages

npm install -g mcp-playwright && mcp-playwright start

To use this MCP server with Claude Desktop, add the following to your Claude Desktop configuration file:

Edit~/Library/Application Support/Claude/claude_desktop_config.json:

{ "mcpServers": { "playwright": { "command": "node", "args": ["/path/to/your/mcpplaywright/src/index.js"], "env": { "PLAYWRIGHT_HEADLESS": "true" } } } }
{ "mcpServers": { "playwright": { "command": "docker", "args": ["run", "--rm", "-i", "mcp-playwright"], "env": { "PLAYWRIGHT_HEADLESS": "true" } } } }
// Let AI write and execute tests naturally "Test the login flow with invalid credentials and verify error messages"
// Automated data extraction from complex SPAs "Navigate to the dashboard, extract all user metrics, and save as JSON"
// Visual regression testing with AI assistance "Compare the current homepage with the baseline and highlight differences"
// Launch a browser const browser = await launchBrowser({ browserType: 'chromium', headless: true }); // Create a new page const page = await newPage({ browserId: browser.id, url: 'https://example.com' }); // Take a screenshot await screenshot({ pageId: page.id, path: 'example.png' }); // Click on an element await click({ pageId: page.id, selector: 'button#submit' }); // Type text await typeText({ pageId: page.id, selector: 'input[name="email"]', text: 'test@example.com' }); // Get text content const text = await getText({ pageId: page.id, selector: 'h1' });
# Run all tests npm test # Run tests in headed mode (visible browser) npm run test:headed # Debug tests npm run test:debug

For development with automatic restarts:

To add new MCP tools, editsrc/index.jsand:
- Add the tool definition to thetoolsarray inListToolsRequestSchemahandler
- Add a case in theCallToolRequestSchemahandler
- Implement the tool method in thePlaywrightMCPServerclass

- PLAYWRIGHT_HEADLESS: Set tofalseto run browsers in headed mode
- PLAYWRIGHT_SLOWMO: Add delay between operations (milliseconds)

- Node.js 18
- All Playwright browsers pre-installed
- System dependencies for browser operation
- Optimized for headless operation

# Add to Dockerfile if needed RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser USER pwuser

For large-scale testing, increase Docker memory limits:

docker run --memory=2g --cpus=2 mcp-playwright

- ๐Ÿ“บ Getting Started Video- 5-minute setup guide
-
๐Ÿ“– Complete Tutorial Series- From basics to advanced
-
๐ŸŽฎ Interactive Playground- Try it live

"MCP Playwright reduced our testing automation setup time from weeks to hours. The AI integration is game-changing!"
โ€”Senior QA Engineer at TechCorp

"Finally, a tool that speaks both human and machine language for web automation."
โ€”DevOps Lead at StartupXYZ

We love contributions! See ourContributing Guidefor details.

- ๐Ÿ›Bug Reports: Help us squash bugs
- ๐Ÿ’กFeature Requests: Share your ideas
- ๐Ÿ“Documentation: Improve our docs
- ๐ŸงชTesting: Add test coverage
- ๐ŸŽจExamples: Create usage examples

โญ GitHub Stars: 150+ (and growing!) ๐Ÿ“ฆ NPM Downloads: 1000+ monthly ๐Ÿงช Test Coverage: 95% ๐Ÿข Enterprise Users: 50+ ๐ŸŒ Global Community: 25+ countries

- ๐Ÿค–Enhanced AI Integration: GPT-4 powered test generation
- ๐Ÿ“ฑMobile Testing: React Native and Flutter support
- ๐Ÿ”„CI/CD Plugins: GitHub Actions, Jenkins, GitLab
- ๐Ÿ“ŠAdvanced Analytics: Test insights and reporting dashboard

If MCP Playwright helps your team, consider:

- โญStarringthis repository
- ๐ŸฆSharingon social media
- ๐Ÿ’ฌJoiningour
Discord community
- โ˜•Sponsoringdevelopment

MIT License - see LICENSE file for details.

Making AI-powered automation accessible to everyone

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

An AI agent for the Playwright MCP server, enabling automated web testing and interaction.

Generate Playwright BDD tests, GitHub Actions and Azure Pipelines with business-rule traceability, focused CodeGraph context and persistent Engram memory.

Autonomous QA MCP that tests web and macOS apps like a real engineer and verifies every bug.

A Playwright-based MCP server that exposes a live browser as a traceable, inspectable, debuggable and controllable execution environment for AI agents.

Browser automation via Chrome DevTools Protocol

Drive, inspect, and assert on real Electron desktop apps from an AI agent โ€” agent-native, Playwright-style automation with accessibility refs, stable error codes, and retrying assertions

Playwright MCP for Godot, screenshots, SceneTree manipulation, and arbitrary GDScript execution at runtime through a local UDP bridge.

A lightweight, AI-powered end-to-end testing framework for CI workflows. Requires an OpenAI API key.

Create and manage end-to-end tests using the Octomind platform.

No reviews yet โ€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.