Set up Next.js DevTools MCP
Add the official Next.js MCP server to .mcp.json and give the coding agent live errors, routes, and docs.
- Skill Road
- Set up Next.js DevTools MCP
Published on 18.09.2026
Next.js DevTools MCP connects a coding agent to the built-in /_next/mcp endpoint of a locally running Next.js 16 dev server. Setup takes just a few minutes and requires no account.
Check requirements
The server requires Node.js 20.19 or newer and a project on Next.js 16 or later. Older Next.js versions don't expose a /_next/mcp endpoint, so the runtime tools won't work there; an upgrade can be triggered later through the agent itself.
Add the server to .mcp.json
Create or extend a .mcp.json file at the project root with the following content:
{
"mcpServers": {
"next-devtools": {
"command": "npx",
"args": ["-y", "next-devtools-mcp@latest"]
}
}
}
To set up the server automatically across all detected coding agents instead, run npx add-mcp next-devtools-mcp@latest.
Start the dev server and connect
Start the usual Next.js dev server, for example with npm run dev, pnpm dev, yarn dev, or bun dev. next-devtools-mcp automatically discovers the running process and connects to its /_next/mcp endpoint; manually configuring a port or URL is normally not necessary.
Work with the agent
Once connected, the agent can directly answer questions like "What errors are currently in my application?" or "Show me all routes in my App Router," since it accesses live errors, logs, and route/page metadata through the server's tools. For upgrades, a simple request like "Help me upgrade to Next.js 16" is enough — per the documentation, the agent uses the official upgrade codemod and walks through breaking changes.
If the connection fails
If the server won't connect, first check the installed Next.js version (16 or newer), verify the .mcp.json configuration, restart the dev server if it was already running before the MCP setup, and make sure the coding agent has actually loaded the MCP configuration.
Frequently asked questions
Is Next.js DevTools MCP official?
Yes, the repository github.com/vercel/next-devtools-mcp belongs to Vercel's GitHub organization and is published through an automated release process with npm provenance; setup is also documented in the official Next.js documentation.
Do I need a Vercel account?
No. The server runs purely locally, only connects to the running Next.js development process on the same machine, and requires neither login nor an API key.
Does the server work without Next.js 16?
The runtime tools, such as error or route queries, need the built-in `/_next/mcp` endpoint, which only exists from Next.js 16 onward. Documentation and discovery features work even without an active dev server.
Is Next.js DevTools MCP the same as the Vercel MCP Server?
No. The Vercel MCP Server manages deployments, projects, and web analytics on the Vercel platform, while Next.js DevTools MCP talks only, and locally, to a project's running Next.js dev server.
Can the server change code?
No, the documented tools are read-only (errors, logs, routes, metadata) or trigger a targeted compilation; actually writing and changing code remains the job of the coding agent itself.