
Next Devtools Mcp
io.github.vercel由 GitHub 帳號 vercel 發布v0.3.6更新於 Oct 24, 2026
Next.js development tools MCP server with stdio transport
發布方自己的服務:Vercel Mcp
概覽
把編碼助理連接到執行中的 Next.js 16+ 開發伺服器,讀取即時錯誤、路由與日誌,並引導它使用隨套件附帶的文件與瀏覽器工具。
- 可以做什麼
- 探索執行中的 Next.js 開發伺服器,並列出各自內建的執行階段工具
- 查詢已探索伺服器的建置、執行階段與型別錯誤、開發日誌、頁面與專案中繼資料,以及 Server Action 原始碼
- 找出隨已安裝版本附帶的 Next.js 文件,文件缺少時提供替代指引
- 引導助理使用 agent-browser 命令列工具進行瀏覽器自動化,未安裝時提供安裝步驟
- 適用情境
- 適合助理在處理 Next.js 16+ 專案、需要查看執行中開發伺服器的真實狀態(錯誤、路由、日誌)而非憑猜測時使用。也適合讓助理查閱與已安裝版本相符的文件。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js v20.19 或更新的 LTS 版本,以及 npm 或 pnpm。探索與呼叫工具需要有執行中的 Next.js 16+ 開發伺服器(其 /_next/mcp 端點預設開啟)。未宣告需要帳號、API 金鑰或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Next Devtools Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Next.js DevTools MCP
[npm next-devtools-mcp package]
next-devtools-mcp is a Model Context Protocol (MCP) server that connects coding agents like Claude and Cursor to your running Next.js dev server.
It is a thin connector. It discovers running Next.js 16+ dev servers and proxies their built-in MCP endpoint (/_next/mcp) so agents get live runtime errors, routes, and logs. It also ships two gateways that point agents at tools they run directly: version-accurate docs and the agent-browser CLI.
[!NOTE] Docs and migration workflows no longer live in this server. Next.js bundles its own docs at
node_modules/next/dist/docs/, and upgrade / Cache Components workflows are distributed as agent skills. See Migrating from 0.3.x.
Requirements
- Node.js v20.19 or a newer LTS version
- npm or pnpm
- Next.js 16+ with a running dev server (for
nextjs_index/nextjs_call)
Install
Install for all your coding agents with add-mcp:
Add -y to skip the prompt and install to all detected agents. Add -g to install globally across all projects.
Or add the config to your MCP client manually:
[!NOTE]
next-devtools-mcp@latestkeeps your client on the latest version.
Client-specific setup
Amp
Or follow Amp's MCP docs with the config above.
Claude Code
Or edit your MCP settings file with the config above.
Codex
Windows 11: add environment variables and a longer startup timeout to .codex/config.toml:
Gemini
VS Code / Copilot
Or follow the official VS Code MCP setup guide.
Warp
Settings | AI | Manage MCP Servers → + Add:
- Name:
next-devtools - Command:
npx - Arguments:
-y, next-devtools-mcp@latest
Quick Start
Start your Next.js dev server:
Next.js 16+ enables its MCP endpoint by default at http://localhost:3000/_next/mcp. next-devtools-mcp discovers and connects to it automatically — no config needed.
Then ask your agent about the running app:
The agent calls nextjs_index to discover servers, then nextjs_call to query their real state.
Tools
The gateways do not do the work themselves — they tell the agent where the docs are or how to install/run the CLI, and the agent runs it directly (faster than proxying through MCP).
nextjs_index — discover servers
Scans common ports for running Next.js 16+ dev servers and lists each server's built-in runtime tools at /_next/mcp. No parameters.
Runtime tools exposed by Next.js (varies by version):
get_errors— current build, runtime, and type errorsget_logs— path to the dev log file (browser console + server output)get_page_metadata— routes, pages, component metadataget_project_metadata— project structure, config, dev server URLget_server_action_by_id— resolve a Server Action ID to its source file
Output: JSON listing discovered servers (port, PID, URL) and their tools.
nextjs_call — run a runtime tool
Calls one runtime tool on a discovered server. Run nextjs_index first to find the port and tool name.
Input:
port(required) — dev server porttoolName(required) — runtime tool to invokeargs(optional) — arguments object, only if the tool requires them
Output: JSON with the tool's result. Upstream requests, including response-body reads, have a 60-second deadline. Cancelling an MCP request aborts its upstream network work; discovery also releases response bodies used only to detect the protocol.
nextjs_docs — find version-accurate docs
Does not fetch docs. Recent Next.js releases bundle their docs (markdown, matching your installed version) at node_modules/next/dist/docs/. This tool checks for those files before returning reading instructions. If an installed release has no bundled docs (including early 16.x releases), it offers https://nextjs.org/docs as a fallback and asks the agent to verify APIs against the installed version. Missing dependencies receive installation guidance instead. On Next.js below 16, it recommends npx @next/codemod@latest upgrade latest.
Input: topic (optional), project_path (optional, defaults to cwd). The tool resolves next/package.json from that project, including hoisted workspace dependencies, and returns an absolute docsPath for the installed package.
browser_eval — set up browser automation
Does not drive the browser. It detects whether agent-browser is installed and returns either the entry point (agent-browser skills get core --full) or the install steps (npm install -g agent-browser, then agent-browser install), so the agent runs the CLI directly.
Input: task (optional) — used only to tailor the guidance.
Migrating from 0.3.x
Starting in 0.4.0, next-devtools-mcp is a thin connector.
Changed:
nextjs_docsno longer fetches docs over the network. It points the agent at the docs Next.js bundles atnode_modules/next/dist/docs/(or recommends upgrading). Thenextjs-docs://llms-indexresource is removed.
Removed:
inittool — it only enforced the old docs-fetch workflow.upgrade_nextjs_16andenable_cache_componentstools and their prompts — now distributed as agent skills.- All
cache-components://,nextjs16://, andnextjs-fundamentals://resources — superseded by the bundled docs.
What remains: nextjs_index, nextjs_call, nextjs_docs, and browser_eval.
Privacy & Telemetry
next-devtools-mcp collects anonymous usage telemetry to improve the tool:
- Tool usage — which MCP tools are invoked (e.g.
nextjs_index,nextjs_call) - Error events — anonymous error messages when tools fail
- Session metadata — session ID, timestamps, basic environment (OS, Node.js version)
Not collected: your code, file contents or paths, personal data, credentials, or tool arguments (only tool names).
Local files live under ~/.next-devtools-mcp/ (anonymous telemetry-id, telemetry-salt, and a debug log mcp.log).
Opt out by setting the environment variable (add it to ~/.zshrc / ~/.bashrc to persist):
Delete local telemetry data anytime:
Troubleshooting
ERR_MODULE_NOT_FOUND referencing next-devtools-mcp/dist — clear your npx cache and restart your MCP client. The server reinstalls fresh.
[error] No server info found — nextjs_index / nextjs_call need a running Next.js 16+ dev server:
- Start it:
npm run dev - Confirm Next.js 16+ (the
/_next/mcpendpoint only exists there) - Verify it started without errors
browser_eval and nextjs_docs work without a dev server.
Local Development
Point your MCP client at the local build:
Or with Codex:
See the Next.js MCP documentation for how MCP works with Next.js and coding agents.
License
MIT
來源:README.md,提交 1e8dcfa
工具
0版本歷史
1- v0.3.6最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。