Playwright DevTools MCP Server
Allows launching and controlling Firefox via Playwright when PLAYWRIGHT_BROWSER_TYPE=firefox is configured, enabling browser automation and debugging such as navigation, console/network inspection, screenshots, and DOM analysis.
Click on "Deploy 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 DevTools MCP Server check console errors and failed requests on localhost:3000"
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.
Playwright DevTools MCP Server ๐ญ
A specialized Model Context Protocol (MCP) server that provides AI models with comprehensive Chrome DevTools access through Playwright. Unlike existing MCP servers focused on basic browser automation, this enables autonomous debugging, performance analysis, and security inspection capabilities.
๐ What Makes This Different
Existing Playwright MCP Servers: Focus on DOM automation (clicking, typing, form filling)
Our DevTools MCP Server: Debugging-first approach via Chrome DevTools Protocol
๐ Console log analysis - Real-time error detection and debugging
๐ Network monitoring - Request/response inspection and failure analysis
โก Performance metrics - Core Web Vitals and resource timing
๐พ Storage inspection - localStorage, sessionStorage, cookies with clearing
๐จ Visual debugging - Screenshots, DOM analysis, element property inspection
๐ Security analysis - SSL certificates, headers, CSP violations (coming soon)
Related MCP server: Web Inspector MCP
๐ฆ Installation
npm install -g playwright-devtools-mcpOr for local development:
git clone https://github.com/agibson/playwright-devtools-mcp.git
cd playwright-devtools-mcp
npm install๐ง Quick Start
1. Claude Desktop Setup
Add to your Claude Desktop configuration (~/claude_desktop_config.json):
{
"mcpServers": {
"playwright-devtools": {
"command": "npx",
"args": ["playwright-devtools-mcp"],
"env": {
"PLAYWRIGHT_HEADLESS": "true"
}
}
}
}2. Complete Debugging Example
// In Claude Desktop, start a debugging session:
// 1. Launch browser context
const launch = await browser_launch({
headless: false,
viewport: { width: 1280, height: 720 }
});
const contextId = launch.data.contextId;
// 2. Navigate to problematic page
await browser_navigate({
contextId,
url: "https://example.com/problematic-page",
waitFor: "load"
});
// 3. Analyze issues
const errors = await console_get_logs({
contextId,
types: ["error", "warn"],
limit: 20
});
const failed = await network_get_failed_requests({
contextId,
limit: 10
});
const vitals = await performance_get_core_vitals({
contextId,
timeout: 5000
});
// 4. Visual debugging
const screenshot = await debug_take_screenshot({
contextId,
fullPage: true,
format: "png"
});
const element = await debug_get_element_properties({
contextId,
selector: ".broken-component",
includeComputedStyles: true,
includeDimensions: true
});
// 5. Clean up
await browser_close({ contextId });3. Alternative Claude Desktop Configurations
For development (local project):
{
"mcpServers": {
"playwright-devtools": {
"command": "node",
"args": ["./src/index.js"],
"cwd": "/path/to/playwright-devtools-mcp",
"env": {
"PLAYWRIGHT_HEADLESS": "false",
"DEBUG": "playwright-devtools:*"
}
}
}
}For production (npm package):
{
"mcpServers": {
"playwright-devtools": {
"command": "npx",
"args": ["playwright-devtools-mcp"],
"env": {
"PLAYWRIGHT_HEADLESS": "true"
}
}
}
}๐ Response Format
All tools return a consistent response format:
{
"success": true,
"data": {
// Tool-specific data
},
"metadata": {
"timestamp": 1234567890,
"duration": 1500,
"contextId": "context-id"
},
"error": null
}Error Response Example:
{
"success": false,
"data": null,
"metadata": {
"timestamp": 1234567890,
"contextId": "context-123"
},
"error": {
"code": "NAVIGATION_FAILED",
"message": "Failed to navigate: timeout exceeded",
"details": {
"url": "https://example.com",
"timeout": 30000
}
}
}๐ ๏ธ Available Tools
Browser Management
browser_launch- Create browser context with custom viewport/user agentbrowser_navigate- Navigate to URLs with configurable wait conditionsbrowser_close- Clean up browser contexts and resources
Browser Safety & Recovery โ New in v0.2.1!
browser_navigate_safe- Navigation with automatic retry and context recoverybrowser_health_check- Context health validation and auto-healingbrowser_force_recreate- Force recreation of problematic contexts
Console & DevTools โ
console_get_logs- Collect console messages and errors with filteringconsole_clear_logs- Clear stored console data to free memoryconsole_evaluate_javascript- Execute JavaScript in browser console and see results
Network Analysis โ
network_get_requests- Monitor HTTP requests and responses with filteringnetwork_get_failed_requests- Get failed requests (4xx, 5xx, connection errors)network_clear_requests- Clear stored network data to free memory
Performance Monitoring โ
performance_get_metrics- Collect navigation timing and resource metricsperformance_get_core_vitals- Measure Core Web Vitals (LCP, FID, CLS)
Storage Inspection โ
storage_get_local_storage- Get localStorage data with size analysisstorage_get_session_storage- Get sessionStorage data with filteringstorage_get_cookies- Get cookies with security attributes and expiry infostorage_clear_data- Selectively clear storage by type (localStorage, sessionStorage, cookies)
Debug & Visual Tools โ New in v0.3.0!
debug_take_screenshot- Screenshot capture (viewport OR full-page) with quality optionsdebug_get_page_source- Current DOM state extraction with comprehensive statisticsdebug_get_element_properties- Deep element inspection (styles, attributes, computed values, dimensions, accessibility)debug_get_dom_tree- Structured DOM representation for analysis with depth control
Security Analysis (Coming Soon)
security_analyze_headers- Inspect security configurationssecurity_get_certificates- SSL/TLS certificate analysis
๐ Development Status
Current: โ Complete Visual Debugging Suite (v0.3.0)
โ Browser management with safety features and auto-recovery
โ Console log analysis with JavaScript execution
โ Network request monitoring and failure analysis
โ Performance metrics & Core Web Vitals
โ Complete storage inspection (localStorage, sessionStorage, cookies)
โ Visual debugging - Screenshots, DOM analysis, element property inspection
โ Advanced element debugging - Computed styles, dimensions, accessibility properties
Next: ๐ง Enhanced network analysis tools (slow requests, waterfalls, request interception)
Future: ๐ Security analysis, HAR export, device simulation
๐๏ธ Architecture
src/
โโโ index.js # MCP server entry point
โโโ server.js # Tool registry and execution
โโโ tools/ # Individual MCP tools
โ โโโ browser.js # Browser management tools
โโโ utils/ # Shared utilities
โ โโโ browser-manager.js # Browser lifecycle management
โโโ config/ # Configuration system
โโโ defaults.js # Default settingsโ๏ธ Configuration
Environment Variables
PLAYWRIGHT_BROWSER_TYPE=chromium # chromium|firefox|webkit
PLAYWRIGHT_HEADLESS=true # true|false
PLAYWRIGHT_TIMEOUT=30000 # milliseconds
MCP_MAX_CONCURRENT_PAGES=3 # resource limits
DEBUG=playwright-devtools:* # debug loggingRuntime Options
browser_launch({
headless: false, // Override headless mode
viewport: { width: 1920, height: 1080 },
userAgent: "Custom User Agent"
});๐งช Testing
# Run all tests
npm test
# Run with debug logging
DEBUG=playwright-devtools:* npm start
# Development mode with auto-reload
npm run dev๐ Authentication & Security
๐ก๏ธ Security-First Approach:
No password storage - This server does NOT store or manage authentication credentials
Session-based workflow - Users log in manually, AI works with existing sessions
Cookie inspection - AI can analyze and manage cookies from existing authenticated sessions
Human-in-the-loop - Authentication requires human interaction for security
๐ก Recommended workflow:
User manually logs into websites they want to debug
AI uses the MCP server to inspect the authenticated session
AI can analyze storage, cookies, and debug authenticated pages
No credentials are stored or transmitted through the MCP server
๐ค Contributing
We welcome contributions! This is a weekend MVP project designed for community growth.
๐ Quick Contribution Guide:
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-devtools-toolFollow the existing tool patterns in
src/tools/Add your tool to
src/server.jstool registryTest it works and submit a pull request
๐ Architecture is Extension-Ready:
Modular design - Each tool is a self-contained module
Consistent APIs - Follow existing patterns for easy maintenance
Simple registration - Just import and add to the TOOLS array
Clear examples - Every tool has comprehensive examples
Development Philosophy
Keep it simple - Focus on core debugging use cases, avoid over-engineering
AI-first design - APIs should work well with AI model capabilities
Weekend MVP mindset - Clean, functional, extensible - not enterprise-hardened
๐ License
MIT License - see LICENSE file for details.
๐ Related Projects
Microsoft's Playwright MCP - General browser automation
MCP Servers - Official MCP server collection
Playwright - Browser automation framework
โญ Support
If this project helps you debug web applications with AI, please consider:
โญ Starring the repository
๐ Reporting issues and bugs
๐ก Suggesting new DevTools capabilities
๐ค Contributing code or documentation
Built for the AI-powered debugging future ๐คโจ
Available Tools
22 toolsbrowser_closeC
Close a browser context and clean up resources
Inputs: contextId (required).
browser_force_recreateB
Force recreate a browser context when it becomes unresponsive or problematic
Inputs: contextId (required), preserveViewport.
browser_health_checkB
Check browser context health and attempt automatic healing if issues detected
Inputs: contextId (required), autoHeal.
browser_launchC
Launch a new browser instance and create a browser context for web debugging
Inputs: headless, viewport, userAgent.
console_clear_logsA
Clear stored console logs for a browser context to free memory
Inputs: contextId (required).
console_evaluate_javascriptC
Execute JavaScript in the browser console and return the result
Inputs: contextId (required), expression (required), includeCommandLineAPI.
console_get_logsC
Collect console logs and errors from the browser for debugging analysis
Inputs: contextId (required), limit, since, types, +1 more.
debug_get_dom_treeC
Get a structured representation of the DOM tree for analysis
Inputs: contextId (required), maxDepth, selector, includeText, +1 more.
debug_get_element_propertiesC
Get comprehensive properties of a specific element for deep debugging analysis
Inputs: selector (required), contextId (required), includeAttributes, includeDimensions, +4 more.
debug_get_page_sourceB
Get the current DOM HTML source for debugging
Inputs: contextId (required), pretty, includeDoctype.
debug_take_screenshotB
Take a screenshot of the current viewport or full page for visual debugging
Inputs: contextId (required), clip, format, quality, +2 more.
network_clear_requestsA
Clear stored network request data for a browser context to free memory
Inputs: contextId (required).
network_get_failed_requestsB
Get failed HTTP requests (4xx, 5xx, or connection failures) for debugging
Inputs: contextId (required), limit, since.
network_get_requestsC
Get HTTP network requests and responses for debugging and analysis
Inputs: contextId (required), limit, since, status, +2 more.
performance_get_core_vitalsC
Measure Core Web Vitals (LCP, FID, CLS) using browser performance observers
Inputs: contextId (required), timeout.
performance_get_metricsC
Collect Core Web Vitals and performance metrics from the current page
Inputs: contextId (required), includeResourceTiming.
storage_clear_dataC
Clear browser storage data by type (localStorage, sessionStorage, cookies)
Inputs: contextId (required), types, cookieDomain.
storage_get_cookiesB
Get cookies for the current page with all attributes (domain, path, expiry, security flags)
Inputs: contextId (required), name, domain.
storage_get_local_storageB
Get localStorage key/value pairs from the current page for debugging
Inputs: contextId (required), keys.
storage_get_session_storageB
Get sessionStorage key/value pairs from the current page for debugging
Inputs: contextId (required), keys.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 22 tools
Most tools are clearly separated by domain prefixes (storage_, debug_, console_, network_, performance_), but there are real overlaps: browser_navigate vs browser_navigate_safe, and performance_get_core_vitals vs performance_get_metrics (which explicitly also collects Core Web Vitals). The recovery cluster (browser_health_check, browser_force_recreate, browser_navigate_safe) also has fuzzy boundaries for an agent deciding which to call.
Every tool follows a consistent snake_case pattern of domain_verb_noun (browser_navigate, storage_get_cookies, debug_take_screenshot, console_clear_logs). Domain prefixes are used uniformly and make grouping predictable, with only trivial stylistic variance such as 'take_screenshot' vs 'get_*'.
22 tools is on the heavy side, but they distribute cleanly across six genuine capability areas (lifecycle, storage, debug, console, network, performance), so each earns roughly its place. A few recovery/health tools could arguably be folded into navigate/launch to slim the surface.
The read/debug surface is broad (DOM, console, network, storage, vitals, screenshots), but storage is read-and-clear only with no tool to set localStorage/sessionStorage/cookies, and there is no element selection/interaction or viewport control. For a pure debugging server these are workable gaps, but they create dead ends for common diagnostic workflows.
Maintenance
Related MCP Connectors
Live browser debugging for AI assistants โ DOM, console, network via MCP.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to debug frontend applications by providing direct access to browser DevTools, React state, DOM inspection, and runtime debugging capabilities. Bridges the gap between AI and complex web applications for autonomous debugging and issue resolution.1MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to inspect, debug, and test web pages using Playwright. Provides comprehensive DOM inspection, visibility debugging, layout validation, and element finding capabilities in real browser environments.3454 npm5MIT
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser for automated debugging, performance analysis, and web interaction. It leverages Puppeteer and Chrome DevTools to provide capabilities like network monitoring, console logging, and automated browser actions.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to inspect web pages, monitor network requests, extract HTML, analyze console output, and examine DOM elements in real-time through a Playwright-powered browser.21 npm7MIT