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

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

把编码助手连接到正在运行的 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 密钥或请求头。
安装前请注意
会收集匿名使用遥测(工具名称、错误事件、会话 ID、时间戳、操作系统与 Node.js 版本),并在用户主目录下保存本地文件;可通过 NEXT_TELEMETRY_DISABLED 关闭。它会扫描常见本地端口以查找开发服务器,并读取项目文件以定位随包文档。文档与浏览器工具只返回指引,助手随后可能执行全局 npm 安装等命令。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Next Devtools Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

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:

bash
npx add-mcp next-devtools-mcp@latest

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:

json
{  "mcpServers": {    "next-devtools": {      "command": "npx",      "args": ["-y", "next-devtools-mcp@latest"]    }  }}

[!NOTE] next-devtools-mcp@latest keeps your client on the latest version.

Client-specific setup

Amp
bash
amp mcp add next-devtools -- npx next-devtools-mcp@latest

Or follow Amp's MCP docs with the config above.

Claude Code
bash
claude mcp add next-devtools npx next-devtools-mcp@latest

Or edit your MCP settings file with the config above.

Codex
bash
codex mcp add next-devtools -- npx next-devtools-mcp@latest

Windows 11: add environment variables and a longer startup timeout to .codex/config.toml:

toml
env = { SystemRoot="C:\\Windows", PROGRAMFILES="C:\\Program Files" }startup_timeout_ms = 20_000
Cursor

Install in Cursor

Or go to Cursor Settings → MCP → New MCP Server and use the config above.

Gemini
bash
# Projectgemini mcp add next-devtools npx next-devtools-mcp@latest
# Globalgemini mcp add -s user next-devtools npx next-devtools-mcp@latest
Google Antigravity

Add to .gemini/antigravity/mcp_config.json:

json
{  "mcpServers": {    "next-devtools": {      "command": "npx",      "args": ["-y", "next-devtools-mcp@latest"]    }  }}

See the Antigravity MCP docs.

VS Code / Copilot
bash
code --add-mcp '{"name":"next-devtools","command":"npx","args":["-y","next-devtools-mcp@latest"]}'

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:

bash
npm run dev

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:

Next Devtools, what errors are in my Next.js application?Next Devtools, show me the structure of my routesNext Devtools, what's in the development server logs?

The agent calls nextjs_index to discover servers, then nextjs_call to query their real state.

Tools

ToolWhat it does
nextjs_indexDiscover running Next.js dev servers and list each one's runtime MCP tools.
nextjs_callCall a runtime tool on a discovered server (errors, routes, logs, Server Actions).
nextjs_docsGateway. Point the agent at version-accurate docs in node_modules/next/dist/docs/.
browser_evalGateway. Point the agent at the agent-browser CLI for browser automation.

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 errors
  • get_logs — path to the dev log file (browser console + server output)
  • get_page_metadata — routes, pages, component metadata
  • get_project_metadata — project structure, config, dev server URL
  • get_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 port
  • toolName (required) — runtime tool to invoke
  • args (optional) — arguments object, only if the tool requires them
jsonc
{ "port": 3000, "toolName": "get_errors" }

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_docs no longer fetches docs over the network. It points the agent at the docs Next.js bundles at node_modules/next/dist/docs/ (or recommends upgrading). The nextjs-docs://llms-index resource is removed.

Removed:

  • init tool — it only enforced the old docs-fetch workflow.
  • upgrade_nextjs_16 and enable_cache_components tools and their prompts — now distributed as agent skills.
  • All cache-components://, nextjs16://, and nextjs-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):

bash
export NEXT_TELEMETRY_DISABLED=1

Delete local telemetry data anytime:

bash
rm -rf ~/.next-devtools-mcp

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:

  1. Start it: npm run dev
  2. Confirm Next.js 16+ (the /_next/mcp endpoint only exists there)
  3. Verify it started without errors

browser_eval and nextjs_docs work without a dev server.

Local Development

bash
git clone https://github.com/vercel/next-devtools-mcp.gitcd next-devtools-mcppnpm installpnpm build

Point your MCP client at the local build:

json
{  "mcpServers": {    "next-devtools": {      "command": "node",      "args": ["/absolute/path/to/next-devtools-mcp/dist/index.js"]    }  }}

Or with Codex:

bash
codex mcp add next-devtools-local -- node dist/index.js

See the Next.js MCP documentation for how MCP works with Next.js and coding agents.

License

MIT

来源:README.md,提交 1e8dcfa

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

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

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Vercel 集成