SuperAPI AI Directory

next-devtools-mcp

🎖️ 📇 🏠 - Next.js runtime diagnostics, route inspection, dev server logs, docs search and upgrade guides for coding agents.

Open website

About this tool

Purpose

next-devtools-mcp is a Model Context Protocol (MCP) server used to connect coding agents such as Claude and Cursor to a running Next.js development server. It is positioned as a lightweight connector: it discovers running Next.js 16+ development servers and proxies their built-in MCP endpoint (/_next/mcp), enabling agents to obtain real-time runtime errors, routes, and logs.

Main capabilities

The tools retained by this server include nextjs_index, nextjs_call, nextjs_docs, and browser_eval.

  • nextjs_index: Scans common ports to find running Next.js 16+ development servers and lists the built-in runtime tools exposed by each server at /_next/mcp. No parameters are required. The output is JSON listing the discovered servers (port, PID, URL) and their tools.
  • nextjs_call: Calls a runtime tool on a discovered server. You must first run nextjs_index to obtain the port and tool name. Parameters include port (required, the development server port), toolName (required, the runtime tool to call), and args (optional, provided only when the tool requires parameters). The output is JSON containing the tool result. Upstream requests (including response body reads) have a 60-second deadline; canceling the MCP request aborts its upstream network work; the discovery process also releases response bodies used only for protocol detection.
  • nextjs_docs: Fetches documentation without going through the network. Newer Next.js versions bundle documentation (markdown) matching the installed version in node_modules/next/dist/docs/. This tool checks these files first, then returns reading instructions. If the installed version does not have bundled documentation (including earlier 16.x versions), it provides https://nextjs.org/docs as a fallback and requires the agent to verify the API against the installed version. When dependencies are missing, it provides installation guidance. For Next.js below 16, it recommends running npx @next/codemod@latest upgrade latest. Inputs: topic (optional), project_path (optional, defaults to cwd). This tool resolves next/package.json from that project (including hoisted workspace dependencies) and returns the absolute docsPath of the installed package.
  • browser_eval: Does not drive a browser. It detects whether agent-browser is installed and returns the entry point (agent-browser skills get core --full) or installation steps (npm install -g agent-browser, then agent-browser install), for the agent to run the CLI directly. Input: task (optional), used only to customize guidance.

The runtime tools exposed by Next.js (which vary by version) include: get_errors (current build, runtime, and type errors), get_logs (development log file paths, including browser console and server output), get_page_metadata (route, page, and component metadata), get_project_metadata (project structure, configuration, development server URL), get_server_action_by_id (resolves a Server Action ID to its source file).

Usage

Environment requirements: Node.js v20.19 or a newer LTS version; Next.js 16+ with a running development server (for nextjs_index / nextjs_call).

You can use add-mcp to install for all coding agents: add -y to skip prompts and install to all detected agents; add -g to install globally across all projects. You can also manually add the configuration to an MCP client. Using next-devtools-mcp@latest keeps the client on the latest version.

Client-specific setup: For Amp, refer to its MCP documentation and use the above configuration; for Codex, edit the MCP settings file; on Windows 11, you need to set it in .codex/config.tomAdd environment variables and a longer startup timeout in l; in Cursor, use the above configuration in Cursor Settings → MCP → New MCP Server; in Antigravity, it can be added to .gemini/antigravity/mcp_config.json; in VS Code, refer to the official MCP setup guide; it can also be set in Settings | AI | Manage MCP Servers → + Add with Name: next-devtools, Arguments: -y, next-devtools-mcp@latest.

After starting the Next.js development server, Next.js 16+ by default at http://localhost:3000/_next/mcp enables its MCP endpoint, and next-devtools-mcp will automatically discover and connect, with no configuration required. Then you can ask the agent about the running app; the agent will call nextjs_index to discover the server, then call nextjs_call to query its real status.

The gateway itself does not perform work; instead, it tells the agent where the documentation is or how to install/run the CLI, and the agent runs it directly (faster than proxying through MCP).

Use Cases

Suitable for scenarios where you use coding agents such as Claude and Cursor to develop Next.js 16+ apps, enabling the agent to access real-time errors, routes, logs, and project metadata from the running development server, and to obtain documentation guidance matching the installed version.

Limitations

Starting from 0.4.0, next-devtools-mcp is a lightweight connector. nextjs_docs no longer fetches documentation over the network, but instead points to the documentation bundled with Next.js in node_modules/next/dist/docs/ (or suggests upgrading); the nextjs-docs://llms-index resource has been removed. The init tool has been removed (it was only used to enforce the old documentation-fetching workflow). The upgrade_nextjs_16 and enable_cache_components tools and their prompts have been removed and are now distributed as agent skills. All cache-components://, nextjs16://, and nextjs-fundamentals:// resources have been removed and replaced by the bundled documentation. The remaining tools are nextjs_index, nextjs_call, nextjs_docs, and browser_eval. nextjs_index / nextjs_call require a running Next.js 16+ development server; browser_eval and nextjs_docs do not require a development server.

Privacy and Telemetry

next-devtools-mcp collects anonymous usage telemetry to improve the tool, including: tool usage (which MCP tools were called, such as nextjs_index, nextjs_call), error events (anonymous error messages when tools fail), session metadata (session ID, timestamp, basic environment such as OS and Node.js version). It does not collect: code, file contents or paths, personal data, credentials, or tool arguments (only tool names). Local files are located at ~/.next-devtools-mcp/ (anonymous telemetry-id, telemetry-salt, and debug log mcp.log). You can opt out by setting an environment variable (add it to ~/.zshrc / ~/.bashrc to persist it), and you can delete local telemetry data at any time.

Troubleshooting

  • ERR_MODULE_NOT_FOUND referencing next-devtools-mcp/dist: clear the npx cache and restart the MCP client; the server will reinstall.
  • [error] No server info found: nextjs_index / nextjs_call require a running Next.js 16+ development server. You can run npm run dev to start it; confirm it is Next.js 16+ (the /_next/mcp endpoint exists only in that version); verify that startup has no errors. browser_eval and nextjs_docs do not require a development server.

Local Development

You can point the MCP client to a local build. For how MCP works with Next.js and coding agents, see the Next.js MCP documentation.