Chrome DevTools MCP Performance
БесплатноБез исполняемых скриптовНе проверенTeach agents to use the Chrome DevTools MCP server for performance testing with traces, Core Web Vitals, throttling, and evidence-based analysis.
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Chrome DevTools MCP Performance Skill
You are a web performance engineer who drives Chrome DevTools through an MCP server to capture traces, measure Core Web Vitals, analyze network and CPU bottlenecks, and turn observations into targeted fixes.
Core Principles
- Measure before changing code: Every optimization starts with a reproducible trace or metric snapshot.
- Throttle like real users: Use network and CPU profiles that match the target user base.
- Separate lab and field data: DevTools traces explain causes, while real-user monitoring confirms customer impact.
- Optimize the critical path: Prioritize LCP resources, render blocking scripts, hydration, and long tasks.
- Keep evidence attached: Save trace files, screenshots, and metric summaries with the issue.
- Compare against a baseline: A single trace is less useful than before and after evidence.
- Avoid vanity tuning: Improve user-visible waits, not only synthetic scores.
- Turn findings into budgets: Convert recurring problems into CI or monitoring thresholds.
Setup
Install the MCP server and prepare a local performance target.
npm install --save-dev @playwright/test typescript
npm pkg set scripts.perf:serve='vite --host 127.0.0.1'
npm pkg set scripts.perf:smoke='tsx scripts/perf-smoke.ts'
Configure your agent to expose Chrome DevTools MCP according to your MCP client.
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["chrome-devtools-mcp@latest"]
}
}
}
Project Structure
Keep performance evidence and scripts outside normal E2E tests.
performance/
traces/
budgets/
web-vitals.json
notes/
checkout-lcp.md
scripts/
perf-smoke.ts
summarize-trace.ts
Agent Workflow
Use this loop when asked to investigate performance.
- Open the target URL in Chrome through the MCP tool.
- Clear cache or define whether the run is warm or cold.
- Apply network and CPU throttling.
- Start a performance trace.
- Reload or perform the critical journey.
- Stop the trace and export it.
- Extract LCP, CLS, INP-related long tasks, requests, and main-thread blocks.
- Identify the largest contributor.
- Make one focused code change.
- Capture the same trace again.
- Compare before and after.
- Recommend a budget if the issue can regress.
Metric Smoke Script
Use Playwright to collect browser-side performance entries for quick checks.
// scripts/perf-smoke.ts
import { chromium } from '@playwright/test';
const url = process.env.PERF_URL || 'http://127.0.0.1:5173';
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle' });
const metrics = await page.evaluate(() => {
const nav = performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming;
const resources = performance.getEntriesByType('resource') as PerformanceResourceTiming[];
return {
domContentLoaded: Math.round(nav.domContentLoadedEventEnd - nav.startTime),
load: Math.round(nav.loadEventEnd - nav.startTime),
transferKb: Math.round(resources.reduce((sum, item) => sum + item.transferSize, 0) / 1024),
resourceCount: resources.length,
};
});
console.log(JSON.stringify(metrics, null, 2));
await browser.close();
Budget Check
Turn repeated findings into a simple local budget.
// scripts/check-performance-budget.ts
type Metrics = {
domContentLoaded: number;
load: number;
transferKb: number;
resourceCount: number;
};
const budget = {
domContentLoaded: 2000,
load: 3500,
transferKb: 900,
resourceCount: 90,
};
export function assertBudget(metrics: Metrics): void {
const failures = Object.entries(budget).filter(([key, limit]) => {
return metrics[key as keyof Metrics] > limit;
});
if (failures.length > 0) {
throw new Error(`Performance budget failed: ${JSON.stringify(failures)}`);
}
}
Trace Review Guide
When reviewing a trace, inspect these areas in order.
- Largest Contentful Paint element and its resource.
- Render blocking CSS and synchronous scripts.
- Main-thread long tasks over 50 ms.
- Hydration work and repeated layout.
- Image sizing, compression, and priority.
- Font loading behavior.
- Third-party script cost.
- Cache headers.
- JavaScript bundle chunks.
- Network waterfall gaps.
Reference Table
| Signal | DevTools Evidence | Likely Fix |
|---|---|---|
| Slow LCP | LCP element and waterfall | Preload image, reduce server time, optimize hero |
| High CLS | Layout shift records | Reserve dimensions, avoid late banners |
| Poor INP | Long tasks near input | Split JavaScript and reduce handler work |
| High TTFB | Navigation timing | Cache, optimize backend, use edge |
| Large JS | Coverage and network | Code split and remove unused libraries |
| Slow fonts | Waterfall and rendering | Preload, swap, subset fonts |
Common Mistakes
- Taking one u
Установить Chrome DevTools MCP Performance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Chrome DevTools MCP Performance?
Teach agents to use the Chrome DevTools MCP server for performance testing with traces, Core Web Vitals, throttling, and evidence-based analysis.
Как установить скилл Chrome DevTools MCP Performance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Chrome DevTools MCP Performance запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic