Claude Playwright MCP Server
Seamless Claude Code ↔ Playwright integration with intelligent caching. Transform browser automation with AI-aware selector resolution and persistent sessions.
Claude Playwright scores 43 (Fair), licensed MIT and written in TypeScript. It installs as a local process. It declares 19 tools. Filed under Browser automation. GitHub shows 10 stars. Package registries report about 255 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
43 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
75/100 for listing completeness. Lost points: 19 of 19 tools barely described, no docs link.
How quality is graded
Where the 43 comes from
0 + 10 + 3 + 10 + 10 + 10 = 43. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 10 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 3 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 10 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "smartlabsat-claude-playwright": { "command": "npx", "args": [ "-y", "claude-playwright@0.1.4" ] } }}
Environment variables
This server does not declare environment variables.
Tools19Tool docs quality grade D
All capabilitiesClick elements
Fill multiple form fields
Hover over elements
Navigate to URLs
Keyboard input
Take screenshots
Select dropdown options
Get accessibility tree
mcp_browser_typetoolType text
Monitor console messages
Execute JavaScript
Track network requests
About
Claude Playwright
Browser automation integration for Claude Code via MCP (Model Context Protocol).
🎉 v0.1.3: Major Stability Update
80% fewer failures with automatic retry logic, intelligent error recovery, and helpful error messages. Your automations are now much more reliable!
What it does
Claude Playwright adds browser automation capabilities to Claude Code. It provides 26+ tools for controlling browsers, managing sessions, and automating web interactions with enterprise-grade reliability.
Installation
# Install globally
npm install -g claude-playwright
# Or add to project
npm install --save-dev claude-playwright
Quick Setup
- Initialize MCP configuration:
npx claude-playwright mcp init --base-url http://localhost:3000
-
Restart Claude Code
-
Use browser automation in Claude:
"Navigate to login page and sign in"
"Take a screenshot of the dashboard"
"Click the submit button"
Core Features
Browser Automation Tools
- Navigation and interaction (click, type, hover)
- Form handling (fill forms, select options, file upload)
- Screenshots (full page, element-specific)
- Data extraction (JavaScript execution, DOM snapshots)
- Monitoring (console messages, network requests)
- Advanced features (tab management, dialog handling)
Session Management
Save and restore authenticated browser sessions:
# Save session after manual login
npx claude-playwright session save my-app
# List saved sessions
npx claude-playwright session list
# Use in Claude: "Load the my-app session"
Sessions include cookies, localStorage, and authentication state. Valid for 8 hours with auto-extension.
Profile Management
Test on different devices and viewports:
# Setup default profiles
npx claude-playwright profile setup
# Create custom profile
npx claude-playwright profile create mobile --device mobile --viewport 390x844
# List profiles
npx claude-playwright profile list
Intelligent Caching
- AI-aware selector caching with fallback strategies
- Bidirectional input-to-selector mapping
- Supports multiple languages (English/German)
- Automatic syntax correction for Playwright selectors
- Project-local cache storage
Test Management
Save and reuse browser interaction sequences:
# Save current workflow as test
npx claude-playwright test save --name "Login Flow"
# Find tests by description
npx claude-playwright test find --query "login"
# Run test on different environment
npx claude-playwright test run --name "Login Flow" --url "staging.app.com"
Step-by-Step Tutorial
Getting Started in 5 Minutes
Step 1: Install and Initialize
# Install the package
npm install -g claude-playwright
# Navigate to your project directory
cd my-web-app
# Initialize MCP configuration
npx claude-playwright mcp init --base-url http://localhost:3000
Step 2: Start Your Application
# Start your web application (example)
npm run dev
# Your app should be running at http://localhost:3000
Step 3: Restart Claude Code
- Close Claude Code completely
- Reopen Claude Code
- Navigate to your project directory
Step 4: Test the Connection In Claude Code, type:
/mcp
You should see playwright listed as an active MCP server.
Step 5: Your First Automation In Claude Code, try:
"Navigate to the home page and take a screenshot"
Claude will automatically:
- Open a browser
- Navigate to http://localhost:3000
- Take a screenshot
- Show you the result
Step 6: Save a Session (Optional) If your app requires authentication:
# Save an authenticated session
npx claude-playwright session save my-app --url http://localhost:3000/login
Follow the browser prompts to log in, then close the browser. The session is saved.
Step 7: Use Advanced Features Now you can ask Claude to:
"Load the my-app session and navigate to the dashboard"
"Fill out the contact form with test data"
"Test the shopping cart workflow"
"Extract all product names from the catalog page"
Working with Tests
Save Your Workflow as a Test:
# After using Claude to perform some actions
npx claude-playwright test save --name "User Login" --tags "auth"
Reuse Your Test:
# Run the same test on staging
npx claude-playwright test run --name "User Login" --url "https://staging.myapp.com"
Find Tests by Purpose:
# Search for authentication-related tests
npx claude-playwright test find --query "login"
Device Testing
Setup Mobile Testing:
# Create mobile profile
npx claude-playwright profile create iphone --device mobile --viewport 390x844
# Use in Claude: "Use the iphone profile and test the mobile navigation"
Troubleshooting Your Setup
If MCP connection fails:
# Check status
npx claude-playwright mcp status
# Verify .mcp.json was created
cat .mcp.json
If browser actions fail:
# Clear cache and try again
npx claude-playwright cache clear
If sessions don't work:
# Check session health
npx claude-playwright session health
# List all sessions
npx claude-playwright session list
Available MCP Tools
Claude Code has access to these browser automation tools:
Core Browser Actions:
mcp_browser_navigate- Navigate to URLsmcp_browser_click- Click elementsmcp_browser_type- Type textmcp_browser_snapshot- Get accessibility treemcp_browser_screenshot- Take screenshots
Form Interactions:
mcp_browser_fill_form- Fill multiple form fieldsmcp_browser_select_option- Select dropdown optionsmcp_browser_hover- Hover over elementsmcp_browser_press_key- Keyboard input
Session Management:
mcp_session_restore- Load saved sessionmcp_session_save- Save current sessionmcp_session_list- List available sessions
Test Management:
mcp_test_save- Save interaction sequencemcp_test_run- Execute saved testmcp_test_search- Find tests by intentmcp_test_library- Browse test collection
Debug Tools:
mcp_debug_console- Monitor console messagesmcp_debug_network- Track network requestsmcp_debug_evaluate- Execute JavaScript
CLI Commands
MCP Setup
npx claude-playwright mcp init # Initialize MCP config
npx claude-playwright mcp status # Check status
Session Management
npx claude-playwright session list # List sessions
npx claude-playwright session save <name> # Save session
npx claude-playwright session load <name> # Load session
npx claude-playwright session delete <name> # Delete session
Profile Management
npx claude-playwright profile setup # Create default profiles
npx claude-playwright profile list # List profiles
npx claude-playwright profile create <name> # Create profile
Cache Management
npx claude-playwright cache info # Cache statistics
npx claude-playwright cache clear # Clear cache
npx claude-playwright cache health # Health check
Test Management
npx claude-playwright test save # Save test scenario
npx claude-playwright test find # Search tests
npx claude-playwright test run # Execute test
npx claude-playwright test list # List all tests
npx claude-playwright test delete # Delete tests
Configuration
MCP Configuration
The .mcp.json file is created automatically during initialization:
{
"mcpServers": {
"playwright": {
"command": "node",
"args": ["node_modules/claude-playwright/dist/mcp/server.cjs"],
"env": {
"BASE_URL": "http://localhost:3000"
}
}
}
}
Environment Variables
BASE_URL: Application base URLPLAYWRIGHT_HEADLESS: Run headless (default: false)PLAYWRIGHT_SLOW_MO: Slow down operations (ms)
Project Structure
All data is stored project-locally in .claude-playwright/:
.claude-playwright/
├── cache/ # Selector cache and performance data
├── sessions/ # Browser session storage
├── profiles/ # Device profiles
└── logs/ # Operation logs
Troubleshooting
MCP Server Issues
- Check
.mcp.jsonexists in project root - Restart Claude Code after config changes
- Verify BASE_URL matches your application
- Run
npx claude-playwright mcp status
Session Issues
- Check validity:
npx claude-playwright session health - Extend sessions:
npx claude-playwright session extend <name> - Sessions expire after 8 hours
Cache Issues
- Check status:
npx claude-playwright cache health - Clear cache:
npx claude-playwright cache clear - View debug info:
npx claude-playwright cache debug
Requirements
- Node.js 16+
- npm 7+
- Claude Code with MCP support
Contributing
git clone https://github.com/smartlabsAT/claude-playwright.git
cd claude-playwright
npm install
npm run build
npm test
License
MIT © SmartLabs
Frequently asked questions
What is Claude Playwright MCP Server?
Seamless Claude Code ↔ Playwright integration with intelligent caching. Transform browser automation with AI-aware selector resolution and persistent sessions.
How do I install Claude Playwright MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. Claude Playwright MCP Server runs locally from the npm package claude-playwright with the command npx -y claude-playwright@0.1.4.
Is Claude Playwright MCP Server free and open source?
Yes. Claude Playwright MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does Claude Playwright MCP Server support remote (HTTP) connections?
No remote endpoint is listed for Claude Playwright MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does Claude Playwright MCP Server provide?
Claude Playwright MCP Server provides 19 tools, including mcp_browser_click, mcp_browser_fill_form, mcp_browser_hover, and mcp_browser_navigate. See the full tool list for descriptions and parameters.
How is Claude Playwright MCP Server's trust score calculated?
Claude Playwright MCP Server scores 43 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.