| name | Chrome DevTools Automation |
| description | Control Chrome browser through MCP for testing, debugging, network analysis, and performance profiling. Use when testing web apps, measuring Core Web Vitals, analyzing network requests, debugging console errors, or when the user mentions Chrome DevTools, performance traces, or browser automation. |
| version | 1.0.0 |
Chrome DevTools Automation
Quick Start
Control a live Chrome browser using Chrome DevTools MCP:
- Navigate to pages
- Take snapshot to see page structure (with UIDs)
- Click/fill elements using UIDs from snapshot
- Capture screenshots for evidence
- Check console/network for errors
- Record performance traces for optimization
Basic Pattern
await chrome.navigate_page({ url: "http://localhost:8080/dashboard" });
const snapshot = await chrome.take_snapshot();
await chrome.fill({ uid: "input-123", value: "Test Event" });
await chrome.click({ uid: "button-456" });
await chrome.take_screenshot({ filename: "dashboard.png" });
const errors = await chrome.list_console_messages();
if (errors.length > 0) {
console.error("Console errors found:", errors);
}
const requests = await chrome.list_network_requests({
resourceTypes: ["fetch", "xhr"]
});
console.log(`API calls: ${requests.length}`);
Available Playbooks
Choose the right playbook for your task:
Smoke test (1 min) - Quick health check
Auth flow (3 min) - Authentication testing
Performance trace (5 min) - Core Web Vitals analysis
Core Tools
Essential (use in 90% of tasks)
| Tool | Purpose | Example |
|---|
navigate_page | Go to URL | navigate_page({ url: "/dashboard" }) |
take_snapshot | Get element tree with UIDs | take_snapshot() |
click | Click element | click({ uid: "btn-123" }) |
fill | Enter text/select | fill({ uid: "input-456", value: "text" }) |
take_screenshot | Capture page/element | take_screenshot({ filename: "step1.png" }) |
list_console_messages | Check errors | list_console_messages() |
list_network_requests | Monitor API calls | list_network_requests() |
Advanced (use when needed)
Deep Debugging:
get_network_request - Get specific API request/response
evaluate_script - Run JavaScript in page
list_processes / kill_process - Process management
Performance:
performance_start_trace - Begin profiling
performance_stop_trace - End profiling
performance_analyze_insight - Get AI insights
Testing Conditions:
emulate_network - Throttle network (Slow 3G, Fast 4G, etc.)
emulate_cpu - Throttle CPU (1-20x slowdown)
Multi-page:
list_pages / new_page / close_page / select_page - Tab management
Advanced Forms:
fill_form - Fill multiple fields
hover / drag / upload_file - Complex interactions
handle_dialog - Alert/confirm handling
Best Practices
1. Always Snapshot First
const snapshot = await chrome.take_snapshot();
await chrome.click({ uid: "button-123" });
await chrome.click({ uid: "unknown" });
2. Check Console After Actions
await chrome.click({ uid: "submit" });
const errors = await chrome.list_console_messages();
if (errors.length > 0) {
throw new Error(`Console errors: ${errors.length}`);
}
3. Monitor Critical API Calls
await chrome.click({ uid: "generate-deck" });
const requests = await chrome.list_network_requests({
resourceTypes: ["fetch"]
});
const apiCall = await chrome.get_network_request({
url: "/functions/v1/generate-pitch-deck"
});
console.log("API Status:", apiCall.status);
console.log("Response:", apiCall.response);
4. Use Performance Traces for Key Flows
await chrome.performance_start_trace({ reload: true, autoStop: true });
await chrome.performance_stop_trace();
const lcp = await chrome.performance_analyze_insight({
insightName: "LCPBreakdown"
});
console.log("LCP Issues:", lcp);
5. Reset Emulation After Tests
await chrome.emulate_network({ throttlingOption: "Slow 3G" });
await chrome.emulate_network({ throttlingOption: "No emulation" });
await chrome.emulate_cpu({ throttlingRate: 1 });
Common Workflows
Testing a Form Submission
await chrome.navigate_page({ url: "http://localhost:8080/events/new" });
const snapshot = await chrome.take_snapshot();
await chrome.fill({ uid: "input-title", value: "Tech Summit 2025" });
await chrome.fill({ uid: "input-date", value: "2025-06-15" });
await chrome.click({ uid: "button-submit" });
await chrome.wait_for({ text: "Event created" });
const requests = await chrome.list_network_requests();
const createRequest = requests.find(r => r.url.includes("/api/events"));
console.log("Create event status:", createRequest.status);
Analyzing Performance
await chrome.performance_start_trace({ reload: true, autoStop: true });
await chrome.navigate_page({ url: "http://localhost:8080/dashboard" });
await chrome.performance_stop_trace();
const insights = [
await chrome.performance_analyze_insight({ insightName: "LCPBreakdown" }),
await chrome.performance_analyze_insight({ insightName: "CLSCulprits" }),
await chrome.performance_analyze_insight({ insightName: "RenderBlocking" })
];
console.log("Performance Insights:", insights);
Testing on Slow Network
await chrome.emulate_network({ throttlingOption: "Slow 3G" });
await chrome.navigate_page({ url: "http://localhost:8080/presentations" });
const requests = await chrome.list_network_requests();
const pageLoad = requests.find(r => r.type === "document");
console.log(`Load time on Slow 3G: ${pageLoad.duration}ms`);
await chrome.emulate_network({ throttlingOption: "No emulation" });
Troubleshooting
Element not found
- Run
take_snapshot() to see current page structure
- Check element UID is correct
- Verify element is visible (not hidden by CSS)
Performance trace failed
- Ensure page loaded before stopping trace
- Check Chrome has enough memory
- Use
autoStop: true for automatic completion
Network request missing
- Verify request actually fired (check DevTools manually)
- Check timing - request might not have completed yet
- Filter by
resourceTypes to narrow search
Dialog blocking test
- Handle dialogs immediately with
handle_dialog
- Use
handle_dialog({ accept: true }) or { accept: false }
Reference
Complete tool list: See FEATURES.md
Performance insights: LCPBreakdown, CLSCulprits, DocumentLatency, RenderBlocking, SlowCSSSelector
Network throttling: No emulation, Offline, Slow 3G, Fast 3G, Slow 4G, Fast 4G
Official docs: https://github.com/ChromeDevTools/chrome-devtools-mcp