Perfonext Render MCP

v0.5.2
io.github.souvikdu/perfonext-render-mcp Checked 14 hours ago Published 2 months ago

MCP server for analyzing React Profiler exports: rerenders, commit spikes, slow components.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

load_render_profile Load Render Profile

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.

ParameterTypeDescription
filePath *stringAbsolute or relative path to the exported React Profiler JSON file

compare_renders Compare Renders

Diff two loaded render profiles and rank the biggest regressions, improvements, additions, and removals.

ParameterTypeDescription
baseProfileId *stringBaseline profile ID from load_render_profile
currentProfileId *stringCurrent profile ID from load_render_profile
limitintegerHow many changed components to include. Defaults to 10.
minDeltaMsnumberMinimum absolute total render delta in ms for changed components. Defaults to 0.

get_render_summary Get Render Summary

Summarize the loaded Next.js render profile, including top components by render cost and detected render issues (rerender storms, commit spikes).

ParameterTypeDescription
limitintegerHow many top components to include. Defaults to 10.
profileIdstringProfile ID from load_render_profile. Omit to list loaded profiles.

get_hot_commits Get Hot Commits

Rank the most expensive commits in a loaded render profile and show the top components inside each spike.

ParameterTypeDescription
profileId *stringProfile ID from load_render_profile
componentLimitintegerHow many top components to include per commit. Defaults to 3.
limitintegerHow many commits to include. Defaults to 10.
priorityLevelstringFilter to commits with this priority level only. Common values: "Immediate" (synchronous, input-blocking), "Normal" (async, e.g. API responses). Omit to include all priorities.

get_slow_components Get Slow Components

Return the slowest components in a loaded Next.js render profile, ranked by total actual render time.

ParameterTypeDescription
profileId *stringProfile ID from load_render_profile
limitintegerHow many components to return. Defaults to 10.
minSelfDurationnumberMinimum total self duration in ms to include — the same metric the default "total" sort ranks by, excluding time spent in children. Filters sub-millisecond noise. Defaults to 0.
sortBystringSort metric: "total" = total render time (default), "average" = average per render, "max" = peak single render time.

get_rerender_causes Get Rerender Causes

Highlight components with repeated rerenders and explain likely causes using heuristics derived from the exported profile.

ParameterTypeDescription
profileId *stringProfile ID from load_render_profile
limitintegerHow many components to include. Defaults to 10.
minActualDurationnumberMinimum total actual duration in ms for a component to appear — render time including its children, the same metric this tool ranks cost by. Filters sub-millisecond noise. Defaults to 0.

begin_render_analysis Begin Render Analysis

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.

ParameterTypeDescription
approach *string"live": react-scan/lite live capture (richer data, needs npm install). "manual": React DevTools Profiler JSON export (no install, less detailed).

run_render_capture Run Render Capture

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.

ParameterTypeDescription
method *string"manual-interaction": user navigates the app manually (fast, focused). "test-suite": run an existing test suite (automated; scope to one file/feature to keep payload manageable).
sessionId *stringThe sessionId returned by begin_render_analysis.

stop_render_capture Stop Render Capture

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.

ParameterTypeDescription
sessionId *stringThe sessionId returned by begin_render_analysis

get_captured_renders Get Captured Renders

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.

ParameterTypeDescription
sessionId *stringThe sessionId returned by begin_render_analysis