next.js
57aa387f - Show the MCP endpoint in next dev startup output (#102923)

Commit
23 hours ago
Show the MCP endpoint in next dev startup output (#102923) ## Summary Print the built-in MCP endpoint in `next dev` startup output so developers and coding agents can find runtime diagnostics as soon as the server starts. ### Example startup From a [hosted Dispatch trial](https://evals-api.vercel.app/api/v1/runs/run-20261205T185555Z-7ed1/trials/dispatch-navigation-diagnosis__eGTKrhh) on port 3100 (network address omitted): ```text ▲ Next.js 16.6.0-preview-8acb6875-20261205 (Turbopack) - Local: http://localhost:3100 - Network: [omitted] ✓ Ready in 478ms ✓ Running next.config.mjs took 30ms - MCP: http://localhost:3100/_next/mcp - Cache Components enabled - Partial Prefetching enabled ``` The line uses the same URL as `Local`, including the actual port and protocol. Next.js prints it after loading the dev config, when MCP is enabled. ## Hosted eval: does printing the URL change MCP use? [Eight Dispatch trials](https://evals-api.vercel.app/api/v1/runs/run-20261205T185555Z-7ed1/index), two per model per arm. Both builds had the same built-in MCP endpoint. Only the PR printed its address. The task and grader were unchanged, and agents received no MCP hint or preconfigured client. | Observed in the agent traces | Base | With the startup line | | --- | ---: | ---: | | MCP URL appeared in startup output read by the agent | 0/4 | 4/4 | | Listed tools and got a `get_errors` response | 0/4 | 2/4 | | Passed all task checks | 3/4 | 3/4 | Both callers were Opus. They searched the bundled MCP guide before starting the server, then called the printed endpoint directly over HTTP. [One](https://evals-api.vercel.app/api/v1/runs/run-20261205T185555Z-7ed1/trials/dispatch-navigation-diagnosis__eGTKrhh) collected blocking-route diagnostics from several browser pages, made repairs, and checked again. The browser console showed the same diagnostics. [The other](https://evals-api.vercel.app/api/v1/runs/run-20261205T185555Z-7ed1/trials/dispatch-navigation-diagnosis__yJXZHLh) first got “No browser sessions connected,” then used the tool during browser checks and confirmed it could report a deliberately introduced issue. Neither Sol attempt called MCP even though both traces contained the startup line. This was a repair to an existing app across Home, Activity, Settings, and email delivery. Agents had to diagnose slow navigations, preserve caching and account behavior, and keep the UI stable while loading. Six of eight passed every check. Each arm had one submission fail only the delivery layout check. All six agents that didn't call MCP checked browser console output or page errors, and five also looked at dev server logs. For example, [a Sol control](https://evals-api.vercel.app/api/v1/runs/run-20261205T185555Z-7ed1/trials/dispatch-navigation-diagnosis__iPQBzQq) surfaced an uncached-data error on the delivery route without MCP. The two Opus callers reused `get_errors` later in the same session. It gave them a structured view of diagnostics the browser could also surface. This run doesn't show that the startup line alone drove discovery or improved the submitted apps. ### Coding effort Means across two trials per cell. Coding time excludes setup and grading. Input is cumulative across model calls and includes cached input. | Model | Startup line | Coding time | Input tokens (cached) | Output tokens | | --- | --- | ---: | ---: | ---: | | Sol | Off | 7.6 min | 6.83M (6.71M) | 27.2k | | Sol | On | 8.2 min | 5.74M (5.62M) | 30.8k | | Opus | Off | 16.4 min | 2.95M (2.82M) | 25.7k | | Opus | On | 8.6 min | 2.27M (2.18M) | 27.1k | One Opus control hit the 25-minute coding limit; the other finished coding in 7.8 minutes. The two Opus trials with the banner took 7.1 and 10.1 minutes. With two trials per cell and a timeout in the control, this does not establish a time or token saving. The traces don't attribute time or tokens specifically to the MCP guide lookup. ## Verification - Prettier and `git diff --check` passed. - Runtime validation: hosted CI. <!-- NEXT_JS_LLM -->
Author
Parents
Loading