
Perfonext Render MCP
io.github.souvikdu由 GitHub 账号 souvikdu 发布v0.5.2更新于 Oct 24, 2026
MCP server for analyzing React Profiler exports: rerenders, commit spikes, slow components.
概览
一个本地 MCP 服务器,用于分析 Next.js 应用的 React 渲染行为,把实时采集会话或 React DevTools Profiler 导出转换为重渲染原因、慢组件和回归对比。
- 可以做什么
- 启动渲染分析会话:可从运行中的 React 应用实时采集,或从磁盘加载导出的 React DevTools Profiler JSON 文件;停止采集后生成带数据质量评级(精确或启发式)的剖析结果。汇总已加载的剖析:按渲染开销排序的组件、最热的提交以及检测到的渲染问题。对最昂贵的提交和最慢的组件排序,并在可用时标注源文件与行号。解释重渲染原因,附证据、置信度和风险评分;实时采集提供相应数据时给出精确变化的 props、state 和 hooks。对比两个已加载的剖析,列出回归、改进、新增和移除。
- 适用场景
- 适合在优化 Next.js 或 React 应用时使用,让助手基于结构化的渲染证据而非截图工作:找出慢组件、解释组件为何重渲染、定位提交尖峰,或在重构前后对比剖析结果。
- 运行要求
- 作为本地 stdio 进程运行,通常通过 npx 从 npm 包启动,因此需要 Node.js 以及下载该包的网络访问。实时采集会在本机固定端口(127.0.0.1:7721)启动接收服务器,并要求应用以启用性能剖析的方式构建(next dev 或 next build --profile)。未声明任何账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Perfonext Render MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
perfonext-render-mcp
Analyze React render behavior in Next.js apps and apply fixes in the editor.
[npm] [npm downloads] [license] [website]
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:
Or install globally:
The executable command remains perfonext-render-mcp after installation.
VS Code
Add the server to .vscode/mcp.json (the workspace MCP configuration file):
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:
Restart Claude Desktop to pick up the new server.
Claude Code
Add the server with the CLI:
Or 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.
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:
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 otherwise - annotates 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 actionable - compares two render profiles to surface regressions and improvements
- keeps profiles in memory so an MCP client can iterate without re-loading
Tools
Entry point
Live capture
Analysis
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 present - Write
instrumentation-client.jsat your project root with the session snippet - Import 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
Sample fixtures live under tests/fixtures/.
License
MIT
来源:README.md,提交 cd1876c
工具
0版本历史
1- v0.5.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分