io.github.vercel/next-devtools-mcp

编码与调试

by vercel

面向 Next.js 的开发工具 MCP server,基于 stdio transport 运行,便于本地调试与集成。

让 Next.js 开发工具更容易本地调试并接入自动化流程,基于 stdio transport 运行,轻量稳定,集成成本低。

什么是 io.github.vercel/next-devtools-mcp

面向 Next.js 的开发工具 MCP server,基于 stdio transport 运行,便于本地调试与集成。

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

<details> <summary>Amp</summary>
bash
amp mcp add next-devtools -- npx next-devtools-mcp@latest

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

</details> <details> <summary>Claude Code</summary>
bash
claude mcp add next-devtools npx next-devtools-mcp@latest

Or edit your MCP settings file with the config above.

</details> <details> <summary>Codex</summary>
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
</details> <details> <summary>Cursor</summary>

Install in Cursor

Or go to Cursor SettingsMCPNew MCP Server and use the config above.

</details> <details> <summary>Gemini</summary>
bash
# Project
gemini mcp add next-devtools npx next-devtools-mcp@latest

# Global
gemini mcp add -s user next-devtools npx next-devtools-mcp@latest
</details> <details> <summary>Google Antigravity</summary>

Add to .gemini/antigravity/mcp_config.json:

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

See the Antigravity MCP docs.

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

Or follow the official VS Code MCP setup guide.

</details> <details> <summary>Warp</summary>

Settings | AI | Manage MCP Servers+ Add:

  • Name: next-devtools
  • Command: npx
  • Arguments: -y, next-devtools-mcp@latest
</details>

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:

code
Next Devtools, what errors are in my Next.js application?
Next Devtools, show me the structure of my routes
Next 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).

<details> <summary><code>nextjs_index</code> — discover servers</summary>

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.

</details> <details> <summary><code>nextjs_call</code> — run a runtime tool</summary>

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.

</details> <details> <summary><code>nextjs_docs</code> — find version-accurate docs</summary>

Does not fetch docs. Next.js 16+ ships its full docs (markdown, matching your installed version) at node_modules/next/dist/docs/. This tool returns that path and how to read it, so the agent uses version-accurate docs instead of training-data guesses. On older Next.js, it recommends npx @next/codemod@latest upgrade latest.

Input: topic (optional), project_path (optional, defaults to cwd).

</details> <details> <summary><code>browser_eval</code> — set up browser automation</summary>

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.

</details>

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 foundnextjs_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.git
cd next-devtools-mcp
pnpm install
pnpm 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

常见问题

io.github.vercel/next-devtools-mcp 是什么?

面向 Next.js 的开发工具 MCP server,基于 stdio transport 运行,便于本地调试与集成。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描157.8k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描157.8k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描157.8k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
88.0k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
58.5k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
48.5k

评论