perfonext-render-mcp
Summary: Analyze React render behavior in Next.js apps via live capture or React DevTools exports, then act on the evidence with your MCP client.
Choose a path with
begin_render_analysis: live capture (react-scan/lite) or manual DevTools export.Collect live renders by wiring up instrumentation, running
run_render_capture(manual interaction or test suite), then stopping withstop_render_captureto get aprofileId.Load manual exports as an alternative via
load_render_profilefrom a React DevTools Profiler JSON file.Summarize profiles with
get_render_summary: top components by cost, hottest commits, and detected issues like rerender storms or commit spikes.Find hot commits with
get_hot_commits, ranking spikes and the top components in each, filterable by priority level.Rank slow components with
get_slow_componentsby total, average, or peak render time.Explain rerenders with
get_rerender_causes, including evidence, confidence, risk scores, and exact changed props/state/hooks when available.Compare profiles with
compare_rendersto surface regressions, improvements, additions, and removals.Check capture progress with
get_captured_rendersto diagnose stalls or miswired instrumentation without stopping the session.
Analyzes React render behavior in Next.js applications, providing structured profiling data on commits, component render costs, rerender causes, and regressions to guide performance fixes.
Provides deep React render analysis by consuming React DevTools Profiler exports or live capture data, surfacing component costs, exact rerender causes, and regression diffs.
perfonext-render-mcp
Analyze React render behavior in Next.js apps and apply fixes in the editor.
perfonext-render-mcp is a Model Context Protocol (MCP) server that gives GitHub Copilot, Claude Desktop,
Claude Code, and other MCP clients structured, machine-readable React render analysis for Next.js performance
work. It turns live capture sessions and React DevTools Profiler exports into component costs, exact rerender
causes, and regression diffs — evidence an MCP client can act on directly.
Quick Start
perfonext-render-mcp is a standard MCP stdio server, so it works with any MCP-compatible client
(GitHub Copilot in VS Code, Claude Desktop, Claude Code, Cursor, and others). Run it directly with npx:
npx -y @perfonext/render-mcpOr install globally:
npm install -g @perfonext/render-mcpThe executable command remains perfonext-render-mcp after installation.
VS Code
Add the server to .vscode/mcp.json (the workspace MCP configuration file):
{
"servers": {
"perfonext-render": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@perfonext/render-mcp"]
}
}
}Reload the VS Code window and run MCP: List Servers to start it, or accept the trust prompt when it appears.
Claude Desktop
Add the server to claude_desktop_config.json:
{
"mcpServers": {
"perfonext-render": {
"command": "npx",
"args": ["-y", "@perfonext/render-mcp"]
}
}
}Restart Claude Desktop to pick up the new server.
Claude Code
Add the server with the CLI:
claude mcp add perfonext-render -- npx -y @perfonext/render-mcpOr add the same mcpServers entry to .mcp.json.
Other MCP clients
Any client that supports stdio MCP servers can launch npx -y @perfonext/render-mcp. Consult your
client's documentation for its MCP server configuration format.
For a locally-built checkout, point command/args at node and the repo's dist/index.js instead.
Related MCP server: react-profiler-mcp
Troubleshooting
spawn npx ENOENT / spawn node ENOENT on macOS with nvm
If the server fails to start with this error, your GUI MCP client likely cannot see nvm. GUI apps on
macOS do not load shell config (.zshrc/.bashrc), so nvm-installed npx/node are not on PATH.
Use an absolute npx path and include the same Node directory in PATH:
{
"servers": {
"perfonext-render": {
"type": "stdio",
"command": "/Users/YOU/.nvm/versions/node/v<version>/bin/npx",
"args": ["-y", "@perfonext/render-mcp"],
"env": {
"PATH": "/Users/YOU/.nvm/versions/node/v<version>/bin:/usr/bin:/bin"
}
}
}
}Merge these fields into your client's server entry, under servers for VS Code or mcpServers for
Claude Desktop/Code. Then ask your assistant: "Run a render analysis on my app."
What It Does
perfonext-render-mcp is the agent companion to React DevTools Profiler and react-scan — best at
machine-readable summaries, exact rerender-cause attribution, source-aware follow-up, and diffing. The loop is
collect → analyze → fix, all locally:
collect — choose live capture (react-scan/lite streams events in real time) or manual DevTools export
analyze — the MCP returns structured, machine-readable evidence: component costs, rerender causes, commit breakdowns, and regressions
fix — your MCP client uses that evidence to propose and apply concrete code changes
Note: while a live capture session is active, React DevTools Timeline Profiler will not receive events (react-scan/lite takes over the profiling channel). Calling
stop_render_capturerestores it.
Capabilities:
live capture — streams per-commit fiber events from a running React app directly into the MCP over a local HTTP endpoint; no manual export required
manual export — loads exported React DevTools Profiler JSON files as an alternative input path
summarizes commits, the most expensive components, and detected render issues in one call
ranks the hottest commits and shows the top components inside each spike
identifies the slowest components by total render cost
highlights components with repeated rerenders, reporting the exact changed props/state/hooks when live capture provides
changeDescriptiondata, and falling back to deterministic heuristics otherwiseannotates ranked components with their source file and line when available
filters DOM host elements (
div,span, …) and unnamed components out of ranked output so findings stay actionablecompares two render profiles to surface regressions and improvements
keeps profiles in memory so an MCP client can iterate without re-loading
Tools
Entry point
Tool | Description |
| Entry point. Accepts |
Live capture
Tool | Description |
| Called after instrumentation is wired up. Accepts |
| Stop the session, finalize buffered events into a profile, and return a |
| Optional diagnostic: peek at session progress without stopping (commit count, unknown events). Only call if something seems wrong. |
Analysis
Tool | Description |
| Parse and load an exported React DevTools Profiler JSON file from disk (manual path entry point) |
| Summarize a loaded profile: top components by render cost, hottest commits, and detected render issues |
| Rank the most expensive commits and show the top components inside each spike |
| Rank the slowest components by total actual render time |
| Explain rerender causes with evidence, confidence, and a risk score. Reports exact changed props/state/hooks when |
| Diff two loaded render profiles and rank regressions, improvements, additions, and removals |
Usage Walkthrough
Ask your assistant: "Run a render analysis on my app."
Your MCP client calls begin_render_analysis and asks you to choose:
Option A — Live capture (recommended)
Your MCP client will:
Start a capture session (ingest server on
127.0.0.1:7721)Install
react-scanas a devDependency if not presentWrite
instrumentation-client.jsat your project root with the session snippetImport it from your app's client-side entry point
Ask whether you want to interact manually or run a test suite (
run_render_capture)Stop the session and run analysis
Running a test suite? Use
npx playwright testas usual.react-scan/liteinstalls__REACT_DEVTOOLS_GLOBAL_HOOK__itself, so a visible window and the React DevTools extension are not required. The run still yieldschangeDescriptiondata anddataQuality: "exact".
Two preconditions commonly cause a silent
commitCount: 0:
Build flavor. A plain
next build/next startcompiles out React's profiling hooks entirely. Choose one of:
next dev— real component names, but dev-mode overhead means render timings and proportions may not match what real users experience in production.
next build --profilethennext start— production-accurate timings, but component names get minified to 1-2 letters (e.g."V") by production minification, regardless of the profiling flag.get_render_summarysurfaces a warning when this is detected.Instrumentation timing.
instrument()must run before React initializes — a static top-level import (as shown in the generated snippet) works; mounting it as a React component, or calling it inside auseEffect, runs too late and silently captures nothing.
The ingest server runs on a fixed port (7721). Only the sessionId line in instrumentation-client.js changes between sessions — the file does not need to be re-wired each time.
Option B — Manual DevTools export
Open React DevTools in the browser → Profiler tab → Record
Interact with the app
Export the JSON and share the file path
Your MCP client calls
load_render_profile({ filePath: "..." })
Example Prompts
"Run a render analysis on my app."
"Stop the capture and show me the slowest components."
"Which components are re-rendering the most and why?"
"Compare this run to the profile I captured before the refactor."
"I already have a React DevTools export — load it and tell me what's slow."
"Show me the hottest commits and which components dominated each spike."
Related Perfonext Tools
perfonext-profiler-mcp — CPU profiling (V8/Chrome) for Next.js servers
perfonext-build-mcp — Next.js bundle/build analysis
Development
npm install
npm run build
npm testSample fixtures live under tests/fixtures/.
License
MIT
Available Tools
10 toolsbegin_render_analysisBegin Render AnalysisA
Entry point for render profiling. Choose an approach: live — react-scan/lite streams events in real time; exact rerender causes, source locations, changeDescription. manual — no install needed; user exports a JSON from the React DevTools Profiler tab and shares the file path. Ask the user which approach they prefer before calling this tool.
Inputs: approach (required).
compare_rendersCompare RendersA
Diff two loaded render profiles and rank the biggest regressions, improvements, additions, and removals.
Inputs: baseProfileId (required), currentProfileId (required), limit, minDeltaMs.
get_captured_rendersGet Captured RendersA
Optional diagnostic: peek at the live progress of a render-capture session without stopping it. Returns commit count, components seen, whether actualDuration is populating, and an unknownEvents count (non-zero = instrumentation may not be wired correctly). Only call this if something seems wrong — it is not a required step before stop_render_capture.
Inputs: sessionId (required).
get_hot_commitsGet Hot CommitsA
Rank the most expensive commits in a loaded render profile and show the top components inside each spike.
Inputs: profileId (required), limit, priorityLevel, componentLimit.
get_render_summaryGet Render SummaryA
Summarize the loaded Next.js render profile, including top components by render cost and detected render issues (rerender storms, commit spikes).
Inputs: limit, profileId.
get_rerender_causesGet Rerender CausesA
Highlight components with repeated rerenders and explain likely causes using heuristics derived from the exported profile.
Inputs: profileId (required), limit, minActualDuration.
get_slow_componentsGet Slow ComponentsA
Return the slowest components in a loaded Next.js render profile, ranked by total actual render time.
Inputs: profileId (required), limit, sortBy, minSelfDuration.
load_render_profileLoad Render ProfileA
Load a React DevTools Profiler JSON export. This is the entry point for the manual profiling path: open React DevTools in the browser → Profiler tab → Record → interact → Stop → Export JSON → share the file path here. Returns a profileId for use with get_render_summary, get_slow_components, get_rerender_causes, and the other analysis tools.
Inputs: filePath (required).
run_render_captureRun Render CaptureA
Called after instrumentation is wired up (steps 1–3 of begin_render_analysis). Ask the user how they want to generate renders before calling this tool: manual-interaction — start the dev server and the user clicks through the app. test-suite — run an existing automated test suite against the running app.
Inputs: method (required), sessionId (required).
stop_render_captureStop Render CaptureA
Stop a live render-capture session, finalize the buffered events into a render profile, and return a profileId you can use with get_render_summary, get_slow_components, get_rerender_causes, and compare_renders.
Inputs: sessionId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools are clearly separated by role: capture lifecycle (begin/run/stop/diagnostic), manual loading, and distinct analysis outputs. The main ambiguity is that both begin_render_analysis and load_render_profile are described as entry points for the manual path, and get_render_summary/get_hot_commits both mention commit spikes, though descriptions are specific enough to disambiguate.
All tool names follow a predictable snake_case verb_noun pattern. Analysis tools use get_ or compare_, capture lifecycle tools use begin/run/stop, and the manual path uses load_, so an agent can infer the role of each tool from its name.
Ten tools is well-scoped for a render-profiling server: there are enough tools to cover both manual and live capture workflows plus analysis, but none feel redundant or purely decorative. Each tool earns its place in a focused pipeline.
The core profiling workflows are well covered: manual JSON loading and live capture both lead to analysis tools, and compare_renders adds regression diffing. The only minor gaps are profile-management conveniences like listing loaded profiles or deleting them, and there is no deep single-commit flamegraph drill-down beyond get_hot_commits.
Maintenance
Related MCP Connectors
Session replay as readable transcripts: rage and dead clicks, JS errors, heatmaps. Open source.
Website performance monitoring: scans, Core Web Vitals, RUM data and alerts.
Ranked fixes from real users of your site: rage clicks, dead buttons, JS errors and slow pages.
Production telemetry for NestJS apps: traces, errors, regressions, jobs and alerts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides real-time debugging, code quality monitoring, and performance insights for React/Next.js applications with features including Chrome DevTools integration, breakpoint management, complexity analysis, and live error streaming.13 npm1MIT
- FlicenseNot gradedqualityDmaintenanceStreams live React profiler data to AI agents, enabling them to analyze performance and suggest specific, actionable fixes for slow components.3-
- AlicenseNot gradedqualityCmaintenanceEnables users to ask about render performance in React and React Native apps via natural language, exposing tools for listing render hotspots and explaining component re-renders.MIT
- AlicenseBqualityDmaintenanceMonitors Next.js development servers with intelligent error categorization, smart diagnostics, and performance tracking.8MIT