@perfonext/render-mcp 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +73 -12
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -9,11 +9,12 @@
9
9
  `perfonext-render-mcp` is a Model Context Protocol (MCP) server that gives GitHub Copilot, Claude Desktop,
10
10
  Claude Code, and other MCP clients structured, machine-readable React render analysis for Next.js performance
11
11
  work. It turns live capture sessions and React DevTools Profiler exports into component costs, exact rerender
12
- causes, and regression diffs — evidence Copilot can act on directly.
12
+ causes, and regression diffs — evidence an MCP client can act on directly.
13
13
 
14
14
  ## Quick Start
15
15
 
16
- Run directly with `npx`:
16
+ `perfonext-render-mcp` is a standard MCP stdio server, so it works with any MCP-compatible client
17
+ (GitHub Copilot in VS Code, Claude Desktop, Claude Code, Cursor, and others). Run it directly with `npx`:
17
18
 
18
19
  ```bash
19
20
  npx -y @perfonext/render-mcp
@@ -27,7 +28,9 @@ npm install -g @perfonext/render-mcp
27
28
 
28
29
  The executable command remains `perfonext-render-mcp` after installation.
29
30
 
30
- Add the server to VS Code in `.vscode/mcp.json` (the workspace MCP configuration file):
31
+ ### VS Code
32
+
33
+ Add the server to `.vscode/mcp.json` (the workspace MCP configuration file):
31
34
 
32
35
  ```json
33
36
  {
@@ -41,9 +44,67 @@ Add the server to VS Code in `.vscode/mcp.json` (the workspace MCP configuration
41
44
  }
42
45
  ```
43
46
 
44
- Then reload the VS Code window and run **MCP: List Servers** to start it, or accept the trust prompt when it appears. For a locally-built checkout, point `command`/`args` at `node` and the repo's `dist/index.js` instead.
47
+ Reload the VS Code window and run **MCP: List Servers** to start it, or accept the trust prompt when it appears.
48
+
49
+ ### Claude Desktop
50
+
51
+ Add the server to `claude_desktop_config.json`:
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "perfonext-render": {
57
+ "command": "npx",
58
+ "args": ["-y", "@perfonext/render-mcp"]
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ Restart Claude Desktop to pick up the new server.
65
+
66
+ ### Claude Code
67
+
68
+ Add the server with the CLI:
69
+
70
+ ```bash
71
+ claude mcp add perfonext-render -- npx -y @perfonext/render-mcp
72
+ ```
73
+
74
+ Or add the same `mcpServers` entry to `.mcp.json`.
75
+
76
+ ### Other MCP clients
77
+
78
+ Any client that supports stdio MCP servers can launch `npx -y @perfonext/render-mcp`. Consult your
79
+ client's documentation for its MCP server configuration format.
80
+
81
+ For a locally-built checkout, point `command`/`args` at `node` and the repo's `dist/index.js` instead.
82
+
83
+ ## Troubleshooting
84
+
85
+ ### `spawn npx ENOENT` / `spawn node ENOENT` on macOS with nvm
86
+
87
+ If the server fails to start with this error, your GUI MCP client likely cannot see nvm. GUI apps on
88
+ macOS do not load shell config (`.zshrc`/`.bashrc`), so nvm-installed `npx`/`node` are not on `PATH`.
89
+ Use an absolute `npx` path and include the same Node directory in `PATH`:
90
+
91
+ ```json
92
+ {
93
+ "servers": {
94
+ "perfonext-render": {
95
+ "type": "stdio",
96
+ "command": "/Users/YOU/.nvm/versions/node/v<version>/bin/npx",
97
+ "args": ["-y", "@perfonext/render-mcp"],
98
+ "env": {
99
+ "PATH": "/Users/YOU/.nvm/versions/node/v<version>/bin:/usr/bin:/bin"
100
+ }
101
+ }
102
+ }
103
+ }
104
+ ```
45
105
 
46
- Then ask Copilot: _"Run a render analysis on my app."_
106
+ Merge these fields into your client's server entry, under `servers` for VS Code or `mcpServers` for
107
+ Claude Desktop/Code. Then ask your assistant: _"Run a render analysis on my app."_
47
108
 
48
109
  ## What It Does
49
110
 
@@ -53,7 +114,7 @@ machine-readable summaries, exact rerender-cause attribution, source-aware follo
53
114
 
54
115
  - **collect** — choose live capture (react-scan/lite streams events in real time) or manual DevTools export
55
116
  - **analyze** — the MCP returns structured, machine-readable evidence: component costs, rerender causes, commit breakdowns, and regressions
56
- - **fix** — Copilot uses that evidence to propose and apply concrete code changes
117
+ - **fix** — your MCP client uses that evidence to propose and apply concrete code changes
57
118
 
58
119
  > **Note:** while a live capture session is active, React DevTools Timeline Profiler will not receive events
59
120
  > (react-scan/lite takes over the profiling channel). Calling `stop_render_capture` restores it.
@@ -70,7 +131,7 @@ Capabilities:
70
131
  - annotates ranked components with their source file and line when available
71
132
  - filters DOM host elements (`div`, `span`, …) and unnamed components out of ranked output so findings stay actionable
72
133
  - compares two render profiles to surface regressions and improvements
73
- - keeps profiles in memory so Copilot can iterate without re-loading
134
+ - keeps profiles in memory so an MCP client can iterate without re-loading
74
135
 
75
136
  ## Tools
76
137
 
@@ -101,13 +162,13 @@ Capabilities:
101
162
 
102
163
  ## Usage Walkthrough
103
164
 
104
- Ask Copilot: _"Run a render analysis on my app."_
165
+ Ask your assistant: _"Run a render analysis on my app."_
105
166
 
106
- Copilot calls `begin_render_analysis` and asks you to choose:
167
+ Your MCP client calls `begin_render_analysis` and asks you to choose:
107
168
 
108
169
  **Option A — Live capture (recommended)**
109
170
 
110
- Copilot will:
171
+ Your MCP client will:
111
172
 
112
173
  1. Start a capture session (ingest server on `127.0.0.1:7721`)
113
174
  2. Install `react-scan` as a devDependency if not present
@@ -140,9 +201,9 @@ The ingest server runs on a **fixed port (7721)**. Only the `sessionId` line in
140
201
  1. Open React DevTools in the browser → Profiler tab → Record
141
202
  2. Interact with the app
142
203
  3. Export the JSON and share the file path
143
- 4. Copilot calls `load_render_profile({ filePath: "..." })`
204
+ 4. Your MCP client calls `load_render_profile({ filePath: "..." })`
144
205
 
145
- ## Example Copilot Prompts
206
+ ## Example Prompts
146
207
 
147
208
  - "Run a render analysis on my app."
148
209
  - "Stop the capture and show me the slowest components."
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { registerStopRenderCapture } from './tools/stop-render-capture.js';
13
13
  import { registerGetCapturedRenders } from './tools/get-captured-renders.js';
14
14
  const server = new McpServer({
15
15
  name: 'perfonext-render-mcp',
16
- version: '0.4.0',
16
+ version: '0.4.1',
17
17
  });
18
18
  registerLoadRenderProfile(server);
19
19
  registerCompareRenders(server);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfonext/render-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for analyzing Next.js React Profiler exports: render summaries, rerender causes, hot commits, and profile diffing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",