GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
MCP server for Next.js build stats, chunk attribution, and bundle optimization advice.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"perfonext-build": {
"command": "npx",
"args": [
"-y",
"@perfonext/build-mcp"
]
}
}
}在终端中运行这条命令
claude mcp add perfonext-build -- npx -y @perfonext/build-mcp粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"perfonext-build": {
"command": "npx",
"args": [
"-y",
"@perfonext/build-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"perfonext-build": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@perfonext/build-mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
注册名称已通过 GitHub 账户 souvikdu 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.6.2)于2个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Analyze Next.js build artifacts to find heavy routes, shared chunks, and bundle growth.
perfonext-build-mcp is a Model Context Protocol (MCP) server that gives GitHub Copilot, Claude Desktop, Claude Code, and other MCP clients structured bundle analysis for Next.js performance work. It loads .next build artifacts and turns them into route-size rankings, shared-chunk and duplication findings, and severity-ranked fix suggestions — evidence agents can reason over instead of inspecting raw .next manifests.
perfonext-build-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:
npx -y @perfonext/build-mcp
Or install globally:
npm install -g @perfonext/build-mcp
The executable command remains perfonext-build-mcp after installation.
Add the server to .vscode/mcp.json (the workspace MCP configuration file):
{
"servers": { "perfonext-build": { "type": "stdio", "command": "npx", "args": ["-y", "@perfonext/build-mcp"] } } }
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:
{
"mcpServers": { "perfonext-build": { "command": "npx", "args": ["-y", "@perfonext/build-mcp"] } } }
Restart Claude Desktop to pick up the new server.
Add the server with the CLI:
claude mcp add perfonext-build -- npx -y @perfonext/build-mcp
Or add it directly to .mcp.json:
{
"mcpServers": { "perfonext-build": { "command": "npx", "args": ["-y", "@perfonext/build-mcp"] } } }
Any client that supports stdio MCP servers can launch the same command/args pair: command: npx, args: ["-y", "@perfonext/build-mcp"]. Consult your client's docs for where its MCP server configuration file lives.
For a locally-built checkout, point command/args at node and the repo's dist/index.js instead, in any of the configurations above.
Then ask your assistant: _"Load the Next.js build in ./.next and show me the largest routes."_
spawn npx ENOENT / spawn node ENOENT on macOS with nvmIf the server fails to start with spawn npx ENOENT (or spawn node ENOENT), your editor/app was likely launched from the Dock/Finder and cannot see nvm. GUI apps on macOS do not load shell config (.zshrc/.bashrc), so npx/node installed via nvm are not on PATH. This applies to VS Code, Claude Desktop, and any other GUI MCP client on macOS.
Fix it by giving the MCP config an absolute npx path and a PATH that includes the same Node bin directory (dirname $(which npx)):
{
"command": "/Users/YOU/.nvm/versions/node/v /bin/npx", "args": ["-y", "@perfonext/build-mcp"], "env": { "PATH": "/Users/YOU/.nvm/versions/node/v /bin:/usr/bin:/bin" } }
Merge the command/args/env fields above into your client's server entry (e.g. under servers for VS Code or mcpServers for Claude Desktop/Code).
.next directory| Tool | Description |
|---|---|
load_build_stats | Parse a Next.js .next directory and load the build snapshot into memory |
get_largest_routes | Rank the heaviest user-facing routes by total emitted chunk bytes |
get_shared_chunks | Rank shared chunks by size and show which routes depend on them |
compare_builds | Compare a baseline and current build snapshot to show which routes and chunks grew or shrank |
explain_growth | Severity-rank which routes and chunks drove bundle growth between two builds, with evidence-backed fix suggestions |
how_to_collect_stats | Return the recipe (manual) or an action plan (automatic) to generate .next/stats.json |
load_webpack_stats | Parse .next/stats.json and link it to a loaded build; required before trace_import |
trace_import | Explain why a module or npm package is bundled by walking its import chain to the entry |
find_duplicates | Rank npm packages whose code is emitted into more than one chunk, by wasted bytes |
explain_shared_chunks | Show which packages and app code dominate the shared chunks loaded by many routes |
suggest_optimizations | Aggregate route, chunk, and webpack-stats evidence into severity-ranked, evidence-backed fix suggestions |
The output stays machine-readable and includes raw byte counts so your MCP client can explain regressions, prioritise fixes, and suggest concrete dependency or import-level follow-up.
Every suggest_optimizations finding is sized in emittedBytes — actual on-disk chunk bytes — so suggestions of different kinds rank on one scale. Unminified webpack module sizes appear only where they are named as such (moduleSizeBytes, shareOfChunkModuleBytes).
Because Next.js content-hashes emitted filenames (framework- .js, and CSS files named purely by hash), compare_builds and explain_growth match chunks across builds by a hash-normalized identity. This prevents a rehashed-but-unchanged chunk from being misreported as removed-and-recreated, while still flagging genuinely new chunks.
The core tools read build artifacts developers already have after running next build:
.next/build-manifest.json.next/prerender-manifest.json when present.next/app-build-manifest.json when present.next/app-path-routes-manifest.json when present — maps App Router manifest keys (/gallery/page) to the real paths (/gallery) the prerender manifest is keyed by, so route type, isPrerendered, and prerenderBlockedReason are read from the build rather than guessed from the pathnext build output text to derive build durationImport-level attribution (trace_import, find_duplicates, explain_shared_chunks) and the stats-enriched suggestions from suggest_optimizations additionally need a webpack module-stats file at .next/stats.json. A stock next build does not emit one; how_to_collect_stats returns the recipe to generate it. The manifest tools above never read it, so they work with or without it.
The manifest tools work with zero setup. To answer "why is this package bundled?", collect a webpack stats file first:
how_to_collect_stats({ method: 'manual' | 'automatic' }) and apply the returned steps — it adds webpack-stats-plugin and cross-env, gates a next.config hook behind ANALYZE=true && !isServer, and rebuilds with cross-env ANALYZE=true next build --webpack. Turbopack builds will not produce .next/stats.json.load_build_stats({ buildDir }) to get a buildId.load_webpack_stats({ buildId }) to parse the generated .next/stats.json.trace_import({ buildId, moduleName }) to see the import chain that pulls a module in.find_duplicates({ buildId }) to find packages bundled into more than one chunk, and explain_shared_chunks({ buildId }) to see what dominates the chunks loaded by many routes.suggest_optimizations({ buildId }) for severity-ranked, evidence-backed recommendations. It works on manifests alone and is enriched with dedupe, shared-chunk, and package-import findings once stats are loaded. Code-split advice is tailored for Next.js framework routes (/404, /500, /_error, /_app, /_document) — these are flagged to be slimmed down by trimming imports rather than split with next/dynamic, which does not apply to them.If the app builds with Turbopack there is no webpack module graph, so how_to_collect_stats says so and points back to the manifest-only tools. The attribution tools degrade gracefully with a breadcrumb when no stats file is loaded — it is never an error.
./.next and show me the largest routes.".next builds and show me which routes or shared chunks grew the most.".next builds and what I should fix first."axios in my bundle? Trace its import chain."npm install
npm run build npm test
Sample fixtures for local validation live under tests/fixtures/.
MIT