Question presented to candidate:
"Half our team now uses coding agents like Claude Code or Cursor on our Next.js app. The agents keep writing Next.js 14 code and guessing at errors. What do the Next.js Devtools MCP server and the generated AGENTS.md do about that, and what would you set up?"
What a strong answer should cover:
- Version-matched docs: since 16.2 the docs for the installed version ship in
node_modules/next/dist/docs/; since 16.3next devwrites a managed block inAGENTS.md(when it detects a coding agent) telling agents to read them instead of relying on training data. - The MCP endpoint:
next dev(16+) serves Model Context Protocol at/_next/mcpwith tools such asget_errors,get_logs,get_routes,get_server_action_by_id,get_compilation_issuesandcompile_route; thenext-devtools-mcppackage connects agent clients to it. - This gives agents the running app's view (browser errors, hydration errors, compile issues, routes) as structured data instead of screenshots or guesses.
- Control:
agentRules: falseremoves the managed block,experimental.mcpServer: falsedisables the endpoint; 16.4 addedexperimental.agentFeedback(opt-in issue reports) andnext upgrade --agent. - Limits: dev only, the agent still needs to verify in a browser, and the managed block is regenerated if deleted, so commit it.
Clarifying questions expected:
- "Which agents and editors do people use?" β the MCP client setup differs;
AGENTS.mdis read by most. - "Are there internal rules we want agents to follow?" β they go in the same file outside the managed markers.
Code / implementation expected: Optional β .mcp.json, the config options, and an example tool call.