
chrome-devtools-automation
Control Chrome browser through MCP for testing, debugging, network analysis, and performance profili
Chrome DevTools Automation Skill
Production-ready browser automation, debugging, and performance analysis using Chrome DevTools MCP
<p align="center"> <strong>Simple β’ Powerful β’ Fast</strong><br> Control Chrome, analyze performance, debug issuesβall from Claude. </p>π Quick Start (60 seconds)
# 1. Install Chrome DevTools MCP
npm install -g chrome-devtools-mcp@latest
# 2. Start dev server
pnpm dev
# 3. Trigger skill via Claude Code
User: "Test homepage with Chrome DevTools"
Claude: [Runs smoke test playbook]
Result: Homepage tested, console checked, network monitored, screenshot captured β
π What You Get
β Browser Automation - Navigate, click, fill, interact with any page
β Performance Analysis - Record traces, measure Core Web Vitals, get AI insights
β Network Debugging - Monitor API calls, inspect requests/responses, check failures
β Console Monitoring - Catch JavaScript errors, warnings, logs
β Visual Evidence - Screenshot pages and specific elements
β Multi-tab Support - Test complex workflows across tabs
β Network Emulation - Test on Slow 3G, Fast 4G, Offline
β CPU Throttling - Simulate low-end devices
π― Use Cases
1. Smoke Test (1 minute)
What: Quick health check - page loads, no errors
Command:
User: "Run smoke test on homepage"
What happens:
- Navigate to http://localhost:8080
- Check console for errors
- Monitor network requests
- Capture screenshot
Output: β or β with details
2. Performance Analysis (5 minutes)
What: Measure Core Web Vitals, get optimization tips
Command:
User: "Analyze performance of dashboard"
What happens:
- Record performance trace
- Navigate to /dashboard
- Measure LCP, CLS, FID
- Get AI-powered insights
Output:
Performance Insights:
- LCP: 2.1s (caused by slow image load)
β Recommendation: Optimize images, use WebP
- CLS: 2 layout shifts (from dynamic content)
β Recommendation: Reserve space for content
- Render blocking: 1 CSS file
β Recommendation: Inline critical CSS
3. Network Debugging (3 minutes)
What: Check API calls, find failures
Command:
User: "Debug network requests for pitch deck wizard"
What happens:
- Navigate to /pitch-deck-wizard
- Monitor all fetch/XHR requests
- Check for 4xx/5xx errors
- Inspect specific API calls
Output:
Network: 8 requests, 1 failed
Failed: POST /functions/v1/chat β 401 Unauthorized
π Project Structure
.claude/skills/chrome-dev-skill/
βββ SKILL.md # Main skill instructions (YAML + body)
βββ README.md # This file
βββ RUNBOOK.md # Setup & troubleshooting
βββ FEATURES.md # Complete feature reference
βββ skill-handler.ts # TypeScript implementation
β
βββ playbooks/ # Ready-to-run test scenarios
βββ smoke.txt # 1-min health check
βββ auth.txt # 3-min auth flow
βββ performance.txt # 5-min performance analysis
.claude/agents/eventos-chrome-agent/
βββ agent.config.json # Agent configuration
π οΈ Installation
Prerequisites
- Node.js 22+
- Chrome browser (latest)
- Dev server running on port 8080
Setup
# 1. Install Chrome DevTools MCP
npm install -g chrome-devtools-mcp@latest
# 2. Verify installation
npx chrome-devtools-mcp@latest --version
# 3. Test connection
npx chrome-devtools-mcp@latest
# Should see: "MCP server listening"
# 4. Start dev server
cd /home/sk/medellin-spark
pnpm dev
π Available Tests
1. Smoke Test (1 min)
Tests:
- Homepage loads
- No console errors
- Network requests succeed
Trigger:
"Run smoke test"
"Check if homepage works"
"Test basic functionality"
Playbook: playbooks/smoke.txt
2. Auth Flow (3 min)
Tests:
- Login form works
- Redirect after login
- Protected routes accessible
- Session persists
Trigger:
"Test authentication"
"Check login flow"
"Verify auth works"
Playbook: playbooks/auth.txt
3. Performance Trace (5 min)
Tests:
- Core Web Vitals (LCP, CLS, FID)
- Render-blocking resources
- Network performance
- Slow CSS selectors
Trigger:
"Analyze performance"
"Check Core Web Vitals"
"Profile dashboard load time"
Playbook: playbooks/performance.txt
π¬ Example Output
Smoke Test
π Starting smoke test...
Step 1: Navigate to homepage
β
Homepage loaded (524ms)
Step 2: Check console
β
No console errors
Step 3: Check network
Network: 12 total, 3 API calls
β
All API calls successful
Step 4: Screenshot
πΈ Saved: smoke-test-homepage.png
β
Smoke test passed!
Performance Analysis
π Starting performance trace...
β
Page loaded - trace recording...
βΉοΈ Stopping trace...
β
Trace complete
π Analyzing LCP (Largest Contentful Paint)...
LCP Insight: LCP at 2.1s caused by slow image load
π Analyzing CLS (Cumulative Layout Shift)...
CLS Insight: 2 layout shifts from dynamic content
π Analyzing Render Blocking...
Render Blocking: 1 CSS file blocking render
============================================================
β
PERFORMANCE TRACE COMPLETE
============================================================
Key Findings:
- LCP: 2.1s (caused by slow image load)
- CLS: 2 layout shifts (from dynamic content)
- Render Blocking: 1 CSS file
π‘ Recommendations:
1. Optimize images (use WebP, lazy loading)
2. Reserve space for dynamic content
3. Inline critical CSS or defer non-critical
π€ Using the Agent
The eventos-chrome-agent provides autonomous test execution:
Trigger phrases:
- "test with chrome devtools"
- "analyze performance"
- "check core web vitals"
- "debug browser issues"
- "inspect network requests"
Example:
User: "Test pitch deck wizard with Chrome DevTools"
Agent:
1. Navigates to /pitch-deck-wizard
2. Takes snapshot of page
3. Checks console for errors
4. Monitors network requests
5. Captures screenshots
6. Reports findings
ποΈ Features Overview
Core Features (Essential)
| Feature | Use Case | Example |
|---|---|---|
navigate_page | Go to URLs | Test homepage |
take_snapshot | Get page structure | Find element UIDs |
click | Click elements | Submit form |
fill | Enter text | Fill login form |
take_screenshot | Visual evidence | Capture error state |
list_console_messages | Check JS errors | Find bugs |
list_network_requests | Monitor API | Debug failures |
Advanced Features
| Feature | Use Case | Example |
|---|---|---|
performance_start_trace | Profile performance | Measure Core Web Vitals |
performance_analyze_insight | Get AI tips | Optimize LCP |
emulate_network | Test slow connections | Slow 3G simulation |
emulate_cpu | Test low-end devices | 4x CPU throttle |
get_network_request | Inspect API | Check request payload |
evaluate_script | Run custom JS | Extract data |
Complete reference: FEATURES.md
π Performance Benchmarks
| Test | Duration | Coverage |
|---|---|---|
| Smoke Test | 1 min | Basic health check |
| Auth Flow | 3 min | Login/logout/session |
| Performance Trace | 5 min | Core Web Vitals + AI insights |
Target SLAs:
- Smoke test pass rate: 100% (must always pass)
- Performance analysis: <5 min per page
- Network debugging: <2 min to find issue
π Troubleshooting
Common issues and quick fixes:
Chrome won't start
pkill -f chrome
npx chrome-devtools-mcp@latest
Element not found
1. Take snapshot first
2. Find correct UID
3. Ensure page loaded
Performance trace failed
1. Use autoStop: true
2. Wait after navigation
3. Check Chrome memory
Network requests missing
1. Filter by resourceTypes: ["fetch", "xhr"]
2. Wait after action
3. Verify request actually fired
Complete guide: RUNBOOK.md
π Learning Resources
Start here:
- README.md - This overview
- SKILL.md - Core instructions and patterns
- playbooks/smoke.txt - Simplest example
Go deeper: 4. FEATURES.md - Complete feature reference 5. playbooks/performance.txt - Performance analysis 6. RUNBOOK.md - Setup and troubleshooting
π€ Contributing
Adding a test:
- Create playbook in
playbooks/my-test.txt - Test locally:
cat playbooks/my-test.txt | npx chrome-devtools-mcp@latest - Update README
- Submit PR
π Chrome DevTools MCP vs Playwright MCP
| Aspect | Chrome DevTools | Playwright |
|---|---|---|
| Performance | β Built-in traces + AI | β No native tools |
| Cross-browser | Chrome only | Chrome, Firefox, Safari |
| Network | β Deep inspection | β Basic monitoring |
| Best For | Performance work, debugging | Cross-browser E2E tests |
Recommendation: Use Chrome DevTools for performance. Use Playwright for cross-browser testing.
π License
MIT - See project root for license details
π Support
Need help?
- Check SKILL.md for usage patterns
- Check RUNBOOK.md for troubleshooting
- Review FEATURES.md for complete reference
- Check playbooks/ for examples
Found a bug?
- Capture screenshots
- Save console logs
- Document steps to reproduce
- File GitHub issue
π Official Resources
- GitHub: https://github.com/ChromeDevTools/chrome-devtools-mcp
- Chrome Blog: https://developer.chrome.com/blog/chrome-devtools-mcp
- NPM: https://www.npmjs.com/package/chrome-devtools-mcp
Version: 0.8.1 (Public Preview)
<p align="center"> <strong>Built following Anthropic Claude Skills best practices</strong><br> <em>Simple, powerful, and fast browser automation</em> </p>