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.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

一個本機 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 金鑰或環境變數。
安裝前請注意
即時擷取會改動專案:將 react-scan 安裝為開發相依套件,在專案根目錄寫入 instrumentation-client.js 並從用戶端進入點匯入,因此原始碼與相依套件會有所變動。擷取工作階段進行期間,React DevTools Timeline Profiler 收不到事件,直到停止擷取。接收伺服器使用固定的本機連接埠,可能與其他軟體衝突。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Perfonext Render MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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:

bash
npx -y @perfonext/render-mcp

Or install globally:

bash
npm install -g @perfonext/render-mcp

The executable command remains perfonext-render-mcp after installation.

VS Code

Add the server to .vscode/mcp.json (the workspace MCP configuration file):

json
{  "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:

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:

bash
claude mcp add perfonext-render -- npx -y @perfonext/render-mcp

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:

json
{  "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_capture restores 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 changeDescription data, 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

ToolDescription
begin_render_analysisEntry point. Accepts approach: "live" | "manual". For live: starts a capture session and returns the instrumentation snippet. For manual: returns React DevTools Profiler export steps.

Live capture

ToolDescription
run_render_captureCalled after instrumentation is wired up. Accepts method: "manual-interaction" | "test-suite". Returns focused instructions for whichever method the user picks.
stop_render_captureStop the session, finalize buffered events into a profile, and return a profileId plus dataQuality (exact | heuristic) for analysis
get_captured_rendersOptional diagnostic: peek at session progress without stopping (commit count, unknown events). Only call if something seems wrong.

Analysis

ToolDescription
load_render_profileParse and load an exported React DevTools Profiler JSON file from disk (manual path entry point)
get_render_summarySummarize a loaded profile: top components by render cost, hottest commits, and detected render issues
get_hot_commitsRank the most expensive commits and show the top components inside each spike
get_slow_componentsRank the slowest components by total actual render time
get_rerender_causesExplain rerender causes with evidence, confidence, and a risk score. Reports exact changed props/state/hooks when changeDescription data is present (dataQuality: "exact"), heuristics otherwise
compare_rendersDiff 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:

  1. Start a capture session (ingest server on 127.0.0.1:7721)
  2. Install react-scan as a devDependency if not present
  3. Write instrumentation-client.js at your project root with the session snippet
  4. Import it from your app's client-side entry point
  5. Ask whether you want to interact manually or run a test suite (run_render_capture)
  6. Stop the session and run analysis

Running a test suite? Use npx playwright test as usual. react-scan/lite installs __REACT_DEVTOOLS_GLOBAL_HOOK__ itself, so a visible window and the React DevTools extension are not required. The run still yields changeDescription data and dataQuality: "exact".

Two preconditions commonly cause a silent commitCount: 0:

  • Build flavor. A plain next build/next start compiles 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 --profile then next 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_summary surfaces 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 a useEffect, 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

  1. Open React DevTools in the browser → Profiler tab → Record
  2. Interact with the app
  3. Export the JSON and share the file path
  4. 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

Development

bash
npm installnpm run buildnpm test

Sample fixtures live under tests/fixtures/.

License

MIT

來源:README.md,提交 cd1876c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分