MCP Boilerplate Next.js
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Boilerplate Next.jsshow me how to add a custom tool to the MCP route"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Apps — Minimal Next.js Starter
A minimal Next.js starter for building MCP Apps — interactive UIs that MCP hosts render alongside tool calls.
How it works
The Next.js app serves two roles:
MCP server (
app/mcp/route.ts) — registers tools and resources viamcp-handlerand@modelcontextprotocol/ext-apps.Widget UI (
app/page.tsx) — a React page that MCP hosts render inside a sandboxed iframe. The MCP route self-fetches the rendered page HTML and serves it as an MCP resource.
The useMcpApp hook (app/hooks/use-mcp-app.ts) connects to the host via the App class from @modelcontextprotocol/ext-apps and provides tool input/result data as React state.
Related MCP server: ChatGPT Apps SDK Next.js Starter
Getting started
pnpm installLocal development with a tunnel
MCP Apps need a public HTTPS URL. Use ngrok (or any tunnel):
ngrok http 3000Copy the HTTPS URL and set it in .env:
BASE_URL=https://xxxx-xxx-xxx.ngrok-free.appThen start the dev server:
pnpm devConnect to a host
Add your MCP server URL to any MCP host that supports Apps:
https://xxxx-xxx-xxx.ngrok-free.app/mcpFor example, in ChatGPT, Cursor, or Claude.ai: Settings > Apps > add the URL above.
Project structure
app/
page.tsx — Homepage (widget UI)
about/page.tsx — Example sub-page (navigation demo)
counter/page.tsx — Example sub-page (interactivity demo)
mcp/route.ts — MCP server endpoint
hooks/use-mcp-app.ts — React hook for the MCP Apps bridge
layout.tsx — Root layout with iframe bootstrap patches
baseUrl.ts — Public URL resolver (tunnel / Vercel)
middleware.ts — CORS headers for cross-origin iframe access
next.config.ts — assetPrefix for iframe asset loadingKey files
app/mcp/route.ts— Define your tools and resources here. Thegreettool is a minimal example.app/page.tsx— Your widget UI. Edit this like any Next.js page. It receives tool data viauseMcpApp().app/hooks/use-mcp-app.ts— SingletonAppbridge withsessionStoragepersistence. ProvidestoolInput,toolResult, andconnectedstate.
Deploy
Deploy to Vercel — no additional configuration needed. The BASE_URL is automatically derived from Vercel's environment variables in production.
Once deployed, connect it to any MCP host using:
https://your-app.vercel.app/mcpFor example, in ChatGPT, Cursor, or Claude.ai: Settings > Apps > add the URL above as a connector.
Learn more
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -license-quality-maintenanceA template for building MCP servers in Next.js applications using the Vercel MCP Adapter. Provides a foundation for adding custom tools, prompts, and resources to any Next.js project with deployment support on Vercel.
- Flicense-qualityDmaintenanceA minimal MCP server demonstrating how to build ChatGPT-compatible applications using Next.js with widget rendering capabilities. Provides a starter template for integrating Next.js applications with the ChatGPT Apps SDK through the Model Context Protocol.
- Alicense-qualityDmaintenanceA template for deploying Model Context Protocol servers as Next.js routes using the mcp-handler adapter, enabling easy integration of MCP tools, prompts, and resources into any Next.js application.MIT
- Flicense-quality-maintenanceA minimal starter for building OpenAI Apps SDK compatible MCP servers that support native widget rendering within ChatGPT. It demonstrates how to integrate Next.js tools and resources into the ChatGPT interface using the Model Context Protocol.
Related MCP Connectors
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Build, deploy, and operate hosted web apps on VibeKit (vibekit.bot) from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BenPDev/mcp-boilerplate-nextjs'
If you have feedback or need assistance with the MCP directory API, please join our Discord server