Add MCP compile_route tool#93337
Add MCP compile_route tool#93337lukesandberg wants to merge 3 commits intoeviction_semantics_for_real_this_timefrom
compile_route tool#93337Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Failing test suitesCommit: 1d1d1b7 | About building and testing Next.js
Expand output● evict-after-snapshot › should serve correct content after eviction and HMR ● evict-after-snapshot › should handle client component HMR after eviction
Expand output● after() in static pages › runs after during build
Expand output● evict-after-snapshot › should serve correct content after eviction and HMR ● evict-after-snapshot › should handle client component HMR after eviction |
c21addb to
93f92ea
Compare
Stats from current PR🔴 3 regressions
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: 4901a27 |
1e85dc1 to
7a4059f
Compare
9f379f5 to
18e3b1d
Compare
7a4059f to
1f9c55d
Compare
18e3b1d to
8261a35
Compare
1f9c55d to
5a1ac64
Compare
8261a35 to
3f1bb5d
Compare
07114f2 to
c5e00ef
Compare
d31c1a1 to
e684a7c
Compare
327ffb1 to
94bd15c
Compare
1d1d1b7 to
4901a27
Compare
4901a27 to
d805ca2
Compare

What?
Adds a
compile_routeMCP tool that triggers on-demand compilation of a specific route (app or pages) without issuing an HTTP request, and returns any compilation issues.Why?
Coding agents and benchmarking workflows need a way to warm the module graph or measure compile time for a route without standing up a live backend to satisfy the request. The existing path — hitting the URL — requires the route's runtime dependencies to be available and couples compile timing to request handling.
How?
mcp/compile_routeregistered inget-or-create-mcp-server.ts, backed by acompileRoute({ page, clientOnly })callback plumbed from the Turbopack hot reloaderensurePage/handleRouteType), so the call path matches a first navigation.subscribeToChangesopt-out onensurePageand threads it throughhandleRouteType/handlePagesErrorRoute. One-shot MCP compilations skip HMR subscription wiring — without this, each call would leak a subscription that fires on every subsequent file change for the life of the dev server.mcp/compile_routein theMcpToolNameunion.test/development/mcp-server/mcp-server-compile-route.test.ts.