Example Next.js MCP Server
Click on "Deploy 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., "@Example Next.js MCP Serverlist available tools"
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.
Example Next.js MCP Server
Uses @vercel/mcp-adapter
Usage
This sample app uses the Vercel MCP Adapter that allows you to drop in an MCP server on a group of routes in any Next.js project.
Update app/[transport]/route.ts with your tools, prompts, and resources following the MCP TypeScript SDK documentation.
Related MCP server: Next.js MCP Server Template
Notes for running on Vercel
To use the SSE transport, requires a Redis attached to the project under
process.env.REDIS_URLMake sure you have Fluid compute enabled for efficient execution
After enabling Fluid compute, open
app/route.tsand adjustmaxDurationto 800 if you using a Vercel Pro or Enterprise account
Sample Client
script/test-client.mjs contains a sample client to try invocations.
node scripts/test-client.mjs https://mcp-for-next-js.vercel.appThis server cannot be deployed
Maintenance
Related MCP Connectors
FastMCP commerce server starter: product catalog, search, and checkout. Deploy to Vercel in 5 min.
The official MCP Server for the Mux API
- ArcjetOAuthcom.arcjet
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA sample MCP server implementation for Next.js projects that uses the Vercel MCP Adapter to handle protocol requests across different transport methods.3MIT
- -licenseNot gradedqualityNot gradedmaintenanceA 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.-
- -licenseNot gradedqualityNot gradedmaintenanceA template MCP server built with Next.js using the Vercel MCP Adapter. Provides a framework for deploying MCP servers with custom tools, prompts, and resources on Vercel with SSE transport support.-
- AlicenseNot gradedqualityDmaintenanceA template for integrating Model Context Protocol (MCP) servers into Next.js projects using the Vercel MCP Adapter. It enables developers to deploy MCP tools, prompts, and resources as API routes with optional support for Server-Sent Events.MIT