{"id":13605,"library":"next-devtools-mcp","title":"Next.js DevTools MCP","description":"Next.js DevTools MCP (Model Context Protocol) is a server-side component designed to extend Next.js development environments with AI agent capabilities. It provides a standardized interface for coding agents like Claude or Cursor to interact with and introspect running Next.js applications, enabling advanced features such as runtime diagnostics, code generation, and debugging assistance. The current stable version is `0.3.10`, with frequent patch releases indicating active development and a focus on stability, security, and incremental improvements. Key differentiators include its tight integration with the Next.js ecosystem, leveraging its internal mechanisms for deep introspection, and its adherence to the Model Context Protocol, making it compatible with a growing number of AI developer tools. It acts as a crucial bridge, allowing AI agents to understand the context of a Next.js project and provide highly relevant assistance, offering capabilities like automated upgrades, Cache Component setup, and access to documentation.","status":"active","version":"0.3.10","language":"javascript","source_language":"en","source_url":"https://github.com/vercel/next-devtools-mcp","tags":["javascript","typescript"],"install":[{"cmd":"npm install next-devtools-mcp","lang":"bash","label":"npm"},{"cmd":"yarn add next-devtools-mcp","lang":"bash","label":"yarn"},{"cmd":"pnpm add next-devtools-mcp","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for implementing the Model Context Protocol, enabling communication with AI agents.","package":"@modelcontextprotocol/sdk","optional":false},{"reason":"This package is specifically designed to interact with Next.js applications (v16+ recommended for full features). While not a direct NPM dependency of this package itself, a compatible Next.js project is a runtime requirement for its functionality.","package":"Next.js","optional":false},{"reason":"Requires Node.js v20.19 or a newer LTS version to run the server.","package":"Node.js","optional":false},{"reason":"Required package manager to install and run the server, typically via `npx` or local installation.","package":"npm | pnpm","optional":false}],"imports":[{"note":"This package is primarily a CLI server, not a library for direct JavaScript/TypeScript symbol imports. Its functionality is 'imported' into a development environment by executing it via `npx` (or a global/local installation). The `@latest` tag ensures you always run the most recent version, which is recommended due to frequent updates and security fixes.","wrong":"import { NextDevToolsMcp } from 'next-devtools-mcp';","symbol":"Next.js DevTools Server CLI Invocation","correct":"npx -y next-devtools-mcp@latest"},{"note":"While not a typical library import, developers might programmatically interact with the server by spawning it as a child process, for example, within a custom development script or CI/CD environment. This example demonstrates a basic `child_process.spawn` usage to execute the `npx` command. This package's `package.json` specifies `type: module` and exports `./dist/index.js` as the main entry point, but direct programmatic `require` or `import` of internal server logic is not the intended or stable public API.","wrong":"require('next-devtools-mcp').start();","symbol":"Programmatic Invocation via Child Process","correct":"import { spawn } from 'child_process';\n\nconst mcpProcess = spawn('npx', ['-y', 'next-devtools-mcp@latest'], {\n  stdio: ['inherit', 'inherit', 'inherit'],\n  shell: true\n});\n\nmcpProcess.on('error', (err) => console.error('Failed to start MCP server:', err));\nmcpProcess.on('exit', (code) => console.log(`MCP server exited with code ${code}`));"},{"note":"For AI coding agents (MCP clients) to 'import' or utilize the Next.js DevTools MCP server, they need to be configured with the command to run the server. This JSON snippet illustrates the typical configuration structure used by various MCP clients (e.g., Cursor, Gemini, Claude Code, VS Code). This configuration tells the client how to launch and connect to the `next-devtools-mcp` server.","wrong":"const NextDevTools = new NextDevToolsMCP();","symbol":"MCP Client Configuration (conceptual 'import')","correct":"{\n  \"mcpServers\": {\n    \"next-devtools\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"next-devtools-mcp@latest\"]\n    }\n  }\n}"}],"quickstart":{"code":"{\n  \"name\": \"my-next-app\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"start\": \"next start\",\n    \"lint\": \"next lint\"\n  },\n  \"dependencies\": {\n    \"react\": \"^19.0.0\",\n    \"react-dom\": \"^19.0.0\",\n    \"next\": \"^16.0.7\"\n  },\n  \"devDependencies\": {\n    \"typescript\": \"^5\",\n    \"@types/node\": \"^20\",\n    \"@types/react\": \"^19\",\n    \"@types/react-dom\": \"^19\",\n    \"eslint\": \"^8\",\n    \"eslint-config-next\": \"16.0.7\"\n  }\n}\n\n// 1. Create a Next.js 16+ project (if you don't have one)\n// npx create-next-app@latest my-next-app --ts\n// cd my-next-app\n\n// 2. Start your Next.js development server (in a separate terminal):\n// npm run dev\n\n// 3. Configure your AI agent (e.g., Cursor, Claude Code, Gemini) to use the next-devtools-mcp server.\n//    Add this to your MCP client's configuration file (e.g., .cursor/mcp.json, .mcp.json, etc.):\n/*\n{\n  \"mcpServers\": {\n    \"next-devtools\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"next-devtools-mcp@latest\"]\n    }\n  }\n}\n*/\n\n// 4. Once configured, your AI agent can now use Next.js DevTools capabilities.\n//    Example CLI command to add the server (specific to your client, e.g., for Gemini):\n// gemini mcp add next-devtools npx next-devtools-mcp@latest\n","lang":"typescript","description":"Demonstrates how to set up and run a Next.js 16+ project, and then configure an AI agent to connect to the `next-devtools-mcp` server for enhanced development capabilities and runtime diagnostics."},"warnings":[{"fix":"Upgrade `next-devtools-mcp` to version `0.3.7` or later to include the `@modelcontextprotocol/sdk` update to `1.24.3` (which includes the fix for `1.24.0`). Ensure all MCP-related dependencies are kept up-to-date.","tags":["security","vulnerability","CVE","dependency","DNS rebinding"],"message":"A critical-severity vulnerability (CVE-2025-66414) was discovered in `@modelcontextprotocol/sdk` affecting versions prior to 1.24.0, involving insecure default initialization of resources. This could allow an attacker to invoke tools or access resources via DNS rebinding if an HTTP-based MCP server is running locally without authentication and DNS rebinding protection is not explicitly enabled. Note: This specific `next-devtools-mcp` server uses stdio transport, which is generally not affected by this particular DNS rebinding vulnerability, but upgrading dependencies is crucial for overall security.","severity":"breaking","affected_versions":"<0.3.7"},{"fix":"Upgrade `next-devtools-mcp` to version `0.3.7` or later. More critically, ensure your Next.js application is upgraded to Next.js `16.0.7` or a patched version of Next.js 15.x/16.x that addresses CVE-2025-55182. Deploy platform-level WAF rules where applicable.","message":"Next.js versions prior to 16.0.7 (and React 19) were affected by a critical remote code execution vulnerability (CVE-2025-55182) in React Server Components, also known as 'React2Shell'. Although this `next-devtools-mcp` update fixes its internal Next.js dependency, the vulnerability primarily exists in the Next.js *application* itself, requiring application-level upgrades.","severity":"breaking","affected_versions":"<0.3.7"},{"fix":"Upgrade to `next-devtools-mcp v0.3.0` or later. Migrate any client configurations or custom integrations to use the official MCP TypeScript SDK and remove references to experimental MCPs.","message":"Prior to `v0.3.0`, the package might have referenced 'experimental MCP' implementations. These outdated experimental interfaces were removed and superseded by the official MCP TypeScript SDK.","severity":"deprecated","affected_versions":"<0.3.0"},{"fix":"Upgrade `next-devtools-mcp` to version `0.3.1` or later to resolve internal CJS/ESM module resolution inconsistencies.","message":"Older versions of `next-devtools-mcp` (around `v0.3.0`) experienced issues with CommonJS (CJS) imports for internal 'find process helper' utilities, potentially leading to module resolution errors in certain environments.","severity":"gotcha","affected_versions":"~0.3.0"},{"fix":"Upgrade `next-devtools-mcp` to version `0.3.3` or later to benefit from improved server discovery, particularly in WSL environments. Ensure your Next.js application is running (`npm run dev`) and correctly configured.","message":"The server has undergone improvements in Next.js server discovery and specifically fixed issues related to server discovery within Windows Subsystem for Linux (WSL) environments, where it might have failed to connect to running Next.js instances.","severity":"gotcha","affected_versions":"<0.3.3"}],"env_vars":null,"search_vec":"'0.3.10':63 'access':147 'act':117 'activ':69 'adher':99 'advanc':47 'agent':24,33,124 'ai':23,113,123 'allow':122 'applic':45 'assist':57,137 'autom':141 'bridg':121 'cach':143 'capabl':25,139 'claud':35 'code':32,53 'compat':107 'compon':15,144 'context':8,103,128 'crucial':120 'current':59 'cursor':37 'debug':56 'deep':95 'design':16 'develop':20,70,114 'devtool':2,5 'diagnost':52 'differenti':81 'document':149 'ecosystem':89 'enabl':46 'environ':21 'extend':18 'featur':48 'focus':73 'frequent':65 'generat':54 'grow':110 'high':135 'improv':79 'includ':82 'increment':78 'indic':68 'integr':85 'interact':39 'interfac':30 'intern':92 'introspect':42,96 'javascript':150 'key':80 'leverag':90 'like':34,140 'make':105 'mcp':3,6 'mechan':93 'model':7,102 'next.js':1,4,19,44,88,131 'number':111 'offer':138 'patch':66 'project':132 'protocol':9,104 'provid':27,134 'releas':67 'relev':136 'run':43 'runtim':51 'secur':76 'server':13 'server-sid':12 'setup':145 'side':14 'stabil':75 'stabl':60 'standard':29 'tight':84 'tool':115 'typescript':151 'understand':126 'upgrad':142 'version':61","created_at":"2026-04-20T01:55:21.594005+00:00","updated_at":"2026-04-20T01:55:21.594005+00:00","problems":[{"fix":"Upgrade `next-devtools-mcp` to version `0.3.8` or later to fix agent idle issues caused by strict reply prohibition.","cause":"An issue in earlier versions where the agent would become idle due to strict reply prohibition, preventing proper communication.","error":"Error: Agent idle caused by strict reply prohibition"},{"fix":"Increase the `startup_timeout_ms` in your MCP client's configuration. For Codex on Windows, add `env = { SystemRoot=\"C:\\Windows\", PROGRAMFILES=\"C:\\Program Files\" }` and `startup_timeout_ms = 20_000` to `.codex/config.toml`.","cause":"Default startup timeouts in some MCP clients (e.g., Codex) can be too low for the `next-devtools-mcp` server, especially on Windows or under heavy system load.","error":"MCP Server failed to start or timed out connecting (especially on Windows)"},{"fix":"Ensure your Next.js project is version 16 or above. Verify that your Next.js development server is actively running (`npm run dev`). Confirm that `next-devtools-mcp` is correctly configured in your `.mcp.json` file or client settings and restart your development server if it was already running before connecting the MCP server.","cause":"Common causes include using an incompatible Next.js version, the Next.js dev server not running, or incorrect MCP client configuration.","error":"Next DevTools MCP server not connecting to Next.js application"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"next-devtools-mcp","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/vercel/next-devtools-mcp","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/next-devtools-mcp","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","devops","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}