Is the Next.js MCP server safe? What it can reach
What the Next.js MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.
Next.js 16 and later serves an MCP endpoint at /_next/mcp from the dev server, and Vercel’s next-devtools-mcp package connects agents to it. Everything runs on your machine with no sign-in. The endpoint is on by default and gives agents errors, logs and routes from the running app. Set experimental.mcpServer to false to turn it off.
Who maintains it
| Implementation | Kind | Status |
|---|---|---|
| Next.js dev server MCP endpoint (Vercel, built in since Next.js 16) | Official | active |
| next-devtools-mcp (Vercel) | Official | active |
It runs as a local process on your machine.
How it signs in
No credential. The endpoint belongs to your local dev server, and the docs describe no access control for it, so treat any reachable dev server as exposing its runtime tools.
What its tools can do
| Kind | Tools |
|---|---|
| Read | nextjs_index, nextjs_docs, browser_eval |
| Write | nextjs_call |
| Can’t be undone | none documented |
nextjs_call forwards a named runtime tool to the dev server. The runtime tools the docs list are get_errors, get_logs, get_page_metadata, get_project_metadata, get_routes, get_server_action_by_id, get_compilation_issues, compile_route and get_request_insights. The set varies by version. nextjs_docs and browser_eval only point the agent to docs or the agent-browser CLI.
Built-in limits
| Option | What it does |
|---|---|
experimental.mcpServer | Set to false in next.config to turn off the /_next/mcp endpoint. It is on by default in Next.js 16 and later. |
NEXT_TELEMETRY_DISABLED | Set to 1 to opt out of next-devtools-mcp telemetry. |
The risks
- nextjs_call can invoke any runtime tool the dev server exposes, and that set changes by Next.js version, so a new release can add a tool you did not review.
- get_errors and get_logs return source-mapped stack traces and browser console output, which can include secrets that your app logs.
- browser_eval returns install steps such as npm install -g agent-browser when that CLI is missing, so an agent that follows them installs a global package on your machine.
- The docs describe no access control for the /_next/mcp endpoint, so run next dev on localhost only.
Limit it in Claude Code
Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:
claude mcp add nextjs -- npx -y next-devtools-mcp@latestClaude Code names MCP tools mcp__nextjs__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:
{
"permissions": {
"ask": [
"mcp__nextjs__nextjs_call"
]
}
}Limit it in Codex
Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:
[mcp_servers.nextjs]
command = "npx"
args = ["-y", "next-devtools-mcp@latest"]Checklist
- Run the dev server on localhost only.
- Set NEXT_TELEMETRY_DISABLED=1 if you do not want telemetry.
- Review the install commands browser_eval suggests before the agent runs them.
- Turn off experimental.mcpServer on shared machines.
Checked against the vendor documentation on November 25, 2026. Connecting coding agents to the Next.js MCP server · next-devtools-mcp README
What Excellent covers
Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing