Coding Horizon

Next.js Is Quietly Becoming an AI Agent Framework

Every figure, name, version and capability the finished video puts on screen, chased to a primary source. Checked 9 August 2026.

MCP support in Next.js

Next.js 16 introduced a development MCP endpoint. Next.js 16+ ships MCP support that lets coding agents reach an application’s internals in real time, through the Model Context Protocol, an open standard for agents to interact with applications over a standardized interface. The endpoint is built in and served by the development server at /_next/mcp.

next-devtools-mcp is the package that connects an agent to it. It is added to a project’s .mcp.json, and on starting the development server it discovers and connects to the running Next.js instance. It can connect to several instances on different ports and forwards tool calls to the right one.

What an agent can actually see through it. The documented tools are get_errors (build, runtime and type errors), get_logs, get_page_metadata (routes, components and rendering information), get_project_metadata, get_routes (all filesystem routes grouped by router type, with dynamic segments), get_server_action_by_id, get_compilation_issues and compile_route. Alongside those, a documentation gateway points the agent at the version-accurate docs bundled with the installed Next.js, and upgrade help runs the official codemod npx @next/codemod@latest upgrade latest.

Why it was built: agents could not see the browser

The Next.js team’s own account. Developers were seeing an error in the browser, copying the details, pasting them into an AI editor and asking for a fix, and “the problem was that agents can’t see the browser. Runtime errors, client-side warnings, and rendered components are all invisible to them.” Requesting the page HTML did not help, because “runtime failures, browser JavaScript errors, and async errors all lived in the browser, not in the HTML. The rendered page, layout segments, routes, and other internal state were invisible to agents.”

MCP was the answer: the first version surfaced internal state such as errors, routes and rendered segments, and the need for agents to discover and talk to running dev servers is what produced next-devtools-mcp.

The same post states the shift the video argues for, that the framework now has a second audience: the deeper lesson was “treating agents as first-class users of Next.js and thinking from their perspective.”

The AI SDK

A provider-agnostic TypeScript toolkit for building AI applications and agents, with a unified API for generating text, structured objects and tool calls, first-class streaming to the UI, and framework-native hooks. It presents one interface over model providers including OpenAI, Anthropic and Google, so changing provider is a change of model identifier rather than a rewrite.

Vercel’s agent infrastructure

The Next.js rendering history shown on the timeline

Static generation, server-side rendering and incremental static regeneration, then the App Router, React Server Components, Server Actions and streaming. Server Components are the default in the App Router, with Client Components used where interactivity is needed, and route handlers for protected server-side execution.

Alternatives named

Not verified