MCP server for analyzing V8/Chrome CPU profiles with line-level tick attribution.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Analyze V8 and Chrome CPU profiles to find hotspots in Next.js servers and scripts.
perfonext-profiler-mcp is a Model Context Protocol (MCP) server that gives GitHub Copilot, Claude Desktop,
Claude Code, and other MCP clients structured CPU profiling data for Next.js performance work. It loads V8 and
Chrome CPU profiles and turns them into hotspot rankings, per-package costs, and source-annotated hot lines β
evidence agents can reason over instead of ingesting multi-megabyte profile dumps.
perfonext-profiler-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-profiler-mcp after installation.
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.
Add the server to claude_desktop_config.json:
Restart Claude Desktop to pick up the new server.
Add the server with the CLI:
Or add the same mcpServers entry to .mcp.json.
Any client that supports stdio MCP servers can launch npx -y @perfonext/profiler-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.
spawn npx ENOENT / spawn node ENOENT on macOS with nvmIf 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: "How do I capture a CPU profile of my Next.js server?"
.cpuprofile files and Chrome trace exports that contain CPU profile data| Tool | Description |
|---|---|
how_to_collect | Return a ready-to-run command and step-by-step recipe for capturing a .cpuprofile, then loading it. Use this when you don't have a profile yet |
load_profile | Parse and load a .cpuprofile file or Chrome trace export from disk |
get_hotspots | Find top functions by self-time. Each entry includes a package field identifying the npm package or (user code) |
explain_function | Explain a function's timing, callers, and callees. Pass includeSource: true to attach annotated source lines |
read_source_context | Read the actual source file for a hot function and annotate each line with tick counts from positionTicks |
get_package_costs | Aggregate CPU self-time by npm package β shows which dependencies are most expensive |
compare_profiles | Compare two profiles and highlight regressions |
suggest_optimizations | Generate structured, multi-pattern optimization suggestions for hot functions. Detects high fan-in, recursion, dominant callers, and V8-specific patterns. Deduplicates functions split across multiple call sites |
get_profile_summary | Summarize one profile or list all loaded profiles |
Every tool result carries a nextStep breadcrumb pointing at the natural follow-up call, so an MCP client can walk the collect β analyze β fix loop without guessing.
./profile.cpuprofile and show me the top hotspots."processData is expensive in the loaded profile."processData and mark which lines are hottest."transformResult and include the annotated source code."how_to_collect detailsnext-server profiles a production Next.js server while it serves a single request. If next start says standalone output is unsupported, use the script scenario with .next/standalone/server.js. script profiles that standalone server (or another Node entry). Keep the scenario to one route and one hit. Node writes one .cpuprofile per process/worker thread into the output directory. The Next server command uses Node CLI flags (not NODE_OPTIONS) so it is the same on Unix and Windows.
read_source_context detailsThe returned window is sized to cover the function's actual hot lines, not just a fixed radius
around its declaration β a function's real bottleneck is often well past its function line.
contextLines (default 10) sets the minimum padding around both the declaration and the hot
lines; if any ticks still fall outside the returned window, the top-level result includes
hiddenTicks (a count) and a warning telling you to retry with a larger contextLines.
explain_function also accepts contextLines when called with includeSource: true.
Only files inside the current working directory can be read. file:// URLs and absolute paths are both handled; http://, node: builtins, and paths outside the project root are rejected.
suggest_optimizations detailsNo reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/perfonext-profiler-mcp)<a href="https://allmcps.com/mcp/perfonext-profiler-mcp"><img src="https://allmcps.com/api/badge/perfonext-profiler-mcp?style=directory" alt="Perfonext Profiler MCP on AllMCPs" /></a>