Add mcp-use build, CORS, and serverless tracing to a Next.js config.
The MCP build runs when Next evaluates next.config, for both development and production builds. This removes the need for a separate prebuild script.
next.config
Existing Next.js configuration to augment.
MCP source, route, and project-root settings.
The augmented configuration after the MCP project is built.
import { withMcpUse } from "mcp-use/next";export default withMcpUse(); Copy
import { withMcpUse } from "mcp-use/next";export default withMcpUse();
Add mcp-use build, CORS, and serverless tracing to a Next.js config.
The MCP build runs when Next evaluates
next.config, for both development and production builds. This removes the need for a separate prebuild script.