| name | chrome-devtools-mcp-automation |
| description | Expert guidance for Chrome DevTools MCP server - browser automation, debugging, and performance analysis for AI agents |
| triggers | ["automate chrome browser with devtools","debug web application with chrome devtools","analyze page performance with chrome","take screenshots and inspect network requests","record performance traces in chrome","control chrome browser from my agent","inspect browser console and errors","navigate and interact with web pages using puppeteer"] |
Chrome DevTools MCP Automation
Skill by ara.so — MCP Skills collection.
Chrome DevTools MCP (chrome-devtools-mcp) is a Model Context Protocol (MCP) server that gives AI coding agents full access to Chrome DevTools. It enables reliable browser automation via Puppeteer, advanced debugging (network inspection, console messages, screenshots), and performance analysis (trace recording, CrUX data).
Installation
As MCP Server (Standard Mode)
Add to your MCP client configuration (e.g., Cursor, Claude Code, Cline, VS Code):
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}
With options:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--no-usage-statistics",
"--no-performance-crux"
]
}
}
}
Slim Mode (Basic Browser Tasks Only)
For simpler automation without performance tools:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest", "--slim", "--headless"]
}
}
}
Connect to Existing Browser
To connect to an already-running Chrome instance (useful for tools like Antigravity):
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest",
"--browser-url=http://127.0.0.1:9222"
]
}
}
}
CLI Usage (Without MCP)
npm install -g chrome-devtools-mcp
chrome-devtools-mcp navigate --url https://example.com
chrome-devtools-mcp screenshot --output screenshot.png
chrome-devtools-mcp console-logs
Key Configuration Options
| Flag | Description |
|---|
--headless | Run Chrome in headless mode (no UI) |
--slim | Enable slim mode (basic tools only) |
--no-usage-statistics | Opt out of Google usage statistics collection |
--no-performance-crux | Disable Chrome UX Report (CrUX) API calls |
--browser-url=URL | Connect to existing Chrome instance at URL |
--user-data-dir=PATH | Use custom Chrome profile directory |
Environment Variables
export CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1
export CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1
export CI=true
Core Capabilities
1. Browser Navigation & Interaction
Navigate to a URL:
{
"url": "https://example.com",
"waitUntil": "networkidle0"
}
Click elements:
{
"selector": "button.submit",
"waitForNavigation": true
}
Fill forms:
{
"selector": "input[name='email']",
"text": "user@example.com",
"delay": 100
}
Extract page content:
{
"script": "document.querySelector('h1').textContent",
"returnByValue": true
}
2. Screenshots & Visual Inspection
Full page screenshot:
{
"fullPage": true,
"path": "./screenshots/page.png"
}
Element screenshot:
{
"selector": "div.product-card",
"path": "./element.png"
}
3. Network Inspection
Monitor network requests:
{
"filter": {
"type": "fetch",
"status": 200
}
}
Analyze failed requests:
{
"filter": {
"failed": true
}
}
4. Console & Debugging
Get console messages:
{
"level": "error"
}
Execute JavaScript in page context:
{
"script": `
const errors = [];
window.addEventListener('error', (e) => {
errors.push({ message: e.message, stack: e.error.stack });
});
errors;
`,
"returnByValue": true
}
5. Performance Analysis
Record performance trace:
{
"categories": ["devtools.timeline", "v8.execute", "disabled-by-default-v8.cpu_profiler"]
}
{
"path": "./traces/performance.json"
}
Get performance metrics:
{
"includeMemory": true
}
Analyze Core Web Vitals:
{
"url": "https://example.com",
"includeCrux": true
}
Common Patterns
Pattern 1: E2E Test Automation
{ "url": "https://app.example.com/login" }
{ "selector": "#username", "text": "testuser" }
{ "selector": "#password", "text": "secure_password" }
{ "selector": "button[type='submit']", "waitForNavigation": true }
{ "script": "window.location.pathname === '/dashboard'" }
{ "path": "./test-evidence/login-success.png" }
Pattern 2: Performance Audit
{ "categories": ["devtools.timeline", "loading", "blink.user_timing"] }
{ "url": "https://example.com/product/123", "waitUntil": "networkidle0" }
{ "path": "./audits/product-page-trace.json" }
{ "url": "https://example.com/product/123", "includeCrux": true }
{ "includeMemory": true }
Pattern 3: Debugging Production Issues
{ "url": "https://example.com/checkout" }
{ "filter": { "failed": true } }
{ "level": "error" }
{
"script": `
window.__errors = [];
window.addEventListener('error', (e) => {
__errors.push({
message: e.message,
filename: e.filename,
lineno: e.lineno,
colno: e.colno,
stack: e.error?.stack
});
});
setTimeout(() => __errors, 5000);
`,
"returnByValue": true
}
{ "fullPage": true, "path": "./debug/error-state.png" }
Pattern 4: Data Extraction (Web Scraping)
{ "url": "https://example.com/products" }
{ "selector": "div.product-list", "timeout": 5000 }
{
"script": `
Array.from(document.querySelectorAll('.product-card')).map(card => ({
title: card.querySelector('h3').textContent.trim(),
price: card.querySelector('.price').textContent.trim(),
url: card.querySelector('a').href,
inStock: !card.querySelector('.out-of-stock')
}))
`,
"returnByValue": true
}
{ "selector": "button.next-page", "waitForNavigation": true }
Pattern 5: Visual Regression Testing
{ "width": 1280, "height": 720, "deviceScaleFactor": 1 }
{ "url": "https://example.com/landing" }
{ "timeout": 2000 }
{
"fullPage": true,
"path": "./visual-tests/baseline.png"
}
{
"fullPage": true,
"path": "./visual-tests/current.png"
}
Troubleshooting
Browser Won't Start
Issue: MCP server fails with "Browser not found"
Solution:
export CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
npx @puppeteer/browsers install chrome@stable
Port Already in Use
Issue: "Port 9222 already in use"
Solution:
lsof -ti:9222 | xargs kill -9
Timeout Errors
Issue: "Navigation timeout of 30000 ms exceeded"
Solution:
{
"url": "https://slow-site.com",
"timeout": 60000,
"waitUntil": "domcontentloaded"
}
Headless Mode Issues
Issue: Site behaves differently in headless mode
Solution:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}
Memory Leaks in Long-Running Sessions
Issue: Chrome consumes excessive memory over time
Solution:
{}
Source Map Errors
Issue: Stack traces not showing original source
Solution:
{ "filter": { "type": "other" } }
Corporate Proxy/Firewall
Issue: Cannot download Chrome or connect to CrUX API
Solution:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
Requirements
- Node.js: v20.19 or newer (latest maintenance LTS)
- Chrome: Current stable version or newer
- npm: Any recent version
- OS: macOS, Linux, or Windows 11+
Privacy & Data Collection
- Usage Statistics: Enabled by default. Opt out with
--no-usage-statistics flag or CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1 env var.
- CrUX API: Performance tools may send trace URLs to Google CrUX API. Disable with
--no-performance-crux.
- Browser Data: All browser content is exposed to MCP clients. Do not use with sensitive/personal data you don't want to share.
Best Practices
- Use Slim Mode for Simple Tasks: If you only need navigation and screenshots, use
--slim to reduce startup time.
- Headless by Default in CI: Always use
--headless in automated environments.
- Set Timeouts Appropriately: Adjust navigation timeouts based on expected page load times.
- Clean Up Resources: For long-running scripts, periodically close the browser to free memory.
- Version Pin in Production: Use
chrome-devtools-mcp@X.Y.Z instead of @latest for reproducible builds.
- Monitor Network: Check
network-logs before assuming page load issues are browser-related.
- Leverage Source Maps: Deploy source maps in staging/test environments for better debugging.
Additional Resources