Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Minimal Next.js starter for building MCP Apps — interactive UIs that MCP hosts render alongside tool calls.

Astro landing page starter with gradient background, responsive hamburger/dropdown menu, and switchable floating/fullscreen headers.
MCP Apps Next.js Starter is a minimal Next.js boilerplate for building MCP Apps — interactive UIs that MCP hosts render inside sandboxed iframes alongside tool calls.
It is a starter repository that pairs an MCP server endpoint at app/mcp/route.ts with a React widget UI at app/page.tsx. The MCP route registers tools and resources using mcp-handler and @modelcontextprotocol/ext-apps, and self-fetches the rendered page HTML to serve it as an MCP resource. It runs on Next.js and deploys to Vercel with no extra configuration.
useMcpApp bridge hook — app/hooks/use-mcp-app.ts wraps the App class from @modelcontextprotocol/ext-apps and exposes toolInput, toolResult, and connected as React state.greet tool and two sub-pages (about, counter) that demonstrate navigation and interactivity inside a host.BASE_URL environment variable is needed to connect a host.BASE_URL is automatically derived from Vercel's environment variables.middleware.ts sets CORS headers for cross-origin iframe access, and next.config.ts uses an assetPrefix so assets load correctly inside the sandbox.MCP tool developers — build interactive front-ends for MCP tools that currently return plain text or JSON, giving users a richer UI. AI application teams — prototype embedded UIs for ChatGPT, Cursor, or Claude.ai without building the full client. Next.js developers — use the starter as a reference implementation for the MCP Apps spec and the ext-apps bridge.
app/mcp/route.ts and render its input and output as a custom widget instead of raw text.After pnpm install, start a tunnel with ngrok http 3000 and copy the HTTPS URL into BASE_URL in .env. Run pnpm dev, then add the MCP server URL (for example https://your-tunnel/mcp) to a supported host under Settings > Apps. The host fetches the MCP resource, which contains the widget HTML, and renders it inside a sandboxed iframe.
An MCP App is an interactive UI that an MCP host renders alongside tool calls. This starter implements one by combining an MCP server with a React widget page that the host displays in a sandboxed iframe.
The starter's documentation explicitly names ChatGPT, Cursor, and Claude.ai as hosts where you can add the MCP server URL via Settings > Apps.
Yes, MCP Apps require a public HTTPS URL for the host to reach. The starter suggests using ngrok or any equivalent tunnel and setting that URL as the BASE_URL environment variable.
Deploy the repository to Vercel with no additional configuration. In production, BASE_URL is automatically derived from Vercel's environment variables, and you connect to hosts using your Vercel URL with the /mcp path.
